summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/models/UserPreferences.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/models/UserPreferences.java')
-rw-r--r--src/main/java/com/gitblit/models/UserPreferences.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/models/UserPreferences.java b/src/main/java/com/gitblit/models/UserPreferences.java
index baab0719..44e44933 100644
--- a/src/main/java/com/gitblit/models/UserPreferences.java
+++ b/src/main/java/com/gitblit/models/UserPreferences.java
@@ -49,6 +49,12 @@ public class UserPreferences implements Serializable {
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);
}