aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-12-23 21:04:02 +0300
committerGravatar Vitaly Takmazov2020-12-23 21:04:02 +0300
commit1a7423501e2005b332d06ec33a71f0a2d2108433 (patch)
treead3f3d30c9e33561c82283cec8fe05a5ba356351 /src/main/java/com/juick
parent1f28c2fae4da4d653a98b3bfb822420835dbb78e (diff)
Fix title locale on Settings page
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/www/controllers/Settings.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java
index 70e550bb..b3750074 100644
--- a/src/main/java/com/juick/www/controllers/Settings.java
+++ b/src/main/java/com/juick/www/controllers/Settings.java
@@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
@@ -48,6 +49,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -93,7 +96,9 @@ public class Settings {
page = "main";
}
- model.addAttribute("title", "Настройки");
+ Locale locale = LocaleContextHolder.getLocale();
+
+ model.addAttribute("title", ResourceBundle.getBundle("messages", locale).getString("link.settings"));
model.addAttribute("visitor", visitor);
model.addAttribute("tags", tagService.getPopularTags());
model.addAttribute("auths", userService.getAuthCodes(visitor));