Closed kevjin closed 1 year ago
The locale query param sets the user's language on the Elm model on init: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/js/dapp.js#L69 but then it quickly gets overridden when listening to updates here: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/elm/Main.elm#L1058 and what's interesting is that the sent preferences message could be empty if local storage is not set, so it'll default to English: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/js/ports.js#L551
locale
preferences
This fix basically sets the user language to be based on the locale query param, if there are no user preferences defined in local storage already.
The
locale
query param sets the user's language on the Elm model on init: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/js/dapp.js#L69 but then it quickly gets overridden when listening to updates here: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/elm/Main.elm#L1058 and what's interesting is that the sentpreferences
message could be empty if local storage is not set, so it'll default to English: https://github.com/compound-finance/palisade/blob/cc4b0bc0ff08d3aab76477a642b3461dd21a5241/src/js/ports.js#L551This fix basically sets the user language to be based on the
locale
query param, if there are no user preferences defined in local storage already.