DemocracyOS / democracyos

Democracia en Red is focusing on specific implementations of DemocracyOS. We are working now working with governments and activists all over Latin America. If you are interested in our online participation tools you can check them out on our site.
https://democraciaos.org/en/
GNU General Public License v3.0
1.77k stars 616 forks source link

need to simplify translations #562

Closed tarasdudar closed 9 years ago

tarasdudar commented 9 years ago

This is a follow up on the issue #557. I've got it resolved and it turned out to be very simple. Looking at public/app.js I see the following locale variables already supported for time stamps. I'm assuming it's already built in capability for ago dependency inside i18n approach.

// locale key.

// locale : Moroccan Arabic (ar-ma) // locale : Arabic Saudi Arabia (ar-sa) // locale : azerbaijani (az) // locale : bulgarian (bg) // locale : Bengali (bn) // locale : breton (br) // locale : bosnian (bs) // locale : catalan (ca) // locale : czech (cs) // locale : chuvash (cv) // locale : Welsh (cy) // locale : danish (da) // locale : austrian german (de-at) // locale : german (de) // locale : modern greek (el) // locale : australian english (en-au) // locale : canadian english (en-ca) // locale : great britain english (en-gb) // locale : esperanto (eo) // locale : spanish (es) // locale : estonian (et) // locale : euskara (eu) // locale : Persian (fa) // locale : finnish (fi) // locale : faroese (fo) // locale : canadian french (fr-ca) // locale : french (fr) // locale : galician (gl) // locale : Hebrew (he) // locale : hindi (hi) // locale : hrvatski (hr) // locale : hungarian (hu) // locale : Armenian (hy-am) // locale : Bahasa Indonesia (id) // locale : icelandic (is) // locale : italian (it) // locale : japanese (ja) // locale : Georgian (ka) // locale : khmer (km) // locale : korean (ko) // locale : Luxembourgish (lb) // locale : Lithuanian (lt) // locale : latvian (lv) // locale : macedonian (mk) // locale : malayalam (ml) // locale : Marathi (mr) // locale : Bahasa Malaysia (ms-MY) // locale : norwegian bokmål (nb) // locale : nepali/nepalese // locale : dutch (nl) // locale : norwegian nynorsk (nn) // locale : polish (pl) // locale : brazilian portuguese (pt-br) // locale : portuguese (pt) // locale : romanian (ro) // locale : russian (ru) // locale : slovak (sk) // locale : slovenian (sl) // locale : Albanian (sq) // locale : Serbian-cyrillic (sr-cyrl) // locale : Serbian-latin (sr) // locale : swedish (sv) // locale : tamil (ta) // locale : thai (th) // locale : Tagalog/Filipino (tl-ph) // locale : turkish (tr) // locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn) // locale : Morocco Central Atlas Tamaziɣt (tzm) // locale : ukrainian (uk) // locale : uzbek (uz) // locale : vietnamese (vi) // locale : chinese (zh-cn) // locale : traditional chinese (zh-tw)

The problem I had was my locale key definition. I've defined "ua" as a locale key for Ukrainian language. But it is defined as "uk" inside app.js.

As soon as I've renamed my ua.json to uk.json inside lib/translations/lob directory, adjusted component.json and index.js inside /lib/translations directory and changed locale variable from "ua" to "uk" in the config directory everything worked as expected.

With this in mind I think we need to enable new users to add additional languages.

I think it will be easier if we create all the above templates for them inside lib/translations/lib directory. These would be just copies of en.json for the time being. We would also add all of these languages to component.json and index.js.

These would cut down the steps necessary for enabling a new language to only the following:

  1. Find your language file inside lib/translations/lib and adjust as needed based on the examples from other languages.
  2. Modify the "locale" variable inside the development.json/production.json accordingly.
  3. Make sure your language keyboard is included in the exports.names variable in the lib/regexps/indes.js. Refer to issue #539 for details.
  4. Add your translation to the following line inside lib/models/citizen.js userExistsError: 'There is already a citizen using %s' Refer to the issue #541.

If we add all the above languages when we fix #539 and #541. It would cut down the number of steps to just two. This would make it really straight forward for everyone to contribute on translations and also make sure the time stamps are working properly for all the languages.

I could probably help with some of that if we all decide this is the right thing to do. I just need to figure out how to commit my changes and modify wiki page.

gvilarino commented 9 years ago

Regarding language codes, we stick to ISO standard and uk is the standard for Ukranian, so please revise your setting.

For adding new languages, we will be setting up a Transifex for DOS sometime soon, but not just now.