Our international video pages, located at /intl/<language_tag>, read playlist and video data from Python files in the translations directory of the codebase. These Python files are updated by a script, tools/import_translations.py, which fetches the video listings from our YouTube accounts which are defined in i18n.py.
Here are the key points for working with translated videos. Updating the translations from YouTube should be done regularly (monthly is probably sufficient), while all of the other procedures are more ad hoc.
- To update the translations to reflect the latest content on YouTube
- Optional: inspect the changes using
- Commit the changes and push to stable
- To add a new YouTube account to the translation import process
- Edit the LANGUAGES variable in i18n.py
- To decide whether a new language is ready to have its own localized homepage
- Are videos for the language being imported by import_translations.py, or have you set it up to do so by editing LANGUAGES in i18n.py?
- Are there enough videos *organized into playlists* for this language? A good rule of thumb is that a language is probably ready for its own page if its YouTube account has 20 or more videos organized into playlists. Any less and the page will look pretty sparse.
- Does the language use a RTL (right-to-left) writing system, and if so, is this supported by that language's templates?
- Do you have localized versions of all of the text you need to make a homepage for the new language?
- To create a new localized homepage (assuming the criteria above have been satisfied)
- Create and populate templates/intl/<language_tag>/homepage-lite.html
- Create and populate templates/intl/<language_tag>/video-lite.html