Change language for addon

I like to be able to switch the language specific settings in lang and _formattingOpt each time the user selects a different language for

Is there a best practice for this and is there an addon that is already doing something similar ?

Edit: Found the way I think here