X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fdirectory%2Fldap%2FLdapEntry.java;h=4657c8798e41fdf40fe9b37110b593e041a7a14a;hb=d81ce40c3d1cac2a628054e4725dfec742d3f09b;hp=823bc9502e6eb9a57c9e51e6d381c9c29b94f9c8;hpb=312ddf6c458f06474caf4df2728af7090b3714a4;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/directory/ldap/LdapEntry.java b/org.argeo.util/src/org/argeo/util/directory/ldap/LdapEntry.java index 823bc9502..4657c8798 100644 --- a/org.argeo.util/src/org/argeo/util/directory/ldap/LdapEntry.java +++ b/org.argeo.util/src/org/argeo/util/directory/ldap/LdapEntry.java @@ -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(); + } + } }