mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
makerst: Skip generated header for translations
This reduces diff size on branch updates for godot-docs-l10n.
(cherry picked from commit eca3785100
)
This commit is contained in:
parent
cf6da2a12e
commit
6e33e3b7af
1 changed files with 14 additions and 11 deletions
|
@ -90,6 +90,7 @@ BASE_STRINGS = [
|
||||||
"[b]Note:[/b] The returned array is [i]copied[/i] and any changes to it will not update the original property value. See [%s] for more details.",
|
"[b]Note:[/b] The returned array is [i]copied[/i] and any changes to it will not update the original property value. See [%s] for more details.",
|
||||||
]
|
]
|
||||||
strings_l10n: Dict[str, str] = {}
|
strings_l10n: Dict[str, str] = {}
|
||||||
|
writing_translation = False
|
||||||
|
|
||||||
CLASS_GROUPS: Dict[str, str] = {
|
CLASS_GROUPS: Dict[str, str] = {
|
||||||
"global": "Globals",
|
"global": "Globals",
|
||||||
|
@ -704,6 +705,8 @@ def main() -> None:
|
||||||
|
|
||||||
# Retrieve heading translations for the given language.
|
# Retrieve heading translations for the given language.
|
||||||
if not args.dry_run and args.lang != "en":
|
if not args.dry_run and args.lang != "en":
|
||||||
|
global writing_translation
|
||||||
|
writing_translation = True
|
||||||
lang_file = os.path.join(
|
lang_file = os.path.join(
|
||||||
os.path.dirname(os.path.realpath(__file__)), "..", "translations", "{}.po".format(args.lang)
|
os.path.dirname(os.path.realpath(__file__)), "..", "translations", "{}.po".format(args.lang)
|
||||||
)
|
)
|
||||||
|
@ -898,18 +901,18 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
|
||||||
if class_def.keywords is not None and class_def.keywords != "":
|
if class_def.keywords is not None and class_def.keywords != "":
|
||||||
f.write(f".. meta::\n\t:keywords: {class_def.keywords}\n\n")
|
f.write(f".. meta::\n\t:keywords: {class_def.keywords}\n\n")
|
||||||
|
|
||||||
# Warn contributors not to edit this file directly.
|
if not writing_translation: # Skip for translations to reduce diff.
|
||||||
# Also provide links to the source files for reference.
|
# Warn contributors not to edit this file directly.
|
||||||
|
# Also provide links to the source files for reference.
|
||||||
|
git_branch = get_git_branch()
|
||||||
|
source_xml_path = os.path.relpath(class_def.filepath, root_directory).replace("\\", "/")
|
||||||
|
source_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/{source_xml_path}"
|
||||||
|
generator_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/doc/tools/make_rst.py"
|
||||||
|
|
||||||
git_branch = get_git_branch()
|
f.write(".. DO NOT EDIT THIS FILE!!!\n")
|
||||||
source_xml_path = os.path.relpath(class_def.filepath, root_directory).replace("\\", "/")
|
f.write(".. Generated automatically from Godot engine sources.\n")
|
||||||
source_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/{source_xml_path}"
|
f.write(f".. Generator: {generator_github_url}.\n")
|
||||||
generator_github_url = f"https://github.com/godotengine/godot/tree/{git_branch}/doc/tools/make_rst.py"
|
f.write(f".. XML source: {source_github_url}.\n\n")
|
||||||
|
|
||||||
f.write(".. DO NOT EDIT THIS FILE!!!\n")
|
|
||||||
f.write(".. Generated automatically from Godot engine sources.\n")
|
|
||||||
f.write(f".. Generator: {generator_github_url}.\n")
|
|
||||||
f.write(f".. XML source: {source_github_url}.\n\n")
|
|
||||||
|
|
||||||
# Document reference id and header.
|
# Document reference id and header.
|
||||||
f.write(f".. _class_{sanitize_class_name(class_name)}:\n\n")
|
f.write(f".. _class_{sanitize_class_name(class_name)}:\n\n")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue