{"action":"created","issue":{"url":"https://api.github.com/repos/DemocracyOS/app/issues/562","labels_url":"https://api.github.com/repos/DemocracyOS/app/issues/562/labels{/name}","comments_url":"https://api.github.com/repos/DemocracyOS/app/issues/562/comments","events_url":"https://api.github.com/repos/DemocracyOS/app/issues/562/events","html_url":"https://github.com/DemocracyOS/app/issues/562","id":53816269,"number":562,"title":"need to simplify translations","user":{"login":"tarasdudar","id":9773348,"avatar_url":"https://avatars.githubusercontent.com/u/9773348?v=3","gravatar_id":"","url":"https://api.github.com/users/tarasdudar","html_url":"https://github.com/tarasdudar","followers_url":"https://api.github.com/users/tarasdudar/followers","following_url":"https://api.github.com/users/tarasdudar/following{/other_user}","gists_url":"https://api.github.com/users/tarasdudar/gists{/gist_id}","starred_url":"https://api.github.com/users/tarasdudar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarasdudar/subscriptions","organizations_url":"https://api.github.com/users/tarasdudar/orgs","repos_url":"https://api.github.com/users/tarasdudar/repos","events_url":"https://api.github.com/users/tarasdudar/events{/privacy}","received_events_url":"https://api.github.com/users/tarasdudar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-08T23:40:20Z","updated_at":"2015-01-09T00:38:56Z","closed_at":null,"body":"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.\r\n\r\n    // locale key.\r\n// locale : Moroccan Arabic (ar-ma)\r\n// locale : Arabic Saudi Arabia (ar-sa)\r\n// locale : azerbaijani (az)\r\n// locale : bulgarian (bg)\r\n// locale : Bengali (bn)\r\n// locale : breton (br)\r\n// locale : bosnian (bs)\r\n// locale : catalan (ca)\r\n// locale : czech (cs)\r\n// locale : chuvash (cv)\r\n// locale : Welsh (cy)\r\n// locale : danish (da)\r\n// locale : austrian german (de-at)\r\n// locale : german (de)\r\n// locale : modern greek (el)\r\n// locale : australian english (en-au)\r\n// locale : canadian english (en-ca)\r\n// locale : great britain english (en-gb)\r\n// locale : esperanto (eo)\r\n// locale : spanish (es)\r\n// locale : estonian (et)\r\n// locale : euskara (eu)\r\n// locale : Persian (fa)\r\n// locale : finnish (fi)\r\n// locale : faroese (fo)\r\n// locale : canadian french (fr-ca)\r\n// locale : french (fr)\r\n// locale : galician (gl)\r\n// locale : Hebrew (he)\r\n// locale : hindi (hi)\r\n// locale : hrvatski (hr)\r\n// locale : hungarian (hu)\r\n// locale : Armenian (hy-am)\r\n// locale : Bahasa Indonesia (id)\r\n// locale : icelandic (is)\r\n// locale : italian (it)\r\n// locale : japanese (ja)\r\n// locale : Georgian (ka)\r\n// locale : khmer (km)\r\n// locale : korean (ko)\r\n// locale : Luxembourgish (lb)\r\n// locale : Lithuanian (lt)\r\n// locale : latvian (lv)\r\n// locale : macedonian (mk)\r\n// locale : malayalam (ml)\r\n// locale : Marathi (mr)\r\n// locale : Bahasa Malaysia (ms-MY)\r\n// locale : norwegian bokmål (nb)\r\n// locale : nepali/nepalese\r\n// locale : dutch (nl)\r\n// locale : norwegian nynorsk (nn)\r\n// locale : polish (pl)\r\n// locale : brazilian portuguese (pt-br)\r\n// locale : portuguese (pt)\r\n// locale : romanian (ro)\r\n// locale : russian (ru)\r\n// locale : slovak (sk)\r\n// locale : slovenian (sl)\r\n// locale : Albanian (sq)\r\n// locale : Serbian-cyrillic (sr-cyrl)\r\n// locale : Serbian-latin (sr)\r\n// locale : swedish (sv)\r\n// locale : tamil (ta)\r\n// locale : thai (th)\r\n// locale : Tagalog/Filipino (tl-ph)\r\n// locale : turkish (tr)\r\n// locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\r\n// locale : Morocco Central Atlas Tamaziɣt (tzm)\r\n// locale : ukrainian (uk)\r\n// locale : uzbek (uz)\r\n// locale : vietnamese (vi)\r\n// locale : chinese (zh-cn)\r\n// locale : traditional chinese (zh-tw)\r\n\r\nThe 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.\r\n\r\nAs 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.\r\n\r\nWith this in mind I think we need to enable new users to add additional languages.\r\n\r\nI 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. \r\n\r\nThese would cut down the steps necessary for enabling a new language to only the following:\r\n\r\n1. Find your language file inside lib/translations/lib and adjust as needed based on the examples from other languages.\r\n2. Modify the \"locale\" variable inside the development.json/production.json accordingly.\r\n3. Make sure your language keyboard is included in the exports.names variable in the lib/regexps/indes.js. Refer to issue #539 for details.\r\n4. Add your translation to the following line inside lib/models/citizen.js\r\nuserExistsError: 'There is already a citizen using %s'\r\nRefer to the issue #541.\r\n\r\nIf 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.\r\n\r\nI 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. \r\n"},"comment":{"url":"https://api.github.com/repos/DemocracyOS/app/issues/comments/69276283","html_url":"https://github.com/DemocracyOS/app/issues/562#issuecomment-69276283","issue_url":"https://api.github.com/repos/DemocracyOS/app/issues/562","id":69276283,"user":{"login":"gvilarino","id":2538465,"avatar_url":"https://avatars.githubusercontent.com/u/2538465?v=3","gravatar_id":"","url":"https://api.github.com/users/gvilarino","html_url":"https://github.com/gvilarino","followers_url":"https://api.github.com/users/gvilarino/followers","following_url":"https://api.github.com/users/gvilarino/following{/other_user}","gists_url":"https://api.github.com/users/gvilarino/gists{/gist_id}","starred_url":"https://api.github.com/users/gvilarino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvilarino/subscriptions","organizations_url":"https://api.github.com/users/gvilarino/orgs","repos_url":"https://api.github.com/users/gvilarino/repos","events_url":"https://api.github.com/users/gvilarino/events{/privacy}","received_events_url":"https://api.github.com/users/gvilarino/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T00:38:56Z","updated_at":"2015-01-09T00:38:56Z","body":"Regarding language codes, we stick to [ISO standard](http://loc.gov/standards/iso639-2/php/code_list.php) and `uk` is the standard for Ukranian, so please revise your setting.\r\n\r\nFor adding new languages, we will be setting up a [Transifex](https://www.transifex.com/) for DOS sometime soon, but not just now."}}