diff --git a/.cspell-project-words.txt b/.cspell-project-words.txt new file mode 100644 index 0000000000000000000000000000000000000000..7a6531479a12924fb6ac830b93bb946b3b7bf4a7 --- /dev/null +++ b/.cspell-project-words.txt @@ -0,0 +1,13 @@ +beispiel +beispiele +danke +kartoffel +kartoffeln +katze +katzen +schön +seite +seiten +hund +hunde +mymodule diff --git a/README.md b/README.md index aa7c56eaa79a60cdc078585450ff9e5045eede68..4b576b70118ccb106086c1b1a7d9ff8b841eede4 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ In a deploy hook for multiple translation we need to create an array and hand it This is how it looks for singular case: ``` -function mymodule_deploy_singular_mutliple_xy() { +function HOOK_deploy_singular_multiple_xy() { $translations_array = [ 'cat' => 'Katze', 'dog' => 'Hund' diff --git a/src/TsiService.php b/src/TsiService.php index ea589a7db60691384e530f963b84b146100f6ba9..5fa1c640a8669fc4f0d3522396320b3ab8fa1799 100644 --- a/src/TsiService.php +++ b/src/TsiService.php @@ -51,15 +51,6 @@ class TsiService implements TsiServiceInterface { $this->clearLocaleCaches($langcode, $lids); } - /** - * Call of the old method. - * - * Redirect the deprecated method to the updated method. - */ - public function addPlural($singular_source, $singular_translated, $plural_source, $plural_translated, $langcode, $context = ''): void { - $this->addPluralTranslation($singular_source, $singular_translated, $plural_source, $plural_translated, $langcode, $context); - } - /** * {@inheritdoc} */ diff --git a/src/TsiServiceInterface.php b/src/TsiServiceInterface.php index d7fcfeb8d5da34e87cbc0ea1b31fc336274c9e91..d5f4875833c0402197312e99e252e18af41666d8 100644 --- a/src/TsiServiceInterface.php +++ b/src/TsiServiceInterface.php @@ -35,28 +35,6 @@ interface TsiServiceInterface { */ public function addMultipleTranslation(array $translation_array, string $langcode, $context = ''): void; - /** - * Adds translation for plural strings. - * - * @param string $singular_source - * The singular form of the source string in default language. - * @param string $singular_translated - * The singular form of the translated source string in the language given - * by the $langcode. - * @param string $plural_source - * The plural form of the source string in default language. - * @param string $plural_translated - * The plural form of the translated source string in the language given by - * the $langcode. - * @param string $langcode - * The language code for the translations. - * @param string $context - * (optional) The context for the translations. - * - * @depricated Use addPluralTranslation() instead. - */ - public function addPlural($singular_source, $singular_translated, $plural_source, $plural_translated, $langcode, $context = ''); - /** * Adds translation for plural strings. * diff --git a/tests/src/Kernel/TsiApiTest.php b/tests/src/Kernel/TsiApiTest.php index aaa515313fd6b45e192803a66fefbc42fd19f228..83e3fe24b7e83171a8d9b77e5a30345d6520a493 100644 --- a/tests/src/Kernel/TsiApiTest.php +++ b/tests/src/Kernel/TsiApiTest.php @@ -76,6 +76,7 @@ class TsiApiTest extends KernelTestBase { $this->tsiService->addTranslation($source, $translated, $langcode); // Assert that the translated string is correct. + // @phpcs:ignore $this->assertEquals($translated, $this->t($source, [], ['langcode' => $langcode])); } @@ -97,6 +98,7 @@ class TsiApiTest extends KernelTestBase { // Assert that the translations were added successfully. foreach ($translation_array as $source => $translated) { + // @phpcs:ignore $this->assertEquals($translated, $this->t($source, [], ['langcode' => $langcode])); } }