codegame.cards icon indicating copy to clipboard operation
codegame.cards copied to clipboard

Italian

Open harisont opened this issue 3 years ago • 3 comments

Hi!

Great implementation of one of my favorite board games.

I'd love to play this in my mother tongue, and I'm open to translating both the UI and the game dictionary myself, unless you had different plans.

harisont avatar Jan 14 '22 19:01 harisont

Sure ! Do you have some knowledge of code ? Here is where you can translate the UI: https://github.com/benjamintd/codegame.cards/tree/master/locales The goal would be to create a new file called it.ts that contains the translations.

For the list of words, you can copy one of the dictionaries in that folder and past your list: https://github.com/benjamintd/codegame.cards/tree/master/lib

Let me know if there's something I can do to help !

benjamintd avatar Feb 01 '22 15:02 benjamintd

Nice, I'll start right now!

Do you have some knowledge of code ?

Yes, in fact I was also thinking that it would be nice to implement a variant where you can blend languages. I'd love to play in Swenglish some time in the future. But maybe that'd be another issue :)

harisont avatar Feb 02 '22 13:02 harisont

Awesome !

If you're comfortable with setting up the repo and testing your changes, there are a few other places where you'll need to add the it locale:

  • The list of locales https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/lib/i18n.ts
  • The list of dictionaries https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/lib/newGame.ts
  • The Next.js locales configuration https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/next.config.js
  • The language selector component https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/components/LanguageSelector.tsx
  • The language type in this file https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/lib/game.ts
  • The available locales in that "Head" here: https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/pages/index.tsx
  • In the dictionnary selector here, along with the emoji flag 🇮🇹 https://github.com/benjamintd/codegame.cards/blob/e446b6bfd772d330c6e6d7c757f3bdbed657f20a/pages/new-game.tsx

I can help with any/all of this work if you need help, otherwise feel free to send a PR :) Here's a good example of what this could look like : https://github.com/benjamintd/codegame.cards/pull/47/files

benjamintd avatar Feb 02 '22 14:02 benjamintd