streams/util/translate

37 lines
1.1 KiB
Text
Raw Permalink Normal View History

2022-05-06 12:08:09 +00:00
#!/usr/bin/env bash
2022-05-06 20:24:12 +00:00
# Project translation script.
# Pre-requisites:
# sudo apt install gettext poedit
# Instructions:
# Execute 'util/translate xx' from your webroot,
# where 'xx' is an iso language string.
#
# If the language directory doesn't exist, create it
# by copying the contents of view/en into it.
#
# Additionally, there are a small number of template files
# ending in ".tpl" in the language directory which should
# be translated manually. Do not translate template variables
# which look like {{$variable}} or "%s" or "%d" or "%1$s".
# The text "$projectname" or "$Projectname" should also not
# be translated.
#
# The htconfig.tpl file contains code lines, so just
# translate the comment text.
#
# When finished, commit the result and issue a pull request
# to the project repository using standard git workflows.
2022-05-06 12:08:09 +00:00
if [ $# -lt 1 ]; then
echo usage: $0 language
exit 0
fi
if [ -e view/$1/messages.po ]; then
2022-05-06 12:26:54 +00:00
msgmerge --update view/$1/messages.po util/messages.po
2022-05-06 12:08:09 +00:00
poedit view/$1/messages.po
2022-05-06 12:26:54 +00:00
php util/po2php.php view/$1/messages.po
2022-05-06 20:24:12 +00:00
php -l view/$1/strings.php
2022-05-06 12:10:27 +00:00
fi