From a398abeb6977ca095271725d66579c10976adf92 Mon Sep 17 00:00:00 2001 From: Jan Kuparinen Date: Apr 09 2021 13:03:30 +0000 Subject: [PATCH 1/3] Translation flow documented --- diff --git a/modules/ROOT/pages/translation-flow.adoc b/modules/ROOT/pages/translation-flow.adoc new file mode 100644 index 0000000..bf038f6 --- /dev/null +++ b/modules/ROOT/pages/translation-flow.adoc @@ -0,0 +1,87 @@ += Translation flow (for Fedora websites) + Jan Kuparinen +:page-authors: {author} + +== General + +Fedora websites can be viewed in many languages. This page gives some details on how this happens. + +=== Tagging text + +System needs to be told what strings needs to be translated. +Generally every text inside web page should be surrounded with tags: + +[source,html] +---- +{% trans trimmed %}Translate this text.{% endtrans %} +---- + + + + + +== Generating po file +First we need to pull all translatable strings into a file called getfedora.org.pot + +This file is generated by running: + +[source,bash] +---- +podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-source.sh +---- + +This file needs to be sent to link:++https://pagure.io/fedora-web/translations++[translations repository] + +If you don't have access to the translations repository push it to fedora-websites and is should be automatically sent to translations repository with 24 hours. + +== Weblate process (How strings get translated) + +Once getfedora.org.pot file is in the translations repository it will be pulled by Weblate system and merged into translatable strings. It can then be translated by translators. + +== Manual testing +[NOTE] +==== +Any translations made here will not get propagated to the weblate of final versions of the page. +==== +You can test the changes manually by: + +1) +Update strings to the language files +[source,bash] +---- +podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-update-local.sh +---- + +Now edit desired language file, for example + +[source,bash] +---- +nano sites/getfedora.org/translations/fi/LC_MESSAGES/messages.po +---- +Find the string you want to test, format inside file is: + + `#: partials/templates/download_card.html:13` Location(s) of string. + `msgid "Download"` Text in english. + `msgstr "Lataa"` Text in desired language. + + +Edit the `msgstr` + +Once edited translations need to be combiled into more efficient format for the web server. This is done by running: + +[source,bash] +---- +podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-update-local.sh +---- + + + +==== Description of translation scripts inside sites/getfedora.org/scripts + +[NOTE] +==== +Technically scripts can be run without using podman, but will then require proper setup in the local machine. The instructions given above are safer for generic users. +==== + + + From 80d22d9b3dc4a74843a5ec93f184d27232cc78d4 Mon Sep 17 00:00:00 2001 From: Jan Kuparinen Date: Apr 09 2021 13:03:30 +0000 Subject: [PATCH 2/3] saved again --- diff --git a/modules/ROOT/pages/translation-flow.adoc b/modules/ROOT/pages/translation-flow.adoc index bf038f6..d126514 100644 --- a/modules/ROOT/pages/translation-flow.adoc +++ b/modules/ROOT/pages/translation-flow.adoc @@ -16,11 +16,7 @@ Generally every text inside web page should be surrounded with tags: {% trans trimmed %}Translate this text.{% endtrans %} ---- - - - - -== Generating po file +== Generating pot file First we need to pull all translatable strings into a file called getfedora.org.pot This file is generated by running: @@ -32,7 +28,7 @@ podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-s This file needs to be sent to link:++https://pagure.io/fedora-web/translations++[translations repository] -If you don't have access to the translations repository push it to fedora-websites and is should be automatically sent to translations repository with 24 hours. +If you don't have access to the translations repository push it to fedora-websites and create a pull request and once approved it should be automatically sent to translations repository with 24 hours. == Weblate process (How strings get translated) @@ -71,12 +67,14 @@ Once edited translations need to be combiled into more efficient format for the [source,bash] ---- -podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-update-local.sh +podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-combile-local.sh ---- +You can now change your browser setting to desired language and see how the translations are working out. +--- -==== Description of translation scripts inside sites/getfedora.org/scripts +=== Description of translation scripts inside sites/getfedora.org/scripts [NOTE] ==== From e612c297058c51ee8d96f5fdf4521dbeaacec945 Mon Sep 17 00:00:00 2001 From: Jan Kuparinen Date: Apr 09 2021 13:03:30 +0000 Subject: [PATCH 3/3] Changed combiled to compiled --- diff --git a/modules/ROOT/pages/translation-flow.adoc b/modules/ROOT/pages/translation-flow.adoc index d126514..c017809 100644 --- a/modules/ROOT/pages/translation-flow.adoc +++ b/modules/ROOT/pages/translation-flow.adoc @@ -63,11 +63,11 @@ Find the string you want to test, format inside file is: Edit the `msgstr` -Once edited translations need to be combiled into more efficient format for the web server. This is done by running: +Once edited translations need to be compiled into more efficient format for the web server. This is done by running: [source,bash] ---- -podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-combile-local.sh +podman run -it --rm -v "$(pwd):/opt/:z" fedora-websites ./scripts/translations-compile-local.sh ---- You can now change your browser setting to desired language and see how the translations are working out.