-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Translations Overview
- Contributor creates a branch/fork and commits a new markdown file
new.md
does a PR it gets approved and merged into master and deployed. - During that deployment there is no translated markdown file yet so a placeholder will be generated.
- Sometime later the nightly task will run, pickup this new file and push it to transifex
- Translators at transifex will get a notification of new files at which point they can login and translate.
- When they complete the translation 100% then the next nightly task that runs will pick it up and
- Create a branch from master
- Commit translated files
- Create a PR to master from this new branch
- Add reviewers from baklava
- Contributor creates a branch/fork and decides to update a
existing.md
. They do a PR it gets approved and merged into master and deployed. - During deployment if the file had a completed translation it stays as it is. If there was no translation yet then a placeholder will be created from the updated english.
- Sometime later the nightly task will run, this will push the new file changes to transifex.
- Translators at transifex will get a notification of updated files at which point they can login and translate.
- When they complete the translation 100% then the next nightly task that runs will pick it up and
- Create a branch from master
- Commit translated files
- Create a PR to master from this new branch
- Add reviewers from baklava
- Contributor creates a branch/fork and decides to remove a
file.md
as it is not in use. They do a PR it gets approved and merged into master and deployed. - During deployment if the file had a completed translation file a placeholder will NOT get created and if it didn't then a placeholder will still NOT be generated as there will be no english version to create it from.
- Sometime later the nightly task will run and delete the file from transifex along with its translations if any.
Datadog Employees only
To run the Translation Pipeline go in the Gitlab documentation Pipeline Schedule page and Play the Nightly Build
A placeholder is the english content duplicated but with a disclaimer at the top indicating that this page isn't translated yet. This avoids hugo build errors or 404's when navigating the translated site.
There are a couple of things that prevent this
- Having the translation pipeline run as a nightly task. If we had it happen on every change to master when the translated files made their way to master it would trigger translations on those again and we would get into a loop or we would need to have to have filtering logic which can be troublesome when dealing with integrations that are coming from external repos.
- We keep source content and translated content in separate files. Its quite easy to have multiple languages in a single data file for example but that again can cause the file that comes in translated to be sent back out for translations as its shared in that way. So instead we have a file for each whether its a data file or markdown file.
In the root of the repo is a translate.yaml
configuration file. Inside this, under sources
, we specify globs of files we want to send we also specify a glob destination file name.
- src: "content/**/*.md"
dst: "*.{lang}.md"
For example here we are saying any markdown files in content/ and its child directories. Then we specify the output to be the same filename as the incoming filename but with a lang extension in between. Lang specific files like something.fr.md
will be ignored automatically or the explicit ignores in the config can handle this.
You can change for example something.fr.md
files but they will get overridden next time we merge in translations. For now they need to be also entered into transifex like a translator would so that they will come through the pipeline and changes won't be lost. We are looking at a Phase 2 to automate this next.
Because the nightly task only runs against master only changes to master will trigger translations. So a rejected PR won't get merged into master and so no changes will be sent off for translation.
If a translation pull request would for example break the site if you were to merge it you can easily reject it and you will not loose files. The next time the nightly task runs the same files will still come through. The same issue may come through too so it's advised you try fix the issues before then or to alter the PR to fix it.