Open GoogleCodeExporter opened 9 years ago
The steps should be more like this:
1. Open Config Editor - Add new value with French character to select box in
Update Profile form (example: école)
2. Login to PWM with user account, update profile, select the value with French
character
3. Save form
4. Reload form for same user, previously selected option no longer selected for
this user
Original comment by bret...@gmail.com
on 8 Sep 2014 at 5:17
I was able to get this to work for me with some customizations to
/pwm/WEB-INF/jsp/fragment/form.jsp:
Added new variable "currentValueLat" at around line 50:
currentValue = currentValue == null ? "" : currentValue;
String currentValueLat = currentValue.replace("\u00E9", "e").replace("\u00E8",
"e");
currentValue = StringEscapeUtils.escapeHtml(currentValue);
Updated code for <select> tag as below:
<select id="<%=loopConfiguration.getName()%>"
name="<%=loopConfiguration.getName()%>" style="width:60%;margin-left: 5px">
<% for (final String optionName : loopConfiguration.getSelectOptions().keySet()) {%>
<% final String optionNameLat = optionName.replace("\u00E9", "e").replace("\u00E8", "e"); %>
<option value="<%=optionName%>" <%if(optionNameLat.equals(currentValueLat)){%>selected="selected"<%}%>>
<%=loopConfiguration.getSelectOptions().get(optionName)%>
</option>
<% } %>
</select>
This only works for two French characters so far (é and è), so I just have to
continue adding more replaces.
Would be nice to have this text comparison fixed in a future release though so
that all characters work, not only French.
Original comment by bret...@gmail.com
on 10 Sep 2014 at 2:18
And what if you use "é" (without the quotes) instead of "/u00E9" in the
PwmConfiguration.xml?
Original comment by martijns...@gmail.com
on 15 Oct 2014 at 12:12
There's no way we're writing character mapping code to do "soft" language
compares like this. If you can identify an existing, well maintained,
open-source library that does this we will consider adding it.
Original comment by jrivard
on 15 Oct 2014 at 7:20
I wasn't at all suggesting adding character mappings into the code as I did,
that would be quite ridiculous. I was able to use it to get this working in my
case specifically, because I needed something now, and only had to translate
the most well known French characters.
What I was suggesting is to fix the text comparison (whatever that is) so that
characters from languages other than English are also properly matched up.
Original comment by bret...@gmail.com
on 15 Oct 2014 at 7:27
Original issue reported on code.google.com by
bret...@gmail.com
on 8 Sep 2014 at 5:15