¡Hola! Bonjour! Guten Tag! Introducing: Localization #1870
Montoya
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MetaMask Flask 11.2 includes a new Snaps API:
snap_getLocale
. You can now use this RPC method to get the user's language preference in MetaMask and translate your text strings accordingly.The Mystery Fox Snap shows Spanish text if the user's language setting is Spanish
Learn more about
snap_getLocale
in our docs: https://docs.metamask.io/snaps/reference/rpc-api/#snap_getlocaleCheck out an example Snap that uses
snap_getLocale
: https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/get-localeTry the latest version of Mystery Fox in MetaMask Flask, now with Spanish language support: https://montoya.github.io/random-snap/ (to see it in action, you can change your language setting in MetaMask to Spanish)
We will soon be releasing another update to support localization of strings in Snap manifest files. Then, with sufficient testing, we will eventually roll this out to MetaMask stable. Now is a great time to start localizing your Snaps! Localization support may seem like a small feature, but it means reaching the 75% of the world's population that doesn't speak English at all. Think about that: there's 8 billion humans. 2 billion speak English (some really well, some not so well). The other 6 billion do not. How do you reach 1 billion users? It helps to cast a wide net!
Let us know your thoughts on this new API, any questions you may have, and we would love to see your localized Snaps when ready!
Beta Was this translation helpful? Give feedback.
All reactions