Git Product home page Git Product logo

Comments (6)

munanadi avatar munanadi commented on July 29, 2024 1

This is no where close to a PR
But Here it goes. https://github.com/Aadhinana/walletkit/tree/i18n

it takes a new optional prop on WalletKitProvider itself

  • langOptions which takes the different language options that are passed
  • /public/locales/{lang}/translations.json hold the translated text.

It by default falls back to english, A selector is given as the connect button is presented.

gokimultiwallet

I really like to to contribute to this. Please help.

This currently uses a hacky approach to update for when the language changes, It uses useTranslation imported into the files that actually have no use, this is just so the state changes. Need to figure this out.

Working on how to do this properly.

from walletkit.

munanadi avatar munanadi commented on July 29, 2024

These are the steps I followed to get this working in local env for dev.

I changed the packages/walletkit/package.json to keep watching the files.

"build" : "tsc -w"
  1. Link the package/walletkit using yarn link
  2. In package/walletkit run yarn build (This will watch the ts files for changes and will also build it)
  3. In package/example link this walletkit instead of installing it by npm link @gokiprotocol/walletkit
  4. yarn run to get the example started running!
  5. DEV

from walletkit.

sungoki avatar sungoki commented on July 29, 2024

Thanks @Aadhinana. I'll see how we can include the language selection in the UI-- we should see if we can make it automatically detect the language like Uniswap does.

from walletkit.

munanadi avatar munanadi commented on July 29, 2024

i18next-browser-languagedetector this already does that I guess?
i18n.language can be used to read it from the browser and set it accordingly. But we might need to include the corresponding files for the translations.

from walletkit.

sungoki avatar sungoki commented on July 29, 2024

Great. If there are no locales specified, will the dropdown be displayed? I think we should style that.

Otherwise, I really like the change. Thank you for the code. Please make a pull request!

from walletkit.

munanadi avatar munanadi commented on July 29, 2024

Yes if the langOptions are left empty then by default it shows only english as the sole option.
like this
wihtoutLangOptions

I thought I'll ask you about the styling. Since it should be consistent with the whole thing.
Okay sure! 👍
Thanks!

PS: I would like to contribute more! Let me know what's next!

from walletkit.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.