Koa11y icon indicating copy to clipboard operation
Koa11y copied to clipboard

Add I18n support

Open TheJaredWilcurt opened this issue 7 years ago • 6 comments

Setup the ability to switch languages and let people contribute translations.

see: scout-app.io

TheJaredWilcurt avatar Jun 22 '17 22:06 TheJaredWilcurt

Hi, I am a freelance translator since 11 years old. I have already translated an app in 9 languages and revised more than other 3 languages (Georgian and Greek).

I use Angular, PHP and JSON to translate quickly the sites into 9 languages and still studying Georgian and Greek to translate. I have already built my client's site in PHP and translated quickly, using PHP, into 9 languages.

gusbemacbe avatar Aug 03 '17 19:08 gusbemacbe

@gusbemacbe

I've set up a Google Sheet for translation. I may still need to add some keys/text to it for translation. But it's a start.

  • https://docs.google.com/spreadsheets/d/1JeQuEyA4hFLI3sk3-heG-cG5eomFBUD5Co4i6H6YEAs/edit?usp=sharing

TheJaredWilcurt avatar Aug 04 '17 23:08 TheJaredWilcurt

Work that needs to be done for this feature:

  1. Update all strings and add any new keywords to the Google Sheet.
  2. Google translate all keys for at least one language so we can test switching between English and it. Feel free to steal any relevant translations from Scout-App.
  3. Create a cultures.js Node script that automates downloading a CSV version of the Google Sheet and converts it over to the JSON dictionary the app needs. (See Scout-App's cultures.js).
  4. Add the above script to the package.json scripts section as cultures. So we can just run npm run cultures to update the dictionary file with the latest translations.
  5. Update the dictionary.json using the automated script to have at least two translations.
  6. Implement the vue-i18n library and hook up the dictionary. See this example.
  7. Replace all strings of text with their keywords using vue-i18n.

TheJaredWilcurt avatar Sep 01 '17 18:09 TheJaredWilcurt

We could use Transifex or another service and provide po/pot files.

DanielRuf avatar Dec 11 '17 05:12 DanielRuf

@DanielRuf

I've looked into them (and others) previously. It's a good system, however the process to get open source status took too much effort and ultimately it just adds hurdles in the way of people that would volunteer to translate. Scout-App has been translated to 26 languages and I think it's because of the ease of access to being able to just do the translations in Google Sheets with as few barriers to entry as possible.

The downside is that each language only has one version of a string, meaning the translator has to make decisions about edge cases in their language. But I've never gotten any complaints about that before.

For now, I'd prefer to just use Google Sheets and a Node script to automate machine translations and converting to usable JSON for vue-i18n.

TheJaredWilcurt avatar Dec 12 '17 14:12 TheJaredWilcurt

True. Is there a translation template which can be used?

DanielRuf avatar Dec 12 '17 14:12 DanielRuf