Skip to content

Commit

Permalink
Import strings: set target-language to en-US, rewrite original path t…
Browse files Browse the repository at this point in the history
…o en.lproj
  • Loading branch information
flodolo committed Dec 17, 2024
1 parent 29bd130 commit e355e84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/scripts/translate_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def main():
print(e)
continue

# Use en.lproj instead of en-US.lproj, make sure that target-language
# is set to en-US.
for file_node in root.xpath("//x:file", namespaces=NS):
file_node.set("target-language", "en-US")
file_node.set(
"original", file_node.get("original").replace("en-US.lproj", "en.lproj")
)

for trans_node in root.xpath("//x:trans-unit", namespaces=NS):
for source in trans_node.xpath("./x:source", namespaces=NS):
reference = source.text
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/import_strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ jobs:
cp ../firefoxios-l10n/en-US/*.xliff "${start_folder}/l10n_repo/en-US/"
# Make sure that the reference locale (en-US) has translations, i.e.
# targets defined and identical to the source.
# targets defined and identical to the source. Also rewrite paths to
# use en.lproj instead of en-US.lproj.
python "${start_folder}/l10n_repo/.github/scripts/translate_reference.py" --path "${start_folder}/l10n_repo/en-US"
# Copy strings over from es-ES to es
Expand Down

0 comments on commit e355e84

Please sign in to comment.