meowfacts icon indicating copy to clipboard operation
meowfacts copied to clipboard

[I18N] Looking for Help With Translation

Open BeauBouchard opened this issue 1 year ago • 6 comments

Call for Translators

While trying to translate I learned a lot and direct translations may not be the most accurate. I am always looking for suggestions and help in this regard and let this issue stand as a call for maintainers or contributors who want to improve the translation or even help make the API available in different languages.

Translation Issues that could use your Help

  • [x] https://github.com/wh-iterabb-it/meowfacts/issues/210
  • [x] https://github.com/wh-iterabb-it/meowfacts/issues/209
  • [x] https://github.com/wh-iterabb-it/meowfacts/issues/255
  • [x] https://github.com/wh-iterabb-it/meowfacts/issues/211
  • [x] https://github.com/wh-iterabb-it/meowfacts/issues/304
  • [ ] We welcome all other languages to be included. If you plan to or want to make a contribution, its recommended you make an issue first, and we will help you get started :D

Everything Explained

I18N means Internationalization with 18 letters between I and N, its often abbreviated. Supporting languages isn't always easy, as languages often have regional dialects which is why they created the word localization. This is mapping the language to a location, an easy example of this is thinking of french in Canada or France, Spanish in Mexico vs Spain, or American English vs England's English.

We want to adhere to the Standards for Content-Language and Accept-Language going forward.

Note: Language tags are formally defined in RFC 5646, which rely on the ISO 639 standard (quite often the ISO 639-1 code list) for language codes to be used.

FAQ

Example of how to make a new Language

In this example, we add a new language file for Canadian English.

We only need to make a single file, It would be src/models/localization/eng-ca.js and look like

const facts = [
  "Cats have been the most popular pet for families in Canada since data was first collected in 1987.",
  "..."
];

const langName = "English", // normally this is the language name
  langISO = "eng", 
  langLocale = "ca", 
  langLocaleName = "Canadian"; 

module.exports = {
  langName,
  langISO,
  langLocale,
  langLocaleName,
  code: `${langISO}-${langLocale}`,
  codeName: `${langName} (${langLocaleName})`,
  facts: facts,
};

If you query the api with eng-ca language parameter you will get the facts appearing more for the tailored localization in the language of english.

Feel free to change the facts to be more meaningful to the location you want, as the original English facts are with America in mind, I would love to see what other places have for accurate and high-quality facts about cats.

:D Looking forward to all contributions

BeauBouchard avatar Jul 29 '22 16:07 BeauBouchard

Thank you very much to @ShizzaHo who completed the Russian and Ukrainian languages!

BeauBouchard avatar Jul 29 '22 16:07 BeauBouchard

We also need to document the new middleware responses in the apidocs which I am putting in https://github.com/wh-iterabb-it/meowfacts/issues/177. I am asking @switchhalt to help if they can with the documentation as well.

BeauBouchard avatar Jul 29 '22 16:07 BeauBouchard

@BeauBouchard may I add Traditional Chinese 'zh-TW' translation?

jackneer avatar Oct 16 '22 09:10 jackneer

@BeauBouchard may I add Traditional Chinese 'zh-TW' translation?

I broke that out into an issue @jackneer :D -> https://github.com/wh-iterabb-it/meowfacts/issues/211

BeauBouchard avatar Oct 31 '22 17:10 BeauBouchard

@BeauBouchard may I add Traditional South Korea 'ko-kr' translation? 🥸

sonseong10 avatar Aug 01 '23 12:08 sonseong10

@BeauBouchard may I add Traditional South Korea 'ko-kr' translation? disguised_face

That would be amazing. To help out I created a separate issue for that localization.

https://github.com/wh-iterabb-it/meowfacts/issues/304

If you are interested at all, we would love to add support for Korean language, feel free to reply in the issue and i can assign it to you.

BeauBouchard avatar Aug 01 '23 14:08 BeauBouchard