The problem of SpringBoot+Freemarker internationalization

problem description

now there is a requirement that background management can switch the language of the system, rather than automatically depending on the user"s region. It is somewhat similar to Wordpress"s language choice, as shown in figure

Source: https://www.wpdaxue.com/admin.

what methods have you tried

has looked around the Internet and automatically switched according to the user"s region or the language of the browser. What is needed now is to keep the language in the same state after the user has set it up, that is to say, it is the language everywhere. Save the user settings have been done, using the key-value to store, that is, you can add a language as key data.


Is the

page from Freemarker render? If so, all the multilingual text in the template, when translating, do not follow the system locale, but translate according to the language in your key-value, because this is used very frequently and is usually cached until the next time you change the language.

if this language setting is set independently by each logged-in user, you also need to store this language setting in the settings of the current user, that is, you need to go to the current logged-in user first when translating, and then look up the language set by the current logged-in user.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e496a7-444bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e496a7-444bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?