Database backed i18n for java web-app

后端 未结 4 1500
夕颜
夕颜 2020-12-03 09:05

I\'d like to use a database to store i18n key/value pairs so we can modify / reload the i18n data at runtime. Has anyone done this? Or does anyone have an idea of how to imp

4条回答
  •  無奈伤痛
    2020-12-03 09:29

    Actuly what ScArcher2 needed is davids response which is not marked a correct or helpfull.

    The solution ScArcher2 chose to use is imo terrible mestake:) Loading ALL the translations at one time... in any bigger application its gonna kill it. Loading thousends of translations each request...

    david's method is more commonly used in real production environments. Sometimes to limit db calls, which is with every message translated, you can create groups of translations by topic, functionality etc. to preload them. But this is little bit more complex and can be substituted with good cache system.

提交回复
热议问题