Discussed in freebsd-translators list:
https://lists.freebsd.org/archives/freebsd-translators/2025-September/000229.html
This patch is not for commit, but for demonstration. Some details need to be improved before final decision and commit.
Project goal:
Include website translation to Weblate workflow with minimum of resources and process differences comparing to documentation workflow.
Idea:
Use the same or similar tools, but join all PO files per directory to one PO file.
Workflow for website:
tools/update_translate_template_website.sh
Similar to tools/update_translate_template.sh, but
a) ignore status and releases directories
b) creates one _indexdir.po file per directory (total 23 files)
- import data to weblate, export translated data from weblate to website/content/${lang} directories
to immitate this step I wrore script tools/immitate_translation.sh, that add some text in the beginning of every string to check the next step.
It has 2 parameters - language (defailt is ru) and text string - default is language plus '>' char. Run it:
tools/immitate_translation.sh ru
this utulity and immitate_translation.pl is not for commit to production, only for this demo.
- Translation to language:
tools/translate_website.sh ru
similar to
tools/translate.sh website ru
, but it takes translation from _indexdir.po and creates all adoc files, that exist in corresponding EN directory.
If you use it with immitate_translation.sh script, you get all "translated" files with English text prepended by text added in step 2.
Current issue:
1st step creates 1 PO file per directory, and the current implementation of the tool skips header of 1st adoc file, but it includes the headers of 2nd and the rest files to the PO file. It is not a problem, but it creates additional lines, that really do not need a translation. Probably this tool has some option in adoc2po adapter to prevent this behaviour, otherwise I could write script to filter these lines from final PO file.
Also I added script to convert TOML file to PO using TOML2YAML convertor yq (installed from package). It is for demonstration only, I did not checked it in workflow. TOML files looks like static files and they are updated in sequential order, not randomly. I am not sure, that usage of Weblate will significantly improve their translation.