Translations
Update: see readme here
This thread will contain all info related to translating the State of CSS and State of JS surveys going forward.
Getting Started
The YAML files to translate live in this current repo, which contains our API:
- https://github.com/StateOfJS/state-of-js-graphql-results-api/tree/master/src/i18n
IMPORTANT: also check that there aren't any existing PRs for the language you want to translate first!
Getting Credit
Every translator will be credited on any site that makes use of the translations, starting with the survey-taking app. You can add your name here if it's not already there.
- https://github.com/StateOfJS/state-of-js-graphql-results-api/blob/master/src/i18n/locales.yml
Translation API
You can get extra data such as the completion percentage for a locale or the untranslated strings via our API, available at:
- https://graphiql.stateofjs.com/
Here is a sample query:
query GetLocaleData {
locale(localeId: "ru-RU") {
completion
totalCount
translatedCount
translators
untranslatedKeys
}
}
Translation Files
Surveys App
These strings are related to the app that you use to fill out the actual survey.
surveys.ymlaccounts.ymlstate_of_js_2020_survey.yml
Results App
These strings only appear in the static site that displays the survey results and stats.
results.ymlstate_of_css_2020.ymlstate_of_js_2020.yml
Both
These strings appear in both.
common.ymlstate_of_css.ymlstate_of_js.yml
Other
homepage.yml
Joining Translation Teams
It's recommended you join the translation team for the language you want to translate.
Previous Translations
You may also want to take a look at previous year's translations if that helps:
Actually I've realized we need to give translations their own repo to facilitate the translation workflow and be able to give write permissions to translators, so I will move the translation files shortly. New thread is here:
https://github.com/StateOfJS/Translations/issues/1
Sorry for all the confusion!
More thinking on the topic, I've now come to the conclusion that
- we need to give each locale its own repo
- we need to automate this entire process
Until that's done, let's keep things here and forget about the StateOfJS/Translations repo. I apologize for the back and forth, but it's really not simple to figure out a good workflow!
The new workflow we have in mind would be something like:
- A change is made to the
locale-en-USrepo. - This triggers merge PRs to every
locale-es-ES,locale-ru-RU, etc. repos. - The maintainer team for each repo can then translate the contents of the PR and resolve any merge conflicts.
After that, depending on whichever works best, we would either:
Workflow A
4a. Trigger a rebuild and redeploy of our API (this current repo) 5a. On build, the API app uses the GitHub API to fetch all the locale data from all the locale repos, cache it (in memory? on disk? or in db?), and serve it.
or:
Workflow B
4b. Trigger a second PR from the locale repo to this current repo to update the locale files in it. 5b. PR is automatically accepted which triggers a rebuild and redeploy.
Downside of this second solution: we would duplicate locale files, so we'd have to clearly mark the ones in this repo as auto-generated copies that must never be edited directly.
I'm not familiar with GitHub actions so I don't know how much of the A or B workflow can be handled by them without having to run extra bots, servers, etc. which would be a plus.
Here's the second round of translations, the new strings for the State of CSS 2020 results:
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/41de34f13a316818edd12ea9b0bafd2bb9981df3
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/1a1038dbcebaa5bb38bd91ef1124fc83439aaa01
Sadly we don't have a great translation workflow yet so your best bet is to look at the changes in those two commits and manually replicate them in your locale's files.
We'll have a third round once we've finalized a couple additional charts, along with the introduction and conclusion.
@SachaG Hi So are we supposed to make PRs with translations to this repo or there is another one? I've got a bit confused because of the latter comments in this topic
@SachaG hey, here is my russian translations for the new strings https://github.com/StateOfJS/state-of-js-graphql-results-api/pull/68
@SachaG How can I run the project locally with my translations to check if everything is alright?
@SachaG Hi So are we supposed to make PRs with translations to this repo or there is another one? I've got a bit confused because of the latter comments in this topic
Good question, for now please make PRs to this repo. Eventually we'll have a separate, dedicated repo for each language's translations but I haven't had time to set up the whole system yet.
How can I run the project locally with my translations to check if everything is alright?
It's a bit tricky but basically you need to 1) run this repo locally and 2) run the Gatsby site locally as well while pointing it to your locally-run API. I will write up some more detailed instructions.
Oh actually sorry, I just realized you wouldn't be able to run this repo locally because you'd need access to our database, which contains a lot of private data… I guess this means we need to split off this part of the API into a different repo eventually, if we want translators to be able to test their translations. Let me think about it!
More strings to translate:
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/ee873ab5b88249a5d2061a152751ad6bbf7ff24c
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/d70028d22b8ed396b30bf8535a34ec8d589b72c5
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/413c016c04a998efca47811fd96bd1185bd23c3f
We are also adding "picks", which are recommendations from various people in the CSS community. I've made them translatable but I think they're not super high priority since they do represent a lot of work to translate and are not part of the core survey results:
- https://github.com/StateOfJS/state-of-js-graphql-results-api/commit/cd6ac4d53f5665f3f62d6c8811ba1ac0bb43782d
I've added a cool new feature for translators, "translator mode"!
Go to https://2020.stateofcss.com/hi-in/technologies/css-in-js/ (password: foobar; please don't share that URL until the official launch!) or any other non-English locale and press the option/alt key on your keyboard: you should see all missing strings highlighted. You can click any of them to open a github search that will tell you (hopefully) where to find the string.
In the future we can probably improve this but it should be a good starting point :)
Hey guys I would like to contribute with pt-br translate but I didn't find any repo. Can you share with me? Thank you :)
@jpcmf we discussed this issue before for Spanish (I think?) and the conclusion was that unless there are really meaningful differences between two dialects that make them mutually hard to understand we'd rather aim for a single "neutral" locale than have to maintain two different versions.
I know Brazilian Portuguese does have a lot of differences with Portugal Portuguese though, so maybe we do need both locales in this case? What do you think? Does Wikipedia have a Brazilian Portuguese version for example? If not then I think we can follow their lead and keep a single version.
Hello everyone, congs for your effort! Can I join your group for translation in greek and also the link for join translate team is not working! I current translate open source The Modern Javascript tutorial, for the greek lang.
@ipapoutsidis that would be great! Is this link not working? https://github.com/orgs/StateOfJS/teams/translators/teams
If you let me know what the code for the greek locale would be I can create the team and add you manually.
@SachaG correct this is not working! Can you tell how to get locale for greek?
I invited you to the team. That being said we don't really use teams yet, all that's needed currently is to submit a PR to this current repo.
What I do next @SachaG ?
Thanks for invite.
Hi, thanks for your great efforts!
I would like to help improve the translation of Traditional Chinese (zh-Hant).
Good question, for now please make PRs to this repo. Eventually we'll have a separate, dedicated repo for each language's translations but I haven't had time to set up the whole system yet.
If I understand you correctly, all I have to do is to make PRs to this repo, right?
@mingjunlu yes, for now please make PRs to this repo.
@SachaG I can not push should I fork first and then push on my repo?
Hi! Is there any Japanese translation project? I wanna help (or do) that.
@ipapoutsidis you have to submit a pull request, I think GitHub has some documentation on that.
@Spice-Z that would be great! 日本語に翻訳できる人をずっと待ってた!
Btw reminder that you can join our Discord server if you have any questions.
Hi,I am a new translator~ This is the first time I want to participate in the formal translation I would like to help improve the translation of Simplified Chinese. Can I join your team?
@jpcmf we discussed this issue before for Spanish (I think?) and the conclusion was that unless there are really meaningful differences between two dialects that make them mutually hard to understand we'd rather aim for a single "neutral" locale than have to maintain two different versions.
I know Brazilian Portuguese does have a lot of differences with Portugal Portuguese though, so maybe we do need both locales in this case? What do you think? Does Wikipedia have a Brazilian Portuguese version for example? If not then I think we can follow their lead and keep a single version.
I can do the translate for pt-br @SachaG Just invite me to the group :) About your questions I think the differences are considerable to maintain both.
@jpcmf I think we'll apply the same guidelines as Wikipedia, at least for now:
The Portuguese Wikipedia community decided not to split a separate Brazilian Portuguese version off from the Portuguese Wikipedia.[6] In 2005, a proposal to fork Portuguese Wikipedia and create a Brazilian Portuguese (pt-br) version was voted down by the Wikimedia community.[7] In 2007 another one to create European Portuguese was rejected too by the Wikimedia community.[8] In 2009 another one to create in Brazilian Portuguese was rejected, but this time by language committee, according to new policies to create new Wikipedia editions,[9] with the following explanation: "Brazilian Portuguese is not a separate language.. this is a requirement."[10]
https://en.wikipedia.org/wiki/Portuguese_Wikipedia#:~:text=The%20Portuguese%20Wikipedia%20(Portuguese%3A%20Wikip%C3%A9dia,started%20on%2011%20May%202001.
@luckFine sure! I'll add you to the team, but you can already fork the repo and submit a PR even without being part of it.
@SachaG yes I got it everything is fine! Thanks
@jpcmf I think we'll apply the same guidelines as Wikipedia, at least for now:
The Portuguese Wikipedia community decided not to split a separate Brazilian Portuguese version off from the Portuguese Wikipedia.[6] In 2005, a proposal to fork Portuguese Wikipedia and create a Brazilian Portuguese (pt-br) version was voted down by the Wikimedia community.[7] In 2007 another one to create European Portuguese was rejected too by the Wikimedia community.[8] In 2009 another one to create in Brazilian Portuguese was rejected, but this time by language committee, according to new policies to create new Wikipedia editions,[9] with the following explanation: "Brazilian Portuguese is not a separate language.. this is a requirement."[10]
https://en.wikipedia.org/wiki/Portuguese_Wikipedia#:~:text=The%20Portuguese%20Wikipedia%20(Portuguese%3A%20Wikip%C3%A9dia,started%20on%2011%20May%202001.
@SachaG Ok no problem. Btw amazing work, congratuilations guys!