When using setMessage it doesn't set a data-localize attribute on the element the message is added to. Due to this if you change the language after setMessage has set a message it will still appear in the previously selected language.
I think ideally instead of msg you take in the localization key instead, then set data-localize to that key and set the message by passing the key to _ inside of setMessage.
I can write up a quick PR if this implementation sounds good to you.
When using
setMessage
it doesn't set adata-localize
attribute on the element the message is added to. Due to this if you change the language aftersetMessage
has set a message it will still appear in the previously selected language.I think ideally instead of
msg
you take in the localization key instead, then setdata-localize
to that key and set the message by passing the key to_
inside ofsetMessage
.I can write up a quick PR if this implementation sounds good to you.