Read the statement by Michael Teeuw here.
Question about translations/the translation system
-
Im trying to make a module that displays a message. I’ve made translated language files, eg en.json, sv.json, uk.json etc. They work properly and is set by the global setting in config.js.
However I would like the language setting in the modules own config.js section to override global. Eg I want to be able to have global setting=sv and module setting =en (as example).
When I do that, console reports that it is using the module setting, but the display always gives me the global setting. Eg, the language of the message the module displays always shows in the langauge set in global setting.
Is there any way to change this?
-
@cgillinger This is one place where the inherited module functions are not so good
getTranslations()
happens WAY before any code is run so you can’t adjust its response based on other info the config might have provided…
and we don’t expose any functions to do the work not related to the files returned from that function
but your code could do the translations BEFORE giving the content to MM… so there would be nothing to translate
-
@sdetweil Thnx, and figures. I guess its a fringe case anyway, having one global language and doing another for this (its a birthday message module Im working on). Ill just settle for using the global settings for now.
/C
-