From 6695369af7a4eef0e1ba5f539db414c52acd727c Mon Sep 17 00:00:00 2001 From: Roland Rusch Date: Mon, 14 Aug 2023 15:10:34 +0200 Subject: [PATCH] RETROTEC-AG/OpenXE#17 Locale des GUI-Users ermitteln MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Füge Copyright-Hinweise hinzu. --- classes/Components/I18n/Bootstrap.php | 10 ++++++++++ .../Components/I18n/Dataaccess/ArrayAccessTrait.php | 4 ++++ classes/Components/I18n/Dataaccess/CountableTrait.php | 4 ++++ classes/Components/I18n/Dataaccess/DataFilter.php | 4 ++++ .../Components/I18n/Dataaccess/DataFilterInterface.php | 4 ++++ classes/Components/I18n/Dataaccess/DataProvider.php | 4 ++++ .../I18n/Dataaccess/DataProviderInterface.php | 4 ++++ .../I18n/Dataaccess/Exception/OutOfRangeException.php | 4 ++++ classes/Components/I18n/Dataaccess/IteratorTrait.php | 4 ++++ .../I18n/Exception/LanguageNotInitializedException.php | 4 ++++ .../Exception/UnsupportedLocaleStringException.php | 6 ++++++ classes/Components/I18n/Iso3166.php | 5 +++++ classes/Components/I18n/Iso3166/Filter/All.php | 4 ++++ .../Components/I18n/Iso3166/Filter/CentralEurope.php | 4 ++++ classes/Components/I18n/Iso3166/Filter/ChangeKey.php | 4 ++++ classes/Components/I18n/Iso3166/Filter/Custom.php | 4 ++++ classes/Components/I18n/Iso3166/Filter/Europe.php | 4 ++++ classes/Components/I18n/Iso3166/Key.php | 4 ++++ classes/Components/I18n/Iso3166/Name.php | 4 ++++ classes/Components/I18n/Iso639.php | 4 ++++ classes/Components/I18n/Iso639/Filter/All.php | 4 ++++ .../Components/I18n/Iso639/Filter/CentralEurope.php | 4 ++++ classes/Components/I18n/Iso639/Filter/ChangeKey.php | 4 ++++ classes/Components/I18n/Iso639/Filter/Custom.php | 4 ++++ classes/Components/I18n/Iso639/Key.php | 4 ++++ classes/Components/I18n/Iso639/Name.php | 4 ++++ classes/Components/I18n/Localization.php | 9 +++++++++ classes/Components/I18n/LocalizationInterface.php | 4 ++++ classes/Components/I18n/data/Iso3166data.php | 5 +++-- classes/Components/I18n/data/Iso639data.php | 5 +++-- 30 files changed, 132 insertions(+), 4 deletions(-) diff --git a/classes/Components/I18n/Bootstrap.php b/classes/Components/I18n/Bootstrap.php index 586eb8f2..f4a813f0 100644 --- a/classes/Components/I18n/Bootstrap.php +++ b/classes/Components/I18n/Bootstrap.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); @@ -9,6 +13,12 @@ use Xentral\Components\Http\Request; use Xentral\Components\Http\Session\Session; use Xentral\Core\DependencyInjection\ServiceContainer; +/** + * Factory for localization object. + * + * @see Localization + * @author Roland Rusch, easy-smart solution GmbH + */ final class Bootstrap { /** diff --git a/classes/Components/I18n/Dataaccess/ArrayAccessTrait.php b/classes/Components/I18n/Dataaccess/ArrayAccessTrait.php index b32eef00..299fc48e 100644 --- a/classes/Components/I18n/Dataaccess/ArrayAccessTrait.php +++ b/classes/Components/I18n/Dataaccess/ArrayAccessTrait.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/CountableTrait.php b/classes/Components/I18n/Dataaccess/CountableTrait.php index d819e2dc..48257f95 100644 --- a/classes/Components/I18n/Dataaccess/CountableTrait.php +++ b/classes/Components/I18n/Dataaccess/CountableTrait.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/DataFilter.php b/classes/Components/I18n/Dataaccess/DataFilter.php index a1750eba..63de368f 100644 --- a/classes/Components/I18n/Dataaccess/DataFilter.php +++ b/classes/Components/I18n/Dataaccess/DataFilter.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/DataFilterInterface.php b/classes/Components/I18n/Dataaccess/DataFilterInterface.php index 748bb2df..7c816a10 100644 --- a/classes/Components/I18n/Dataaccess/DataFilterInterface.php +++ b/classes/Components/I18n/Dataaccess/DataFilterInterface.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/DataProvider.php b/classes/Components/I18n/Dataaccess/DataProvider.php index fceb0c3f..4459c92a 100644 --- a/classes/Components/I18n/Dataaccess/DataProvider.php +++ b/classes/Components/I18n/Dataaccess/DataProvider.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/DataProviderInterface.php b/classes/Components/I18n/Dataaccess/DataProviderInterface.php index c0f4c4a3..0939ad52 100644 --- a/classes/Components/I18n/Dataaccess/DataProviderInterface.php +++ b/classes/Components/I18n/Dataaccess/DataProviderInterface.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/Exception/OutOfRangeException.php b/classes/Components/I18n/Dataaccess/Exception/OutOfRangeException.php index 16569ecf..dd83c35b 100644 --- a/classes/Components/I18n/Dataaccess/Exception/OutOfRangeException.php +++ b/classes/Components/I18n/Dataaccess/Exception/OutOfRangeException.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Dataaccess/IteratorTrait.php b/classes/Components/I18n/Dataaccess/IteratorTrait.php index e29deb9e..54fb0bfc 100644 --- a/classes/Components/I18n/Dataaccess/IteratorTrait.php +++ b/classes/Components/I18n/Dataaccess/IteratorTrait.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Exception/LanguageNotInitializedException.php b/classes/Components/I18n/Exception/LanguageNotInitializedException.php index b7696797..dc0136ef 100644 --- a/classes/Components/I18n/Exception/LanguageNotInitializedException.php +++ b/classes/Components/I18n/Exception/LanguageNotInitializedException.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Exception/UnsupportedLocaleStringException.php b/classes/Components/I18n/Exception/UnsupportedLocaleStringException.php index 98176e8a..c34bfad5 100644 --- a/classes/Components/I18n/Exception/UnsupportedLocaleStringException.php +++ b/classes/Components/I18n/Exception/UnsupportedLocaleStringException.php @@ -1,4 +1,10 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ + +declare(strict_types=1); namespace Xentral\Components\I18n\Exception; diff --git a/classes/Components/I18n/Iso3166.php b/classes/Components/I18n/Iso3166.php index 17472a0a..e9b83b74 100644 --- a/classes/Components/I18n/Iso3166.php +++ b/classes/Components/I18n/Iso3166.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); @@ -13,6 +17,7 @@ use Xentral\Components\I18n\Dataaccess\DataProvider; * @see https://www.iso.org/iso-3166-country-codes.html * @see DataProvider * @author Roland Rusch, easy-smart solution GmbH + * @license AGPL-3.0-only */ class Iso3166 extends DataProvider { diff --git a/classes/Components/I18n/Iso3166/Filter/All.php b/classes/Components/I18n/Iso3166/Filter/All.php index 3dec30eb..1889dcae 100644 --- a/classes/Components/I18n/Iso3166/Filter/All.php +++ b/classes/Components/I18n/Iso3166/Filter/All.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Filter/CentralEurope.php b/classes/Components/I18n/Iso3166/Filter/CentralEurope.php index 76773d7d..8c755943 100644 --- a/classes/Components/I18n/Iso3166/Filter/CentralEurope.php +++ b/classes/Components/I18n/Iso3166/Filter/CentralEurope.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Filter/ChangeKey.php b/classes/Components/I18n/Iso3166/Filter/ChangeKey.php index 49d279de..23104150 100644 --- a/classes/Components/I18n/Iso3166/Filter/ChangeKey.php +++ b/classes/Components/I18n/Iso3166/Filter/ChangeKey.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Filter/Custom.php b/classes/Components/I18n/Iso3166/Filter/Custom.php index b0f99236..df6a4e99 100644 --- a/classes/Components/I18n/Iso3166/Filter/Custom.php +++ b/classes/Components/I18n/Iso3166/Filter/Custom.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Filter/Europe.php b/classes/Components/I18n/Iso3166/Filter/Europe.php index cfb91f4b..0c7e678e 100644 --- a/classes/Components/I18n/Iso3166/Filter/Europe.php +++ b/classes/Components/I18n/Iso3166/Filter/Europe.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Key.php b/classes/Components/I18n/Iso3166/Key.php index f6d6bf34..bf71f9c5 100644 --- a/classes/Components/I18n/Iso3166/Key.php +++ b/classes/Components/I18n/Iso3166/Key.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso3166/Name.php b/classes/Components/I18n/Iso3166/Name.php index ac08ddb8..58141927 100644 --- a/classes/Components/I18n/Iso3166/Name.php +++ b/classes/Components/I18n/Iso3166/Name.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639.php b/classes/Components/I18n/Iso639.php index 19e3e1da..77695ce2 100644 --- a/classes/Components/I18n/Iso639.php +++ b/classes/Components/I18n/Iso639.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Filter/All.php b/classes/Components/I18n/Iso639/Filter/All.php index d0c9bb8a..2b05a37a 100644 --- a/classes/Components/I18n/Iso639/Filter/All.php +++ b/classes/Components/I18n/Iso639/Filter/All.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Filter/CentralEurope.php b/classes/Components/I18n/Iso639/Filter/CentralEurope.php index 644bf090..94c33c4b 100644 --- a/classes/Components/I18n/Iso639/Filter/CentralEurope.php +++ b/classes/Components/I18n/Iso639/Filter/CentralEurope.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Filter/ChangeKey.php b/classes/Components/I18n/Iso639/Filter/ChangeKey.php index b41d4d4b..b4b99278 100644 --- a/classes/Components/I18n/Iso639/Filter/ChangeKey.php +++ b/classes/Components/I18n/Iso639/Filter/ChangeKey.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Filter/Custom.php b/classes/Components/I18n/Iso639/Filter/Custom.php index 3c1b8698..0755c290 100644 --- a/classes/Components/I18n/Iso639/Filter/Custom.php +++ b/classes/Components/I18n/Iso639/Filter/Custom.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Key.php b/classes/Components/I18n/Iso639/Key.php index 4ef629f6..f916f127 100644 --- a/classes/Components/I18n/Iso639/Key.php +++ b/classes/Components/I18n/Iso639/Key.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Iso639/Name.php b/classes/Components/I18n/Iso639/Name.php index d915d048..ea9e52db 100644 --- a/classes/Components/I18n/Iso639/Name.php +++ b/classes/Components/I18n/Iso639/Name.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/Localization.php b/classes/Components/I18n/Localization.php index 234d479f..853fc103 100644 --- a/classes/Components/I18n/Localization.php +++ b/classes/Components/I18n/Localization.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); @@ -10,6 +14,11 @@ use Xentral\Components\Http\Session\Session; use Xentral\Components\I18n\Exception\LanguageNotInitializedException; use Xentral\Components\I18n\Exception\UnsupportedLocaleStringException; +/** + * Provides a central service for localization. + * + * @author Roland Rusch, easy-smart solution GmbH + */ final class Localization implements LocalizationInterface { private array $config; diff --git a/classes/Components/I18n/LocalizationInterface.php b/classes/Components/I18n/LocalizationInterface.php index 9997a57c..9bb39aaf 100644 --- a/classes/Components/I18n/LocalizationInterface.php +++ b/classes/Components/I18n/LocalizationInterface.php @@ -1,4 +1,8 @@ + * SPDX-License-Identifier: AGPL-3.0-only + */ declare(strict_types=1); diff --git a/classes/Components/I18n/data/Iso3166data.php b/classes/Components/I18n/data/Iso3166data.php index 145a92fe..48ee51ff 100644 --- a/classes/Components/I18n/data/Iso3166data.php +++ b/classes/Components/I18n/data/Iso3166data.php @@ -1,6 +1,7 @@ [ 'A3' => 'ABW', diff --git a/classes/Components/I18n/data/Iso639data.php b/classes/Components/I18n/data/Iso639data.php index 6bfee932..99eada27 100644 --- a/classes/Components/I18n/data/Iso639data.php +++ b/classes/Components/I18n/data/Iso639data.php @@ -1,6 +1,7 @@ [