English is the source, so it is always whole. A key another language has not reached is not a hole in the page: the build writes the English line into it, which is why a language that is a third done still answers for every string on the site.
translation
The whole site is two thousand lines. This is what each language has of them.
Every string a reader sees lives in one repository, and a translation is a pull request against it. Nothing else has to change: the pages already ask for a key and print whatever the dictionary answers.
Two fifths of the site is the game pages, and that is the part a translator can leave for last: each one is a caption about a single game, read by the people who own it. The chrome, the dashboard and the policy are what every visitor sees on the way in.
- Copy
locales/site/en.jsto your language code and translate the lines you want. What you leave out stays English. - Copy
locales/embed/en.jsontoo. It is a few dozen words and it has to be complete, because the server paints them into an image one whole language at a time. - Run
node check.js. It refuses a translation that would break a page, and it lists what is still untranslated without refusing it. - Open the pull request. A new language also needs one line in the site and one in the server that choose which file a reader gets - say so in the request and they go in with it.
- Renaming a placeholder.
{n}is where a number is written in. A line that translates the name prints the sentence with the number missing, and nothing anywhere says so. - Leaving a tag open. Values carry
<b>and<a>. One that opens a tag and never closes it swallows the rest of the element it sits in, which breaks a layout it is not even near. - Flattening a plural. A few strings are a small function instead of a sentence, because a language with plural forms has to pick the form itself. Keep it a function, and count the raw number rather than the printed one.
And one entry per line, always. That is what makes merging a translation a swap instead of a parse.
- SteamProfiler.i18n, where every string lives ↗
- What a pull request has to hold ↗
- Tell me a string is wrong
Nothing on this page is fetched. These counts are written into the site by the same build that writes the dictionaries, because that build is the last place that still knows which half of a language was translated and which half fell back to English.