How to locally generate translated websites?

Carl Schwan carl at carlschwan.eu
Thu Mar 18 19:06:44 GMT 2021


Le jeudi, mars 18, 2021 7:41 PM, Luigi Toscano <luigi.toscano at tiscali.it> a écrit :

>  Hi,
>
>  I have a question which came out in a discussion with Paolo, an Italian
>  translator, but I think the answer could be interesting for all translators.
>
>  Do we have a document which explains how to locally test (generate) the
>  websites with the translations for a specific language?
>
>  CC-ing Carl, but if anyone else has already solved this, I won't need to dig
>  this out :)

We don't have a document but I should try to create one. What would be the best
place for it?

The steps should be:

1. Download extended version from Hugo (version 0.79 or later). This can be done
from either distro package or the release page in github.
2. Download the few python dependencies: pip install python-frontmatter polib
3. clone kde-org repository and cd to he new directory
4. For kde.org, there is a script called l10n-fetch-po-files.py that makes it
possible to download all the po files. (this might need adaption for other
websites).
5. run python3 l10n-fetch-po-files.py. Alternately copy files from
<your-language>/messages/websites-kde-org/ to pos/<your language>/
6. run python3 translations.py import pos
7. run python3 translations.py generate-translations
8. /path/to/hugo mod get invent.kde.org/websites/aether-sass at hugo
8. /path/to/hugo server --buildFuture

Hopefully, I didn't forget any steps and it works, in case it doesn't
work please tell me :)

Cheers,
Carl

>
>  Ciao
>
>  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>  Luigi

</luigi.toscano at tiscali.it>


More information about the kde-i18n-doc mailing list