diff --git a/Makefile b/Makefile index e26b3dc5..f611f3b8 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ all: bash -c "./translate make" debug: bash -c "./translate make" +translations: + bash -c "./translate translations" source: tar -cvf ../${APP}_${VERSION}.orig.tar ../${APP}-${VERSION} --exclude-vcs gzip -f9n ../${APP}_${VERSION}.orig.tar diff --git a/locale/de/freedombone-controlpanel.json b/locale/de/freedombone-controlpanel.json index b10851bd..9f854128 100644 --- a/locale/de/freedombone-controlpanel.json +++ b/locale/de/freedombone-controlpanel.json @@ -93,6 +93,14 @@ "Change the name of this system": "", "New local network name": "", "The name of this system on your local network was changed successfully": "", + "Set the TLS date/time source": "", + "Enter a domain name to use as a TLS time source.\\n\\nFactors to consider when choosing a source are whether you wish that site to know that your system is 'alive' and also what might happen if an adversary were to try to mess with the date/time from that domain (i.e. how much blowback would there be).": "", + "Don't include the 'https'": "", + "That doesn't look like a domain name": "", + "Set a static local IP address": "", + "In order to forward incoming internet traffic to this system most internet routers need to know a static local IP address to send the data to.\\n\\n\nEnter a static local IP address for this system.\\n\\nIt will typically be 192.168.1.x": "", + "Set the IP address of your internet router/modem": "", + "Set the local IP address for your internet router or ADSL modem.\\n\\nIt will typically be 192.168.1.1, 192.168.1.254, or similar": "", "Backup and Restore": "", "Choose an operation:": "", "Backup data to USB drive": "", diff --git a/locale/de/freedombone-image.json b/locale/de/freedombone-image.json index d313a086..6978cb26 100644 --- a/locale/de/freedombone-image.json +++ b/locale/de/freedombone-image.json @@ -2,7 +2,7 @@ "Config file $CONFIG_FILENAME not found": "", "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters": "", "\nImage was created.\n\nYou will be able to log into it with:\n": "", - " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222\n\n Password: $PASSWORD\n": "", + " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p $SSH_PORT\n\n Password: $PASSWORD\n": "", " Username: $USERNAME\n Password: $PASSWORD\n": "", "\n Username: $USERNAME\n Password: $PASSWORD\n": "", "Username: $USERNAME\nPassword: $PASSWORD": "" diff --git a/locale/de/freedombone-sec.json b/locale/de/freedombone-sec.json index c956448f..04e32003 100644 --- a/locale/de/freedombone-sec.json +++ b/locale/de/freedombone-sec.json @@ -20,6 +20,8 @@ "An existing certificate for $renew_domain was not found": "", "Invalid domain name: $renew_domain": "", "Renew a Let's Encrypt certificate": "", + "Create a new Let's Encrypt certificate": "", + "Invalid domain name: $new_domain": "", "Import file $IMPORT_FILE not found": "", "Security settings exported to $EXPORT_FILE": "" } \ No newline at end of file diff --git a/locale/es/freedombone-controlpanel.json b/locale/es/freedombone-controlpanel.json index b10851bd..9f854128 100644 --- a/locale/es/freedombone-controlpanel.json +++ b/locale/es/freedombone-controlpanel.json @@ -93,6 +93,14 @@ "Change the name of this system": "", "New local network name": "", "The name of this system on your local network was changed successfully": "", + "Set the TLS date/time source": "", + "Enter a domain name to use as a TLS time source.\\n\\nFactors to consider when choosing a source are whether you wish that site to know that your system is 'alive' and also what might happen if an adversary were to try to mess with the date/time from that domain (i.e. how much blowback would there be).": "", + "Don't include the 'https'": "", + "That doesn't look like a domain name": "", + "Set a static local IP address": "", + "In order to forward incoming internet traffic to this system most internet routers need to know a static local IP address to send the data to.\\n\\n\nEnter a static local IP address for this system.\\n\\nIt will typically be 192.168.1.x": "", + "Set the IP address of your internet router/modem": "", + "Set the local IP address for your internet router or ADSL modem.\\n\\nIt will typically be 192.168.1.1, 192.168.1.254, or similar": "", "Backup and Restore": "", "Choose an operation:": "", "Backup data to USB drive": "", diff --git a/locale/es/freedombone-image.json b/locale/es/freedombone-image.json index d313a086..6978cb26 100644 --- a/locale/es/freedombone-image.json +++ b/locale/es/freedombone-image.json @@ -2,7 +2,7 @@ "Config file $CONFIG_FILENAME not found": "", "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters": "", "\nImage was created.\n\nYou will be able to log into it with:\n": "", - " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222\n\n Password: $PASSWORD\n": "", + " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p $SSH_PORT\n\n Password: $PASSWORD\n": "", " Username: $USERNAME\n Password: $PASSWORD\n": "", "\n Username: $USERNAME\n Password: $PASSWORD\n": "", "Username: $USERNAME\nPassword: $PASSWORD": "" diff --git a/locale/es/freedombone-sec.json b/locale/es/freedombone-sec.json index c956448f..04e32003 100644 --- a/locale/es/freedombone-sec.json +++ b/locale/es/freedombone-sec.json @@ -20,6 +20,8 @@ "An existing certificate for $renew_domain was not found": "", "Invalid domain name: $renew_domain": "", "Renew a Let's Encrypt certificate": "", + "Create a new Let's Encrypt certificate": "", + "Invalid domain name: $new_domain": "", "Import file $IMPORT_FILE not found": "", "Security settings exported to $EXPORT_FILE": "" } \ No newline at end of file diff --git a/locale/fr/freedombone-controlpanel.json b/locale/fr/freedombone-controlpanel.json index b10851bd..9f854128 100644 --- a/locale/fr/freedombone-controlpanel.json +++ b/locale/fr/freedombone-controlpanel.json @@ -93,6 +93,14 @@ "Change the name of this system": "", "New local network name": "", "The name of this system on your local network was changed successfully": "", + "Set the TLS date/time source": "", + "Enter a domain name to use as a TLS time source.\\n\\nFactors to consider when choosing a source are whether you wish that site to know that your system is 'alive' and also what might happen if an adversary were to try to mess with the date/time from that domain (i.e. how much blowback would there be).": "", + "Don't include the 'https'": "", + "That doesn't look like a domain name": "", + "Set a static local IP address": "", + "In order to forward incoming internet traffic to this system most internet routers need to know a static local IP address to send the data to.\\n\\n\nEnter a static local IP address for this system.\\n\\nIt will typically be 192.168.1.x": "", + "Set the IP address of your internet router/modem": "", + "Set the local IP address for your internet router or ADSL modem.\\n\\nIt will typically be 192.168.1.1, 192.168.1.254, or similar": "", "Backup and Restore": "", "Choose an operation:": "", "Backup data to USB drive": "", diff --git a/locale/fr/freedombone-image.json b/locale/fr/freedombone-image.json index d313a086..6978cb26 100644 --- a/locale/fr/freedombone-image.json +++ b/locale/fr/freedombone-image.json @@ -2,7 +2,7 @@ "Config file $CONFIG_FILENAME not found": "", "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters": "", "\nImage was created.\n\nYou will be able to log into it with:\n": "", - " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p 2222\n\n Password: $PASSWORD\n": "", + " ssh $USERNAME@$DEFAULT_DOMAIN_NAME -p $SSH_PORT\n\n Password: $PASSWORD\n": "", " Username: $USERNAME\n Password: $PASSWORD\n": "", "\n Username: $USERNAME\n Password: $PASSWORD\n": "", "Username: $USERNAME\nPassword: $PASSWORD": "" diff --git a/locale/fr/freedombone-sec.json b/locale/fr/freedombone-sec.json index c956448f..04e32003 100644 --- a/locale/fr/freedombone-sec.json +++ b/locale/fr/freedombone-sec.json @@ -20,6 +20,8 @@ "An existing certificate for $renew_domain was not found": "", "Invalid domain name: $renew_domain": "", "Renew a Let's Encrypt certificate": "", + "Create a new Let's Encrypt certificate": "", + "Invalid domain name: $new_domain": "", "Import file $IMPORT_FILE not found": "", "Security settings exported to $EXPORT_FILE": "" } \ No newline at end of file diff --git a/translate b/translate index d620345e..5f274006 100755 --- a/translate +++ b/translate @@ -33,6 +33,8 @@ PROJECT_NAME='freedombone' # languages to translate into language=( fr de es ) +MY_EMAIL_ADDRESS='bob@robotics.uk.to' + COMMAND_FILES=src/${PROJECT_NAME}* function install_i18next-conv { @@ -52,6 +54,7 @@ function install_i18next-conv { } function create_translation_files { + create_arg=$1 if [ ! -d /tmp/${PROJECT_NAME} ]; then mkdir -p /tmp/${PROJECT_NAME} fi @@ -59,7 +62,7 @@ function create_translation_files { for f in $COMMAND_FILES do COMMAND_NAME=$(echo $f | awk -F '/' '{print $2}') - bash --dump-po-strings src/${COMMAND_NAME} | xgettext -L PO -o /tmp/${PROJECT_NAME}/${COMMAND_NAME}.pot - + bash --dump-po-strings src/${COMMAND_NAME} | xgettext --msgid-bugs-address=$MY_EMAIL_ADDRESS -L PO -o /tmp/${PROJECT_NAME}/${COMMAND_NAME}.pot - if [ -f /tmp/${PROJECT_NAME}/${COMMAND_NAME}.pot ]; then for lang in "${language[@]}" do @@ -67,17 +70,16 @@ function create_translation_files { mkdir -p locale/${lang} fi - if [ ! -f locale/${lang}/${COMMAND_NAME}.json ]; then + if [[ ! -f locale/${lang}/${COMMAND_NAME}.json || "$create_arg" == "overwrite" ]]; then # create po file echo "Creating ${lang} Translation file for ${COMMAND_NAME}..." - msginit -l ${lang} -i /tmp/${PROJECT_NAME}/${COMMAND_NAME}.pot -o locale/${lang}/${COMMAND_NAME}.po + msginit --no-translator -l ${lang} -i /tmp/${PROJECT_NAME}/${COMMAND_NAME}.pot -o locale/${lang}/${COMMAND_NAME}.po + echo 'testing' # convert po to json if [ -f /usr/bin/i18next-conv ]; then if [ -f locale/${lang}/${COMMAND_NAME}.po ]; then - if [ ! -f locale/${lang}/${COMMAND_NAME}.json ]; then - i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.po -t locale/${lang}/${COMMAND_NAME}.json - fi + i18next-conv -l ${lang} -s locale/${lang}/${COMMAND_NAME}.po -t locale/${lang}/${COMMAND_NAME}.json fi fi @@ -125,6 +127,12 @@ function uninstall_translations { done } +if [[ $1 == "translation"* ]]; then + install_i18next-conv + create_translation_files overwrite + exit 0 +fi + if [[ $1 == "make" ]]; then install_i18next-conv create_translation_files