Start simplifying user manager edition.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / directory / ldap / LdapEntry.java
index 823bc9502e6eb9a57c9e51e6d381c9c29b94f9c8..4657c8798e41fdf40fe9b37110b593e041a7a14a 100644 (file)
@@ -53,4 +53,13 @@ public interface LdapEntry {
                        value = properties.get(key + ";lang-" + locale.getLanguage());
                return value;
        }
+
+       public static String toLocalizedKey(String key, Locale locale) {
+               String country = locale.getCountry();
+               if ("".equals(country)) {
+                       return key + ";lang-" + locale.getLanguage();
+               } else {
+                       return key + ";lang-" + locale.getLanguage() + "-" + locale.getCountry();
+               }
+       }
 }