From 4b0b0a7cd23071f18726841de163db008db497cd Mon Sep 17 00:00:00 2001 From: Alf Drollinger Date: Sun, 4 Aug 2024 00:15:15 +0200 Subject: [PATCH] Translatable config --- composer.json | 5 ++- config/expiry.php | 41 +++++++++++++------ .../core/resources/lang/af/translations.php | 8 ---- .../core/resources/lang/ar/translations.php | 8 ---- .../core/resources/lang/az/translations.php | 8 ---- .../core/resources/lang/be/translations.php | 8 ---- .../core/resources/lang/bg/translations.php | 8 ---- .../core/resources/lang/bn/translations.php | 8 ---- .../core/resources/lang/bs/translations.php | 8 ---- .../core/resources/lang/ca/translations.php | 8 ---- .../core/resources/lang/cs/translations.php | 8 ---- .../core/resources/lang/cy/translations.php | 8 ---- .../core/resources/lang/da/translations.php | 8 ---- .../core/resources/lang/de/translations.php | 8 ---- .../resources/lang/de_CH/translations.php | 8 ---- .../core/resources/lang/el/translations.php | 8 ---- packages/core/resources/lang/en/common.php | 11 +++++ packages/core/resources/lang/en/expiry.php | 6 +++ .../core/resources/lang/en/translations.php | 8 ---- .../core/resources/lang/es/translations.php | 8 ---- .../core/resources/lang/et/translations.php | 8 ---- .../core/resources/lang/eu/translations.php | 8 ---- .../core/resources/lang/fa/translations.php | 8 ---- .../core/resources/lang/fi/translations.php | 8 ---- .../core/resources/lang/fil/translations.php | 8 ---- .../core/resources/lang/fr/translations.php | 8 ---- .../core/resources/lang/gl/translations.php | 8 ---- .../core/resources/lang/gu/translations.php | 8 ---- .../core/resources/lang/he/translations.php | 8 ---- .../core/resources/lang/hi/translations.php | 8 ---- .../core/resources/lang/hr/translations.php | 8 ---- .../core/resources/lang/hu/translations.php | 8 ---- .../core/resources/lang/hy/translations.php | 8 ---- .../core/resources/lang/id/translations.php | 8 ---- .../core/resources/lang/is/translations.php | 8 ---- .../core/resources/lang/it/translations.php | 8 ---- .../core/resources/lang/ja/translations.php | 8 ---- .../core/resources/lang/ka/translations.php | 8 ---- .../core/resources/lang/kk/translations.php | 8 ---- .../core/resources/lang/km/translations.php | 8 ---- .../core/resources/lang/kn/translations.php | 8 ---- .../core/resources/lang/ko/translations.php | 8 ---- .../core/resources/lang/ku/translations.php | 8 ---- .../core/resources/lang/ky/translations.php | 8 ---- .../core/resources/lang/lt/translations.php | 8 ---- .../core/resources/lang/lv/translations.php | 8 ---- .../core/resources/lang/mk/translations.php | 8 ---- .../core/resources/lang/mn/translations.php | 8 ---- .../core/resources/lang/mr/translations.php | 8 ---- .../core/resources/lang/ms/translations.php | 8 ---- .../resources/lang/nb_NO/translations.php | 8 ---- .../core/resources/lang/ne/translations.php | 8 ---- .../core/resources/lang/nl/translations.php | 8 ---- .../core/resources/lang/nn/translations.php | 8 ---- .../core/resources/lang/oc/translations.php | 8 ---- .../core/resources/lang/pl/translations.php | 8 ---- .../core/resources/lang/ps/translations.php | 8 ---- .../core/resources/lang/pt/translations.php | 8 ---- .../resources/lang/pt_BR/translations.php | 8 ---- .../core/resources/lang/ro/translations.php | 8 ---- .../core/resources/lang/ru/translations.php | 8 ---- .../core/resources/lang/sc/translations.php | 8 ---- .../core/resources/lang/si/translations.php | 8 ---- .../core/resources/lang/sk/translations.php | 8 ---- .../core/resources/lang/sl/translations.php | 8 ---- .../core/resources/lang/sq/translations.php | 8 ---- .../resources/lang/sr_Cyrl/translations.php | 8 ---- .../lang/sr_LATN@me/translations.php | 8 ---- .../resources/lang/sr_Latn/translations.php | 8 ---- .../core/resources/lang/sv/translations.php | 8 ---- .../core/resources/lang/sw/translations.php | 8 ---- .../core/resources/lang/tg/translations.php | 8 ---- .../core/resources/lang/th/translations.php | 8 ---- .../core/resources/lang/tk/translations.php | 8 ---- .../core/resources/lang/tl/translations.php | 8 ---- .../core/resources/lang/tr/translations.php | 8 ---- .../core/resources/lang/ug/translations.php | 8 ---- .../core/resources/lang/uk/translations.php | 8 ---- .../core/resources/lang/ur/translations.php | 8 ---- .../resources/lang/uz_CYRL/translations.php | 8 ---- .../resources/lang/uz_Latn/translations.php | 8 ---- .../core/resources/lang/vi/translations.php | 8 ---- .../resources/lang/zh_Hans/translations.php | 8 ---- .../resources/lang/zh_Hant/translations.php | 8 ---- .../lang/zh_Hant_HK/translations.php | 8 ---- .../core/src/Traits/TranslatableConfig.php | 22 ++++++++++ packages/expiry/config/expiry.php | 12 +++--- packages/expiry/src/ExpiryServiceProvider.php | 17 ++++++++ .../expiry/src/Resources/ExpiryResource.php | 1 + 89 files changed, 94 insertions(+), 669 deletions(-) delete mode 100644 packages/core/resources/lang/af/translations.php delete mode 100644 packages/core/resources/lang/ar/translations.php delete mode 100644 packages/core/resources/lang/az/translations.php delete mode 100644 packages/core/resources/lang/be/translations.php delete mode 100644 packages/core/resources/lang/bg/translations.php delete mode 100644 packages/core/resources/lang/bn/translations.php delete mode 100644 packages/core/resources/lang/bs/translations.php delete mode 100644 packages/core/resources/lang/ca/translations.php delete mode 100644 packages/core/resources/lang/cs/translations.php delete mode 100644 packages/core/resources/lang/cy/translations.php delete mode 100644 packages/core/resources/lang/da/translations.php delete mode 100644 packages/core/resources/lang/de/translations.php delete mode 100644 packages/core/resources/lang/de_CH/translations.php delete mode 100644 packages/core/resources/lang/el/translations.php create mode 100644 packages/core/resources/lang/en/common.php create mode 100644 packages/core/resources/lang/en/expiry.php delete mode 100644 packages/core/resources/lang/en/translations.php delete mode 100644 packages/core/resources/lang/es/translations.php delete mode 100644 packages/core/resources/lang/et/translations.php delete mode 100644 packages/core/resources/lang/eu/translations.php delete mode 100644 packages/core/resources/lang/fa/translations.php delete mode 100644 packages/core/resources/lang/fi/translations.php delete mode 100644 packages/core/resources/lang/fil/translations.php delete mode 100644 packages/core/resources/lang/fr/translations.php delete mode 100644 packages/core/resources/lang/gl/translations.php delete mode 100644 packages/core/resources/lang/gu/translations.php delete mode 100644 packages/core/resources/lang/he/translations.php delete mode 100644 packages/core/resources/lang/hi/translations.php delete mode 100644 packages/core/resources/lang/hr/translations.php delete mode 100644 packages/core/resources/lang/hu/translations.php delete mode 100644 packages/core/resources/lang/hy/translations.php delete mode 100644 packages/core/resources/lang/id/translations.php delete mode 100644 packages/core/resources/lang/is/translations.php delete mode 100644 packages/core/resources/lang/it/translations.php delete mode 100644 packages/core/resources/lang/ja/translations.php delete mode 100644 packages/core/resources/lang/ka/translations.php delete mode 100644 packages/core/resources/lang/kk/translations.php delete mode 100644 packages/core/resources/lang/km/translations.php delete mode 100644 packages/core/resources/lang/kn/translations.php delete mode 100644 packages/core/resources/lang/ko/translations.php delete mode 100644 packages/core/resources/lang/ku/translations.php delete mode 100644 packages/core/resources/lang/ky/translations.php delete mode 100644 packages/core/resources/lang/lt/translations.php delete mode 100644 packages/core/resources/lang/lv/translations.php delete mode 100644 packages/core/resources/lang/mk/translations.php delete mode 100644 packages/core/resources/lang/mn/translations.php delete mode 100644 packages/core/resources/lang/mr/translations.php delete mode 100644 packages/core/resources/lang/ms/translations.php delete mode 100644 packages/core/resources/lang/nb_NO/translations.php delete mode 100644 packages/core/resources/lang/ne/translations.php delete mode 100644 packages/core/resources/lang/nl/translations.php delete mode 100644 packages/core/resources/lang/nn/translations.php delete mode 100644 packages/core/resources/lang/oc/translations.php delete mode 100644 packages/core/resources/lang/pl/translations.php delete mode 100644 packages/core/resources/lang/ps/translations.php delete mode 100644 packages/core/resources/lang/pt/translations.php delete mode 100644 packages/core/resources/lang/pt_BR/translations.php delete mode 100644 packages/core/resources/lang/ro/translations.php delete mode 100644 packages/core/resources/lang/ru/translations.php delete mode 100644 packages/core/resources/lang/sc/translations.php delete mode 100644 packages/core/resources/lang/si/translations.php delete mode 100644 packages/core/resources/lang/sk/translations.php delete mode 100644 packages/core/resources/lang/sl/translations.php delete mode 100644 packages/core/resources/lang/sq/translations.php delete mode 100644 packages/core/resources/lang/sr_Cyrl/translations.php delete mode 100644 packages/core/resources/lang/sr_LATN@me/translations.php delete mode 100644 packages/core/resources/lang/sr_Latn/translations.php delete mode 100644 packages/core/resources/lang/sv/translations.php delete mode 100644 packages/core/resources/lang/sw/translations.php delete mode 100644 packages/core/resources/lang/tg/translations.php delete mode 100644 packages/core/resources/lang/th/translations.php delete mode 100644 packages/core/resources/lang/tk/translations.php delete mode 100644 packages/core/resources/lang/tl/translations.php delete mode 100644 packages/core/resources/lang/tr/translations.php delete mode 100644 packages/core/resources/lang/ug/translations.php delete mode 100644 packages/core/resources/lang/uk/translations.php delete mode 100644 packages/core/resources/lang/ur/translations.php delete mode 100644 packages/core/resources/lang/uz_CYRL/translations.php delete mode 100644 packages/core/resources/lang/uz_Latn/translations.php delete mode 100644 packages/core/resources/lang/vi/translations.php delete mode 100644 packages/core/resources/lang/zh_Hans/translations.php delete mode 100644 packages/core/resources/lang/zh_Hant/translations.php delete mode 100644 packages/core/resources/lang/zh_Hant_HK/translations.php create mode 100644 packages/core/src/Traits/TranslatableConfig.php diff --git a/composer.json b/composer.json index 03175c55c..613046921 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,12 @@ ], "license": "MIT", "require": { + "laravel-lang/lang": "^15.5", "laravel/framework": "^11.0", "laravel/tinker": "^2.8", "moox/audit": "*", "moox/builder": "*", + "moox/expiry": "*", "moox/jobs": "*", "moox/login-link": "*", "moox/notifications": "*", @@ -33,9 +35,8 @@ "moox/press": "*", "moox/security": "*", "moox/sync": "*", - "moox/user": "*", - "moox/expiry": "*", "moox/trainings": "*", + "moox/user": "*", "moox/user-device": "*", "moox/user-session": "*", "wikimedia/composer-merge-plugin": "^2.1" diff --git a/config/expiry.php b/config/expiry.php index 9c94424b6..acf90f18b 100644 --- a/config/expiry.php +++ b/config/expiry.php @@ -1,10 +1,25 @@ [ 'all' => [ - 'label' => 'All', + 'label' => 'trans//core::common.all', 'field' => 'expiry_job', 'value' => '', 'icon' => 'gmdi-filter-list', ], 'documents' => [ - 'label' => 'Documents', + 'label' => 'trans//core::common.documents', 'field' => 'expiry_job', 'value' => 'Documents', 'icon' => 'gmdi-text-snippet', ], 'articles' => [ - 'label' => 'Articles', + 'label' => 'trans//core::common.articles', 'field' => 'expiry_job', 'value' => 'Articles', 'icon' => 'gmdi-account-circle', ], 'tasks' => [ - 'label' => 'Tasks', + 'label' => 'trans//core::common.tasks', 'field' => 'expiry_job', 'value' => 'Tasks', 'icon' => 'gmdi-no-accounts', ], 'no-user' => [ - 'label' => 'No Assignee', + 'label' => 'trans//core::expiry.no_assignee', 'field' => 'status', 'value' => 'No Assignee', 'icon' => 'gmdi-no-accounts', ], 'no-date' => [ - 'label' => 'No Expiry Date', + 'label' => 'trans//core::expiry.no_expiry_date', 'field' => 'status', 'value' => 'No Expiry Date', 'icon' => 'gmdi-no-accounts', @@ -67,7 +82,7 @@ /* |-------------------------------------------------------------------------- - | Expiry - Url Patterns + | Url Patterns |-------------------------------------------------------------------------- | | Define the url patterns for the Expiry table. They are optional, but @@ -88,7 +103,7 @@ /* |-------------------------------------------------------------------------- - | Expiry - User Model and default user to notify + | User Model and default user to notify |-------------------------------------------------------------------------- | | Bring your own user model, or use the default one @@ -101,7 +116,7 @@ /* |-------------------------------------------------------------------------- - | Expiry - Disable actions + | Disable actions |-------------------------------------------------------------------------- | | You can disable some action buttons in the admin panel. @@ -116,7 +131,7 @@ /* |-------------------------------------------------------------------------- - | Expiry - Jobs + | Jobs |-------------------------------------------------------------------------- | | These jobs are used to collect expiries and send summaries. @@ -131,7 +146,7 @@ /* |-------------------------------------------------------------------------- - | Expiry - API + | API |-------------------------------------------------------------------------- | | Enable or disable the API. diff --git a/packages/core/resources/lang/af/translations.php b/packages/core/resources/lang/af/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/af/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ar/translations.php b/packages/core/resources/lang/ar/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ar/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/az/translations.php b/packages/core/resources/lang/az/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/az/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/be/translations.php b/packages/core/resources/lang/be/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/be/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/bg/translations.php b/packages/core/resources/lang/bg/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/bg/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/bn/translations.php b/packages/core/resources/lang/bn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/bn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/bs/translations.php b/packages/core/resources/lang/bs/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/bs/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ca/translations.php b/packages/core/resources/lang/ca/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ca/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/cs/translations.php b/packages/core/resources/lang/cs/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/cs/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/cy/translations.php b/packages/core/resources/lang/cy/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/cy/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/da/translations.php b/packages/core/resources/lang/da/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/da/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/de/translations.php b/packages/core/resources/lang/de/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/de/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/de_CH/translations.php b/packages/core/resources/lang/de_CH/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/de_CH/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/el/translations.php b/packages/core/resources/lang/el/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/el/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/en/common.php b/packages/core/resources/lang/en/common.php new file mode 100644 index 000000000..50f7453ef --- /dev/null +++ b/packages/core/resources/lang/en/common.php @@ -0,0 +1,11 @@ + 'Title', + 'slug' => 'Slug', + 'item' => 'Item', + 'all' => 'All', + 'documents' => 'Documents', + 'articles' => 'Articles', + 'tasks' => 'Tasks', +]; diff --git a/packages/core/resources/lang/en/expiry.php b/packages/core/resources/lang/en/expiry.php new file mode 100644 index 000000000..232ac7da8 --- /dev/null +++ b/packages/core/resources/lang/en/expiry.php @@ -0,0 +1,6 @@ + 'No assignee', + 'no_expiry_date' => 'No expiry date', +]; diff --git a/packages/core/resources/lang/en/translations.php b/packages/core/resources/lang/en/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/en/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/es/translations.php b/packages/core/resources/lang/es/translations.php deleted file mode 100644 index 396247ee5..000000000 --- a/packages/core/resources/lang/es/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Núcleo', - 'title' => 'Núcleo', - 'navigation_label' => 'Núcleo', - 'navigation_group' => 'Núcleo de Moox', -]; diff --git a/packages/core/resources/lang/et/translations.php b/packages/core/resources/lang/et/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/et/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/eu/translations.php b/packages/core/resources/lang/eu/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/eu/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/fa/translations.php b/packages/core/resources/lang/fa/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/fa/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/fi/translations.php b/packages/core/resources/lang/fi/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/fi/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/fil/translations.php b/packages/core/resources/lang/fil/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/fil/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/fr/translations.php b/packages/core/resources/lang/fr/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/fr/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/gl/translations.php b/packages/core/resources/lang/gl/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/gl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/gu/translations.php b/packages/core/resources/lang/gu/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/gu/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/he/translations.php b/packages/core/resources/lang/he/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/he/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/hi/translations.php b/packages/core/resources/lang/hi/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/hi/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/hr/translations.php b/packages/core/resources/lang/hr/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/hr/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/hu/translations.php b/packages/core/resources/lang/hu/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/hu/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/hy/translations.php b/packages/core/resources/lang/hy/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/hy/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/id/translations.php b/packages/core/resources/lang/id/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/id/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/is/translations.php b/packages/core/resources/lang/is/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/is/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/it/translations.php b/packages/core/resources/lang/it/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/it/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ja/translations.php b/packages/core/resources/lang/ja/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ja/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ka/translations.php b/packages/core/resources/lang/ka/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ka/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/kk/translations.php b/packages/core/resources/lang/kk/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/kk/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/km/translations.php b/packages/core/resources/lang/km/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/km/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/kn/translations.php b/packages/core/resources/lang/kn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/kn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ko/translations.php b/packages/core/resources/lang/ko/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/ko/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/ku/translations.php b/packages/core/resources/lang/ku/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ku/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ky/translations.php b/packages/core/resources/lang/ky/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ky/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/lt/translations.php b/packages/core/resources/lang/lt/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/lt/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/lv/translations.php b/packages/core/resources/lang/lv/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/lv/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/mk/translations.php b/packages/core/resources/lang/mk/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/mk/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/mn/translations.php b/packages/core/resources/lang/mn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/mn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/mr/translations.php b/packages/core/resources/lang/mr/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/mr/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ms/translations.php b/packages/core/resources/lang/ms/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ms/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/nb_NO/translations.php b/packages/core/resources/lang/nb_NO/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/nb_NO/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/ne/translations.php b/packages/core/resources/lang/ne/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ne/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/nl/translations.php b/packages/core/resources/lang/nl/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/nl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/nn/translations.php b/packages/core/resources/lang/nn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/nn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/oc/translations.php b/packages/core/resources/lang/oc/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/oc/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/pl/translations.php b/packages/core/resources/lang/pl/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/pl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ps/translations.php b/packages/core/resources/lang/ps/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ps/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/pt/translations.php b/packages/core/resources/lang/pt/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/pt/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/pt_BR/translations.php b/packages/core/resources/lang/pt_BR/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/pt_BR/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ro/translations.php b/packages/core/resources/lang/ro/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ro/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ru/translations.php b/packages/core/resources/lang/ru/translations.php deleted file mode 100644 index e8a9aa3ad..000000000 --- a/packages/core/resources/lang/ru/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Ядро', - 'title' => 'Ядро', - 'navigation_label' => 'Ядро', - 'navigation_group' => 'Ядро Moox', -]; diff --git a/packages/core/resources/lang/sc/translations.php b/packages/core/resources/lang/sc/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sc/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/si/translations.php b/packages/core/resources/lang/si/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/si/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sk/translations.php b/packages/core/resources/lang/sk/translations.php deleted file mode 100644 index 2e6e2c138..000000000 --- a/packages/core/resources/lang/sk/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - 'Core', - 'title' => 'Core', - 'navigation_label' => 'Core', - 'navigation_group' => 'Moox Core', -]; diff --git a/packages/core/resources/lang/sl/translations.php b/packages/core/resources/lang/sl/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sq/translations.php b/packages/core/resources/lang/sq/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sq/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sr_Cyrl/translations.php b/packages/core/resources/lang/sr_Cyrl/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sr_Cyrl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sr_LATN@me/translations.php b/packages/core/resources/lang/sr_LATN@me/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sr_LATN@me/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sr_Latn/translations.php b/packages/core/resources/lang/sr_Latn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sr_Latn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sv/translations.php b/packages/core/resources/lang/sv/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sv/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/sw/translations.php b/packages/core/resources/lang/sw/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/sw/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/tg/translations.php b/packages/core/resources/lang/tg/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/tg/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/th/translations.php b/packages/core/resources/lang/th/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/th/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/tk/translations.php b/packages/core/resources/lang/tk/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/tk/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/tl/translations.php b/packages/core/resources/lang/tl/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/tl/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/tr/translations.php b/packages/core/resources/lang/tr/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/tr/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ug/translations.php b/packages/core/resources/lang/ug/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ug/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/uk/translations.php b/packages/core/resources/lang/uk/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/uk/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/ur/translations.php b/packages/core/resources/lang/ur/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/ur/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/uz_CYRL/translations.php b/packages/core/resources/lang/uz_CYRL/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/uz_CYRL/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/uz_Latn/translations.php b/packages/core/resources/lang/uz_Latn/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/uz_Latn/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/vi/translations.php b/packages/core/resources/lang/vi/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/vi/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/zh_Hans/translations.php b/packages/core/resources/lang/zh_Hans/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/zh_Hans/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/zh_Hant/translations.php b/packages/core/resources/lang/zh_Hant/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/zh_Hant/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/resources/lang/zh_Hant_HK/translations.php b/packages/core/resources/lang/zh_Hant_HK/translations.php deleted file mode 100644 index 6846b19a8..000000000 --- a/packages/core/resources/lang/zh_Hant_HK/translations.php +++ /dev/null @@ -1,8 +0,0 @@ - '', - 'title' => '', - 'navigation_label' => '', - 'navigation_group' => '', -]; diff --git a/packages/core/src/Traits/TranslatableConfig.php b/packages/core/src/Traits/TranslatableConfig.php new file mode 100644 index 000000000..bc2fc2a73 --- /dev/null +++ b/packages/core/src/Traits/TranslatableConfig.php @@ -0,0 +1,22 @@ + [ 'all' => [ - 'label' => 'All', + 'label' => 'trans//core::common.all', 'field' => 'expiry_job', 'value' => '', 'icon' => 'gmdi-filter-list', ], 'documents' => [ - 'label' => 'Documents', + 'label' => 'trans//core::common.documents', 'field' => 'expiry_job', 'value' => 'Documents', 'icon' => 'gmdi-text-snippet', ], 'articles' => [ - 'label' => 'Articles', + 'label' => 'trans//core::common.articles', 'field' => 'expiry_job', 'value' => 'Articles', 'icon' => 'gmdi-account-circle', ], 'tasks' => [ - 'label' => 'Tasks', + 'label' => 'trans//core::common.tasks', 'field' => 'expiry_job', 'value' => 'Tasks', 'icon' => 'gmdi-no-accounts', ], 'no-user' => [ - 'label' => 'No Assignee', + 'label' => 'trans//core::expiry.no_assignee', 'field' => 'status', 'value' => 'No Assignee', 'icon' => 'gmdi-no-accounts', ], 'no-date' => [ - 'label' => 'No Expiry Date', + 'label' => 'trans//core::expiry.no_expiry_date', 'field' => 'status', 'value' => 'No Expiry Date', 'icon' => 'gmdi-no-accounts', diff --git a/packages/expiry/src/ExpiryServiceProvider.php b/packages/expiry/src/ExpiryServiceProvider.php index f9b00593b..90cc4fabb 100644 --- a/packages/expiry/src/ExpiryServiceProvider.php +++ b/packages/expiry/src/ExpiryServiceProvider.php @@ -4,12 +4,15 @@ namespace Moox\Expiry; +use Moox\Core\Traits\TranslatableConfig; use Moox\Expiry\Commands\InstallCommand; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; class ExpiryServiceProvider extends PackageServiceProvider { + use TranslatableConfig; + public function configurePackage(Package $package): void { $package @@ -26,6 +29,8 @@ public function boot() { parent::boot(); + $this->translateConfigurations(); + $this->loadViewsFrom(__DIR__.'/../resources/views', 'expiry'); } @@ -33,4 +38,16 @@ public function packageRegistered() { $this->loadRoutesFrom(__DIR__.'/../routes/api.php'); } + + protected function translateConfigurations() + { + $configs = [ + 'expiry', + ]; + + foreach ($configs as $config) { + $translatedConfig = $this->translateConfig(config($config)); + config([$config => $translatedConfig]); + } + } } diff --git a/packages/expiry/src/Resources/ExpiryResource.php b/packages/expiry/src/Resources/ExpiryResource.php index 5ca17cf10..f5989ec17 100644 --- a/packages/expiry/src/Resources/ExpiryResource.php +++ b/packages/expiry/src/Resources/ExpiryResource.php @@ -34,6 +34,7 @@ public static function form(Form $form): Form Grid::make(['default' => 0])->schema([ TextInput::make('title') ->rules(['max:255', 'string']) + ->label(__('core::common.title')) ->required() ->columnSpan([ 'default' => 12,