|
@@ -36,7 +36,32 @@ version = os.getenv("READTHEDOCS_VERSION", "2.1")
|
|
|
# The full version, including alpha/beta/rc tags
|
|
|
release = version
|
|
|
|
|
|
-language = "en"
|
|
|
+# Language / i18n
|
|
|
+
|
|
|
+supported_languages = {
|
|
|
+ "en": "Godot Engine (%s) documentation in English",
|
|
|
+ "de": "Godot Engine (%s) Dokumentation auf Deutsch",
|
|
|
+ "es": "Documentación de Godot Engine (%s) en español",
|
|
|
+ "fr": "Documentation de Godot Engine (%s) en français",
|
|
|
+ "fi": "Godot Engine (%s) dokumentaatio suomeksi",
|
|
|
+ "it": "Godot Engine (%s) documentazione in italiano",
|
|
|
+ "ja": "Godot Engine (%s)の日本語のドキュメント",
|
|
|
+ "ko": "Godot Engine (%s) 문서 (한국어)",
|
|
|
+ "pl": "Dokumentacja Godot Engine (%s) w języku polskim",
|
|
|
+ "pt_BR": "Documentação da Godot Engine (%s) em Português Brasileiro",
|
|
|
+ "ru": "Документация Godot Engine (%s) на русском языке",
|
|
|
+ "uk": "Документація до Godot Engine (%s) українською мовою",
|
|
|
+ "zh_CN": "Godot Engine (%s) 简体中文文档",
|
|
|
+}
|
|
|
+
|
|
|
+language = os.getenv("READTHEDOCS_LANGUAGE", "en")
|
|
|
+if not language in supported_languages.keys():
|
|
|
+ print("Unknown language: " + language)
|
|
|
+ print("Supported languages: " + ", ".join(supported_languages.keys()))
|
|
|
+ print(
|
|
|
+ "The configured language is either wrong, or it should be added to supported_languages in conf.py. Falling back to 'en'."
|
|
|
+ )
|
|
|
+ language = "en"
|
|
|
|
|
|
exclude_patterns = ["_build"]
|
|
|
|
|
@@ -76,6 +101,8 @@ html_theme_options = {
|
|
|
# 'navigation_depth': 4, # Depth of the headers shown in the navigation bar
|
|
|
}
|
|
|
|
|
|
+html_title = supported_languages[language] % version
|
|
|
+
|
|
|
# VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github
|
|
|
html_context = {
|
|
|
"display_github": True, # Integrate GitHub
|
|
@@ -83,6 +110,12 @@ html_context = {
|
|
|
"github_repo": "godot-docs", # Repo name
|
|
|
"github_version": "master", # Version
|
|
|
"conf_py_path": "/", # Path in the checkout to the docs root
|
|
|
+ "godot_inject_language_links": True,
|
|
|
+ "godot_docs_supported_languages": list(supported_languages.keys()),
|
|
|
+ "godot_docs_basepath": "https://docs.godotengine.org/",
|
|
|
+ "godot_docs_suffix": ".html",
|
|
|
+ "godot_default_lang": "en",
|
|
|
+ "godot_canonical_version": "stable",
|
|
|
}
|
|
|
|
|
|
html_logo = "img/docs_logo.png"
|