| | |
| | | |
| | | public final String username; |
| | | |
| | | public String locale; |
| | | private String locale; |
| | | |
| | | private final Map<String, UserRepositoryPreferences> repositoryPreferences = new TreeMap<String, UserRepositoryPreferences>(); |
| | | |
| | |
| | | if (StringUtils.isEmpty(locale)) { |
| | | return null; |
| | | } |
| | | int underscore = locale.indexOf('_'); |
| | | if (underscore > 0) { |
| | | String lang = locale.substring(0, underscore); |
| | | String cc = locale.substring(underscore + 1); |
| | | return new Locale(lang, cc); |
| | | } |
| | | return new Locale(locale); |
| | | } |
| | | |
| | | public void setLocale(String locale) { |
| | | this.locale = locale; |
| | | } |
| | | |
| | | public UserRepositoryPreferences getRepositoryPreferences(String repositoryName) { |
| | | String key = repositoryName.toLowerCase(); |
| | | if (!repositoryPreferences.containsKey(key)) { |