Read the statement by Michael Teeuw here.
access to config language setting
-
@sdetweil the global language is accessible like this
config.language
see example https://github.com/MichMich/MagicMirror/blob/master/modules/default/clock/clock.js#L49 -
I just did added this to the calendar config and it changed it automatically:
{ module: "calendar", position: "top_left", // This can be any of the regions. Best results in left or right regions. config: { language: "fr", timezone: "France/Paris" } },
-
@strawberry-3-141 cool, thanks
-
@sdetweil said in access to config language setting:
@strawberry-3-141 cool, thanks
The kid knows his stuff! He’s a good guy! Matter of fact he gave me this to add to my module if it’s of any help :)
I use this under the start: function()
this.config.lang = this.config.lang || config.language; //automatically overrides and sets language :) this.config.units = this.config.units || config.units;
-
Sorry for necroing this post, but from all I’ve read so far, this came up with most relevant information and solutions.
My question is this - is there a reason why the language change via config was never incorporated in this module?
-
@justbob what module? this was a general question, not tied to any module
-
@sdetweil You mentioned default calendar module, and there were talks about default clock, so my questions referred to those…
-
@justbob what do you mean language change?
the modules use the default translations
set by changing language line 33 of the config.js.sample
-
@sdetweil OMG, you are right, thank you for pointing out the line!:man_bowing:
I was so focused on lines below line 39 (modules), that I completely skipped the ones above as I considered them to be mere comments… :man_facepalming_light_skin_tone:
-
@justbob everything ABOVE modules applies to all , its the overall environment