From 702e4b1dc3a47e9d404612a0ef6baf661e5efb7f Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Mon, 26 Jun 2017 11:01:40 +0200 Subject: [PATCH] Delete empty translation templates --- .tx/config | 30 ------------------- .../translations/messages-js.pot | 21 ------------- .../translations/messages-js.pot | 19 ------------ .../translations/messages.pot | 19 ------------ .../translations/messages-js.pot | 21 ------------- manage-i18n.sh | 12 +++++++- .../translations/messages-js.pot | 21 ------------- .../translations/messages-js.pot | 21 ------------- .../translations/messages-js.pot | 19 ------------ .../translations/messages-js.pot | 21 ------------- 10 files changed, 11 insertions(+), 193 deletions(-) delete mode 100644 importer_invenio/indico_importer_invenio/translations/messages-js.pot delete mode 100644 livesync_debug/indico_livesync_debug/translations/messages-js.pot delete mode 100644 livesync_debug/indico_livesync_debug/translations/messages.pot delete mode 100644 livesync_invenio/indico_livesync_invenio/translations/messages-js.pot delete mode 100644 payment_manual/indico_payment_manual/translations/messages-js.pot delete mode 100644 payment_paypal/indico_payment_paypal/translations/messages-js.pot delete mode 100644 vc_dummy/indico_vc_dummy/translations/messages-js.pot delete mode 100644 vc_vidyo/indico_vc_vidyo/translations/messages-js.pot diff --git a/.tx/config b/.tx/config index a70f719..b5bf6c2 100644 --- a/.tx/config +++ b/.tx/config @@ -7,12 +7,6 @@ source_file = vc_vidyo/indico_vc_vidyo/translations/messages.pot source_lang = en type = PO -[indico.vc-vidyo-messages-js] -file_filter = vc_vidyo/indico_vc_vidyo/translations//LC_MESSAGES/messages-js.po -source_file = vc_vidyo/indico_vc_vidyo/translations/messages-js.pot -source_lang = en -type = PO - [indico.search-messages] file_filter = search/indico_search/translations//LC_MESSAGES/messages.po source_file = search/indico_search/translations/messages.pot @@ -67,24 +61,12 @@ source_file = payment_paypal/indico_payment_paypal/translations/messages.pot source_lang = en type = PO -[indico.payment-paypal-messages-js] -file_filter = payment_paypal/indico_payment_paypal/translations//LC_MESSAGES/messages-js.po -source_file = payment_paypal/indico_payment_paypal/translations/messages-js.pot -source_lang = en -type = PO - [indico.payment-manual-messages] file_filter = payment_manual/indico_payment_manual/translations//LC_MESSAGES/messages.po source_file = payment_manual/indico_payment_manual/translations/messages.pot source_lang = en type = PO -[indico.payment-manual-messages-js] -file_filter = payment_manual/indico_payment_manual/translations//LC_MESSAGES/messages-js.po -source_file = payment_manual/indico_payment_manual/translations/messages-js.pot -source_lang = en -type = PO - [indico.livesync-messages] file_filter = livesync/indico_livesync/translations//LC_MESSAGES/messages.po source_file = livesync/indico_livesync/translations/messages.pot @@ -103,12 +85,6 @@ source_file = livesync_invenio/indico_livesync_invenio/translations/messages.pot source_lang = en type = PO -[indico.livesync-invenio-messages-js] -file_filter = livesync_invenio/indico_livesync_invenio/translations//LC_MESSAGES/messages-js.po -source_file = livesync_invenio/indico_livesync_invenio/translations/messages-js.pot -source_lang = en -type = PO - [indico.importer-messages] file_filter = importer/indico_importer/translations//LC_MESSAGES/messages.po source_file = importer/indico_importer/translations/messages.pot @@ -126,9 +102,3 @@ file_filter = importer_invenio/indico_importer_invenio/translations//LC_ME source_file = importer_invenio/indico_importer_invenio/translations/messages.pot source_lang = en type = PO - -[indico.importer-invenio-messages-js] -file_filter = importer_invenio/indico_importer_invenio/translations//LC_MESSAGES/messages-js.po -source_file = importer_invenio/indico_importer_invenio/translations/messages-js.pot -source_lang = en -type = PO diff --git a/importer_invenio/indico_importer_invenio/translations/messages-js.pot b/importer_invenio/indico_importer_invenio/translations/messages-js.pot deleted file mode 100644 index de95b64..0000000 --- a/importer_invenio/indico_importer_invenio/translations/messages-js.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - -msgid "Indico" -msgstr "Indico" diff --git a/livesync_debug/indico_livesync_debug/translations/messages-js.pot b/livesync_debug/indico_livesync_debug/translations/messages-js.pot deleted file mode 100644 index addf758..0000000 --- a/livesync_debug/indico_livesync_debug/translations/messages-js.pot +++ /dev/null @@ -1,19 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - diff --git a/livesync_debug/indico_livesync_debug/translations/messages.pot b/livesync_debug/indico_livesync_debug/translations/messages.pot deleted file mode 100644 index addf758..0000000 --- a/livesync_debug/indico_livesync_debug/translations/messages.pot +++ /dev/null @@ -1,19 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - diff --git a/livesync_invenio/indico_livesync_invenio/translations/messages-js.pot b/livesync_invenio/indico_livesync_invenio/translations/messages-js.pot deleted file mode 100644 index de95b64..0000000 --- a/livesync_invenio/indico_livesync_invenio/translations/messages-js.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - -msgid "Indico" -msgstr "Indico" diff --git a/manage-i18n.sh b/manage-i18n.sh index d0730d7..f0b7cc2 100755 --- a/manage-i18n.sh +++ b/manage-i18n.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash USAGE="$0 [init |extract|update |compile ]" @@ -31,7 +31,17 @@ for plugin in $(find . -name setup.py -exec sh -c 'basename $(dirname $0)' {} \; TRANSLATIONS_DIR="./indico_${plugin}/translations" [[ ! -d "$TRANSLATIONS_DIR" ]] && mkdir "$TRANSLATIONS_DIR" pybabel extract -o "${TRANSLATIONS_DIR}/messages.pot" "indico_${plugin}" -F ../babel.cfg + num_strings=$(grep msgid "${TRANSLATIONS_DIR}/messages.pot" | wc -l) + if (( $num_strings == 1 )); then + echo "deleting empty dict ${TRANSLATIONS_DIR}/messages.pot" + rm "${TRANSLATIONS_DIR}/messages.pot" + fi pybabel extract -o "${TRANSLATIONS_DIR}/messages-js.pot" "indico_${plugin}" -k 'gettext' -k 'ngettext:1,2' -k '$T' -F ../babel-js.cfg + num_strings=$(grep msgid "${TRANSLATIONS_DIR}/messages-js.pot" | wc -l) + if (( $num_strings == 1 )); then + echo "deleting empty js dict ${TRANSLATIONS_DIR}/messages-js.pot" + rm "${TRANSLATIONS_DIR}/messages-js.pot" + fi elif [[ "$ACTION" == "update" ]]; then require_locale pybabel update -i "./indico_${plugin}/translations/messages.pot" -l "$LOCALE" -d "./indico_${plugin}/translations" diff --git a/payment_manual/indico_payment_manual/translations/messages-js.pot b/payment_manual/indico_payment_manual/translations/messages-js.pot deleted file mode 100644 index de95b64..0000000 --- a/payment_manual/indico_payment_manual/translations/messages-js.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - -msgid "Indico" -msgstr "Indico" diff --git a/payment_paypal/indico_payment_paypal/translations/messages-js.pot b/payment_paypal/indico_payment_paypal/translations/messages-js.pot deleted file mode 100644 index de95b64..0000000 --- a/payment_paypal/indico_payment_paypal/translations/messages-js.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - -msgid "Indico" -msgstr "Indico" diff --git a/vc_dummy/indico_vc_dummy/translations/messages-js.pot b/vc_dummy/indico_vc_dummy/translations/messages-js.pot deleted file mode 100644 index addf758..0000000 --- a/vc_dummy/indico_vc_dummy/translations/messages-js.pot +++ /dev/null @@ -1,19 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - diff --git a/vc_vidyo/indico_vc_vidyo/translations/messages-js.pot b/vc_vidyo/indico_vc_vidyo/translations/messages-js.pot deleted file mode 100644 index de95b64..0000000 --- a/vc_vidyo/indico_vc_vidyo/translations/messages-js.pot +++ /dev/null @@ -1,21 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2016 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2016. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2016-08-29 10:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" - -msgid "Indico" -msgstr "Indico"