diff options
| author | 2019-12-03 22:37:40 +0100 | |
|---|---|---|
| committer | 2019-12-03 22:37:40 +0100 | |
| commit | 705318aa39a605a4d869db588f6cffb12019a611 (patch) | |
| tree | 36383dfee24999f9928957621b655e67b20714b7 /cli | |
| parent | 0de7e84380dff5222e6728aacbbb42abaac51dd9 (diff) | |
Translate docs with po4a (#2590)
* [i18n] Add docs po4a script
* Add proof of concept
* Add a few more translations
* Hush ShellCheck and shfmt
* Make that list po4a-friendly
* drat, this document could've probably been auto-generated
* Definitive proof that it's translated from French ;-)
* Add some brand spanking new French translation
* More translation
* Mostly finish that config page
* Fix up FAQ
* More contributing
* Dev first steps
* Let's ignore that admin stuff at the very least for now
* Translate release new version, make French the source first and copy all translations
Then replace French with English in the source.
Much quicker than any alternative route.
* And add the English translation
* Minor stylistic leftover from French
* Most of first steps
* Forgot the extensions
* Use po4a 0.56 to get rid of way too many newlines
* Fix up those newlines
* No point linking to Firefox integration anymore from the new user guide
* Start on main view
* A bunch of main view stuff
* More main view
* And some subscriptions before going to bed
* First steps for devs
* More dev first steps
* Incomplete French → English dev/GH translation
Because I need to ask about that mailing list thing
* Fix typo in docs/en/developers/02_Github.md
* Translate & complete devs/github to English
* Fix up most of extensions
* Is that supposed to be a non-breaking space? Let's see
* Match up some users/mobile access
* More users/mobile access
* Add fresh French translation to Fever API
* Fix typo
* Match frontend todo thingies
* Fix a typo
* Some extensions strings
* Remove Fx subscription service from the docs
Cf. https://github.com/FreshRSS/FreshRSS/pull/2606
* Add translation for https://github.com/FreshRSS/FreshRSS/pull/2643
* fix typo as per https://github.com/FreshRSS/FreshRSS/pull/2643#discussion_r345433009
* Add some more French translations
* Update French translation as per @aledeg comment https://github.com/FreshRSS/FreshRSS/pull/2590#discussion_r345465909
* Translate some of the meaningless stuff
* Translate the rest of contributing.md to French
* Fix conflicts
* Translate Docker first steps to French
* Update with change from #2665
* Add @aledeg corrections
* Overlooked a couple @aledeg corrections thanks to GitHub autohide
* Latest @aledeg suggestions
Diffstat (limited to 'cli')
| -rwxr-xr-x | cli/translation-update.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cli/translation-update.sh b/cli/translation-update.sh new file mode 100755 index 000000000..9847dc4e0 --- /dev/null +++ b/cli/translation-update.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# This script performs the following: +# - Generate configuration file for po4a (can be configured in CONFIGFILE) +# - Generate POT file from pages/<DIRECTORY>/*.md +# - Update PO files in i18n directory with POT file +# - Generate localized pages.XX/<DIRECTORY>/*.md (where XX is the language code) +# - Remove unneeded new lines from generated pages + +# Name of the po4a configuration file +CONFIGFILE='po4a.conf' + +# List of supported languages +LANGS=(fr) + +# Check if po4a is installed +if [ -z "$(command -v po4a)" ]; then + echo 'It seems that po4a is not installed on your system.' + echo 'Please install po4a to use this script.' + exit 1 +fi + +# Generate po4a.conf file with list of TLDR pages +echo 'Generating configuration file for po4a...' +{ + echo '# WARNING: this file is generated with translation-update.sh' + echo '# DO NOT modify this file manually!' + echo "[po4a_langs] ${LANGS[*]}" + # shellcheck disable=SC2016 + echo '[po4a_paths] i18n/templates/freshrss.pot $lang:i18n/freshrss.$lang.po' +} >$CONFIGFILE + +for FILE in $(cd en && tree -f -i | grep ".md" | grep -v "admins"); do + echo "[type: text] en/$FILE \$lang:\$lang/$FILE opt:\"-o markdown\" opt:\"-M utf-8\"" >>$CONFIGFILE +done + +# Generate POT file, PO files, and pages.XX pages +echo 'Generating POT file and translated pages...' +po4a -k 0 --msgid-bugs-address 'https://github.com/FreshRSS/FreshRSS/issues' $CONFIGFILE |
