Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WeVisit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HealthTech
WeVisit
Commits
0a60f20e
Commit
0a60f20e
authored
Mar 24, 2020
by
Chris Lemaire
Browse files
Options
Downloads
Plain Diff
Merge branch '13-fix-localization-messages' into 'development'
Fix issue of localization messages not being found Closes
#13
See merge request
!11
parents
707cb971
7d878be6
No related branches found
No related tags found
2 merge requests
!215
Master 1.1.1 release
,
!11
Fix issue of localization messages not being found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/nl/tudelft/ewi/walkytalky/configuration/LocaleConfiguration.java
+17
-0
17 additions, 0 deletions
...lft/ewi/walkytalky/configuration/LocaleConfiguration.java
with
17 additions
and
0 deletions
src/main/java/nl/tudelft/ewi/walkytalky/configuration/LocaleConfiguration.java
+
17
−
0
View file @
0a60f20e
package
nl.tudelft.ewi.walkytalky.configuration
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.support.ResourceBundleMessageSource
;
import
org.springframework.web.servlet.LocaleResolver
;
import
org.springframework.web.servlet.i18n.CookieLocaleResolver
;
import
org.springframework.web.servlet.i18n.LocaleChangeInterceptor
;
...
...
@@ -15,6 +17,21 @@ import java.util.Locale;
*/
@Configuration
public
class
LocaleConfiguration
{
/**
* Bean used to resolve the messages for the current locale.
*
* @return The {@link MessageSource} bean.
*/
@Bean
(
name
=
"messageSource"
)
public
MessageSource
messageSource
()
{
ResourceBundleMessageSource
messageSource
=
new
ResourceBundleMessageSource
();
messageSource
.
setBasename
(
"messages"
);
messageSource
.
setFallbackToSystemLocale
(
false
);
messageSource
.
setCacheSeconds
(
0
);
messageSource
.
setDefaultEncoding
(
"UTF-8"
);
return
messageSource
;
}
/**
* Bean used to resolve the locale for a certain request.
* This resolver currently uses a {@link SessionLocaleResolver} that
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment