Author: thomas.heute(a)jboss.com
Date: 2009-11-26 09:50:50 -0500 (Thu, 26 Nov 2009)
New Revision: 816
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
Log:
GTNPORTAL-4: When the current language is Arabic, the screen to change back the language
shows (fran?\195?\167ais (France
Since we only define the language at this stage, I've replaced the output to show the
language only (So no parenthesis), the country was pure speculation (Except for France
which is treated differently)
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2009-11-26
13:41:45 UTC (rev 815)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2009-11-26
14:50:50 UTC (rev 816)
@@ -64,7 +64,7 @@
Locale locale = localeConfig.getLocale();
String displayName = locale.getDisplayLanguage(currentLocale);
String lang = locale.getLanguage();
- String localedName = locale.getDisplayName(locale);
+ String localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));
if (localedName == null || localedName.length() == 0)
localedName = "???";
if (locale.getDisplayName().equalsIgnoreCase(currentLocale.getDisplayName()))
@@ -136,4 +136,19 @@
}
}
}
+
+ private String capitalizeFirstLetter(String word)
+ {
+ if (word == null)
+ {
+ return null;
+ }
+ if (word.length() == 0)
+ {
+ return word;
+ }
+ StringBuilder result = new StringBuilder(word);
+ result.replace(0, 1, result.substring(0, 1).toUpperCase());
+ return result.toString();
+ }
}
\ No newline at end of file
Show replies by date