java


Change translation handling in Spring


Sorry if the code is not sufficient, I'm trying to figure out how to start implementing this.
Basic locale beans are set up in the WebMvcConfigurerAdapter
#Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver resolver = new SessionLocaleResolver();
resolver.setDefaultLocale(new Locale("en"));
return resolver;
}
#Override
public void addInterceptors(InterceptorRegistry registry) {
LocaleChangeInterceptor interceptor = new LocaleChangeInterceptor();
interceptor.setParamName("language");
registry.addInterceptor(interceptor);
}
The default functionality from this is to read translations from different [language].properties files, that I do know.
My question here is if I can change that within spring. So instead of reading translations through files I read them through my custom method/functionality.
I tried searching for a solution, but I didn't run into anything.
For example, say I have translations in some java class (purely out of example) and instead of reading files I want to read through that class, where the inner functionality would be something like:
return TranslationConstants.getMap(translationKey, locale);
The reason why I don't just use it like this everywhere is because I wouldn't like the code to be like this and so I can still use view renderers to nativelly print translations (ie. #{value} in thymeleaf)
Sorry if the question is confusing/misleading.
Pointers to other similar questions are also welcome, I just couldn't find anything.

Related Links

How do I stop previous graphics from being redrawn in Java?
Finished AP Computer Science, where should I go next? [closed]
How to plot latitude, longitude Coordinates(points wise) on a world map using java
Communication between Android and bluetooth devices
How to display table correctly?
Use setKeepWithNext in IText7.0.2
Testing of Multipart POST Request
How can Wowza get RTMP dataMessage using Java API
How com.sun.tools.javac.Main.javac use the same classpath with springboot application
12 tone Matrix Generator Help (java)
How to overcome org.springframework.dao.RecoverableDataAccessException?
JavaFX - Populate TableColumn from List<String>
Remove last characters from string
I have got something wrong in my algorithm
onActivityResult seems to be not working
What are the equivalents of Swifts integer “Overflow Operators” &*, &+ and &- in Java?

Categories

HOME
compiler-construction
cloud
proxy
gremlin
pycharm
nullpointerexception
plone
hp-exstream
raspberry-pi
platform-builder
react-router
read-eval-print-loop
adb
cmd
sharepoint-designer
packages
disassembler
blueprintjs
mouse
uber-api
qore
quicklook
decomposition
designer
graphlab
angular-ui
evopdf
nhibernate-envers
karma-jasmine
nas
css-animations
devops
javacv
dynamic-featured-image
linkerd
assistant
google-cloud-nl
xquery-3.0
uisplitview
grails-3.1
asset-pipeline
cloud-code
starteam
splice
sql-server-agent
ibpy
acoustics
user-accounts
dotcover
outlook-2013
osx-mavericks
appcompat
hendrix
hls.js
google-perftools
capacity
flow-control
titanium-android
objective-c-swift-bridge
angular-cache
instant
sts-springsourcetoolsuite
intrusion-detection
connect-by
hover-over
hexdump
ipconfig
photobucket
qtableview
quicklisp
embedded-code
appfabric-cache
p2
fscommand
tt-news
preferences
bitcoinj
article
fluentautomation
bundles
java.nio.file
viadeo
openlaszlo
uv-mapping
mysqltuner
quartz-graphics
padarn
xamlparseexception
distutils
mhtml
online-compilation
postgresql-performance
jquery-ui-layout
cinema-4d
table-footer
sudzc
icanhaz.js
xetex
yagni

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App