From ea89fc631aae2ea7df263f0ada03921e2ccbc7f3 Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 14 Oct 2021 19:54:29 +0200 Subject: [PATCH 1/4] Rename po files to libretime --- legacy/locale/ast/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/az/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/cs_CZ/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/da_DK/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/de_AT/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/de_DE/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/el_GR/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/en_CA/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/en_GB/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/en_US/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/es_ES/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/fr_FR/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/hr_HR/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/hu_HU/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/hy/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/hy_AM/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/id_ID/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/it_IT/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ja/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ja_JP/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ka/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ko_KR/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/lt/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/nl_NL/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/pl_PL/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/pt_BR/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ro_RO/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/ru_RU/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/si/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/sr_RS/LC_MESSAGES/{airtime.po => libretime.po} | 0 .../locale/sr_RS@latin/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/template/{airtime.po => libretime.po} | 0 legacy/locale/tr/LC_MESSAGES/{airtime.po => libretime.po} | 0 legacy/locale/zh_CN/LC_MESSAGES/{airtime.po => libretime.po} | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename legacy/locale/ast/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/az/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/cs_CZ/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/da_DK/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/de_AT/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/de_DE/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/el_GR/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/en_CA/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/en_GB/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/en_US/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/es_ES/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/fr_FR/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/hr_HR/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/hu_HU/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/hy/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/hy_AM/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/id_ID/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/it_IT/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ja/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ja_JP/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ka/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ko_KR/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/lt/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/nl_NL/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/pl_PL/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/pt_BR/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ro_RO/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/ru_RU/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/si/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/sr_RS/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/sr_RS@latin/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/template/{airtime.po => libretime.po} (100%) rename legacy/locale/tr/LC_MESSAGES/{airtime.po => libretime.po} (100%) rename legacy/locale/zh_CN/LC_MESSAGES/{airtime.po => libretime.po} (100%) diff --git a/legacy/locale/ast/LC_MESSAGES/airtime.po b/legacy/locale/ast/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ast/LC_MESSAGES/airtime.po rename to legacy/locale/ast/LC_MESSAGES/libretime.po diff --git a/legacy/locale/az/LC_MESSAGES/airtime.po b/legacy/locale/az/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/az/LC_MESSAGES/airtime.po rename to legacy/locale/az/LC_MESSAGES/libretime.po diff --git a/legacy/locale/cs_CZ/LC_MESSAGES/airtime.po b/legacy/locale/cs_CZ/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/cs_CZ/LC_MESSAGES/airtime.po rename to legacy/locale/cs_CZ/LC_MESSAGES/libretime.po diff --git a/legacy/locale/da_DK/LC_MESSAGES/airtime.po b/legacy/locale/da_DK/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/da_DK/LC_MESSAGES/airtime.po rename to legacy/locale/da_DK/LC_MESSAGES/libretime.po diff --git a/legacy/locale/de_AT/LC_MESSAGES/airtime.po b/legacy/locale/de_AT/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/de_AT/LC_MESSAGES/airtime.po rename to legacy/locale/de_AT/LC_MESSAGES/libretime.po diff --git a/legacy/locale/de_DE/LC_MESSAGES/airtime.po b/legacy/locale/de_DE/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/de_DE/LC_MESSAGES/airtime.po rename to legacy/locale/de_DE/LC_MESSAGES/libretime.po diff --git a/legacy/locale/el_GR/LC_MESSAGES/airtime.po b/legacy/locale/el_GR/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/el_GR/LC_MESSAGES/airtime.po rename to legacy/locale/el_GR/LC_MESSAGES/libretime.po diff --git a/legacy/locale/en_CA/LC_MESSAGES/airtime.po b/legacy/locale/en_CA/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/en_CA/LC_MESSAGES/airtime.po rename to legacy/locale/en_CA/LC_MESSAGES/libretime.po diff --git a/legacy/locale/en_GB/LC_MESSAGES/airtime.po b/legacy/locale/en_GB/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/en_GB/LC_MESSAGES/airtime.po rename to legacy/locale/en_GB/LC_MESSAGES/libretime.po diff --git a/legacy/locale/en_US/LC_MESSAGES/airtime.po b/legacy/locale/en_US/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/en_US/LC_MESSAGES/airtime.po rename to legacy/locale/en_US/LC_MESSAGES/libretime.po diff --git a/legacy/locale/es_ES/LC_MESSAGES/airtime.po b/legacy/locale/es_ES/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/es_ES/LC_MESSAGES/airtime.po rename to legacy/locale/es_ES/LC_MESSAGES/libretime.po diff --git a/legacy/locale/fr_FR/LC_MESSAGES/airtime.po b/legacy/locale/fr_FR/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/fr_FR/LC_MESSAGES/airtime.po rename to legacy/locale/fr_FR/LC_MESSAGES/libretime.po diff --git a/legacy/locale/hr_HR/LC_MESSAGES/airtime.po b/legacy/locale/hr_HR/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/hr_HR/LC_MESSAGES/airtime.po rename to legacy/locale/hr_HR/LC_MESSAGES/libretime.po diff --git a/legacy/locale/hu_HU/LC_MESSAGES/airtime.po b/legacy/locale/hu_HU/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/hu_HU/LC_MESSAGES/airtime.po rename to legacy/locale/hu_HU/LC_MESSAGES/libretime.po diff --git a/legacy/locale/hy/LC_MESSAGES/airtime.po b/legacy/locale/hy/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/hy/LC_MESSAGES/airtime.po rename to legacy/locale/hy/LC_MESSAGES/libretime.po diff --git a/legacy/locale/hy_AM/LC_MESSAGES/airtime.po b/legacy/locale/hy_AM/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/hy_AM/LC_MESSAGES/airtime.po rename to legacy/locale/hy_AM/LC_MESSAGES/libretime.po diff --git a/legacy/locale/id_ID/LC_MESSAGES/airtime.po b/legacy/locale/id_ID/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/id_ID/LC_MESSAGES/airtime.po rename to legacy/locale/id_ID/LC_MESSAGES/libretime.po diff --git a/legacy/locale/it_IT/LC_MESSAGES/airtime.po b/legacy/locale/it_IT/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/it_IT/LC_MESSAGES/airtime.po rename to legacy/locale/it_IT/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ja/LC_MESSAGES/airtime.po b/legacy/locale/ja/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ja/LC_MESSAGES/airtime.po rename to legacy/locale/ja/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ja_JP/LC_MESSAGES/airtime.po b/legacy/locale/ja_JP/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ja_JP/LC_MESSAGES/airtime.po rename to legacy/locale/ja_JP/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ka/LC_MESSAGES/airtime.po b/legacy/locale/ka/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ka/LC_MESSAGES/airtime.po rename to legacy/locale/ka/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ko_KR/LC_MESSAGES/airtime.po b/legacy/locale/ko_KR/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ko_KR/LC_MESSAGES/airtime.po rename to legacy/locale/ko_KR/LC_MESSAGES/libretime.po diff --git a/legacy/locale/lt/LC_MESSAGES/airtime.po b/legacy/locale/lt/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/lt/LC_MESSAGES/airtime.po rename to legacy/locale/lt/LC_MESSAGES/libretime.po diff --git a/legacy/locale/nl_NL/LC_MESSAGES/airtime.po b/legacy/locale/nl_NL/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/nl_NL/LC_MESSAGES/airtime.po rename to legacy/locale/nl_NL/LC_MESSAGES/libretime.po diff --git a/legacy/locale/pl_PL/LC_MESSAGES/airtime.po b/legacy/locale/pl_PL/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/pl_PL/LC_MESSAGES/airtime.po rename to legacy/locale/pl_PL/LC_MESSAGES/libretime.po diff --git a/legacy/locale/pt_BR/LC_MESSAGES/airtime.po b/legacy/locale/pt_BR/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/pt_BR/LC_MESSAGES/airtime.po rename to legacy/locale/pt_BR/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ro_RO/LC_MESSAGES/airtime.po b/legacy/locale/ro_RO/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ro_RO/LC_MESSAGES/airtime.po rename to legacy/locale/ro_RO/LC_MESSAGES/libretime.po diff --git a/legacy/locale/ru_RU/LC_MESSAGES/airtime.po b/legacy/locale/ru_RU/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/ru_RU/LC_MESSAGES/airtime.po rename to legacy/locale/ru_RU/LC_MESSAGES/libretime.po diff --git a/legacy/locale/si/LC_MESSAGES/airtime.po b/legacy/locale/si/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/si/LC_MESSAGES/airtime.po rename to legacy/locale/si/LC_MESSAGES/libretime.po diff --git a/legacy/locale/sr_RS/LC_MESSAGES/airtime.po b/legacy/locale/sr_RS/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/sr_RS/LC_MESSAGES/airtime.po rename to legacy/locale/sr_RS/LC_MESSAGES/libretime.po diff --git a/legacy/locale/sr_RS@latin/LC_MESSAGES/airtime.po b/legacy/locale/sr_RS@latin/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/sr_RS@latin/LC_MESSAGES/airtime.po rename to legacy/locale/sr_RS@latin/LC_MESSAGES/libretime.po diff --git a/legacy/locale/template/airtime.po b/legacy/locale/template/libretime.po similarity index 100% rename from legacy/locale/template/airtime.po rename to legacy/locale/template/libretime.po diff --git a/legacy/locale/tr/LC_MESSAGES/airtime.po b/legacy/locale/tr/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/tr/LC_MESSAGES/airtime.po rename to legacy/locale/tr/LC_MESSAGES/libretime.po diff --git a/legacy/locale/zh_CN/LC_MESSAGES/airtime.po b/legacy/locale/zh_CN/LC_MESSAGES/libretime.po similarity index 100% rename from legacy/locale/zh_CN/LC_MESSAGES/airtime.po rename to legacy/locale/zh_CN/LC_MESSAGES/libretime.po From a7e6cb4ed854cd716094aceb89db7f77fb622468 Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 14 Oct 2021 19:55:26 +0200 Subject: [PATCH 2/4] Remove 'pro' locales domain --- legacy/application/models/Locale.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/legacy/application/models/Locale.php b/legacy/application/models/Locale.php index 00290d662..4d78b6b24 100644 --- a/legacy/application/models/Locale.php +++ b/legacy/application/models/Locale.php @@ -2,10 +2,7 @@ final class Application_Model_Locale { - private static $domains = [ - 'airtime', - 'pro', - ]; + private static $domains = ['airtime']; public static $locales = [ 'en_CA' => 'English (Canada)', From a070e4a4c3479ae9834eae1ac413680822d4f626 Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 14 Oct 2021 19:58:14 +0200 Subject: [PATCH 3/4] Rename locale text domain to libretime --- legacy/application/models/Locale.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/application/models/Locale.php b/legacy/application/models/Locale.php index 4d78b6b24..0273ae121 100644 --- a/legacy/application/models/Locale.php +++ b/legacy/application/models/Locale.php @@ -2,7 +2,7 @@ final class Application_Model_Locale { - private static $domains = ['airtime']; + private static $domains = ['libretime']; public static $locales = [ 'en_CA' => 'English (Canada)', @@ -55,7 +55,7 @@ final class Application_Model_Locale bind_textdomain_codeset($domain, $codeset); } - textdomain('airtime'); + textdomain('libretime'); } /** From f7494cab7d1bef474b4bebe8cdac2cd5d3b82fee Mon Sep 17 00:00:00 2001 From: jo Date: Fri, 15 Oct 2021 00:23:45 +0200 Subject: [PATCH 4/4] Add locale Makefile and allow building mo files --- legacy/Makefile | 8 +++++++- legacy/locale/Makefile | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 legacy/locale/Makefile diff --git a/legacy/Makefile b/legacy/Makefile index 21d532566..3c627d9ae 100644 --- a/legacy/Makefile +++ b/legacy/Makefile @@ -1,12 +1,18 @@ SHELL = bash -all: vendor +all: vendor locale-build PHP-CS-FIXER = tools/vendor/bin/php-cs-fixer $(PHP-CS-FIXER): mkdir -p tools composer require --working-dir=tools friendsofphp/php-cs-fixer +include locale/Makefile + +locale-update: .locale-update +locale-build: + $(MAKE) -C locale build + vendor: composer install --no-progress --no-interaction $(COMPOSER_ARGS) diff --git a/legacy/locale/Makefile b/legacy/locale/Makefile new file mode 100644 index 000000000..a8c762a94 --- /dev/null +++ b/legacy/locale/Makefile @@ -0,0 +1,34 @@ +.PHONY: .locale-update build +.DEFAULT: build + +SHELL = bash + +DOMAIN = libretime +PO_FILE = $(DOMAIN).po +PO_FILES = $(wildcard */LC_MESSAGES/$(PO_FILE)) +MO_FILES = $(PO_FILES:.po=.mo) + +SRC = application build public + +XGETTEXT_ARGS = --default-domain=$(DOMAIN) \ + --language=php \ + --from-code=UTF-8 \ + --no-wrap \ + --sort-by-file + +MSGMERGE_ARGS = --no-fuzzy-matching \ + --update \ + --no-wrap \ + --sort-by-file + +# This target is run by another Makefile +.locale-update: + find $(SRC) -name "*.phtml" -o -name "*.php" -type f -print0 | xargs -0 xgettext $(XGETTEXT_ARGS) + sed -i 's/CHARSET/UTF-8/g' $(PO_FILE) + find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \; + rm $(PO_FILE) + +%.mo: %.po + msgfmt $< -o $@ + +build: $(MO_FILES)