aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-10 18:29:58 +0200
committerGitHub <noreply@github.com>2023-07-10 18:29:58 +0200
commitd3f50f28e14eabc317417450c0f932f71a291d38 (patch)
treec0c3250cb5c6ca625c3999180ed500128770c997 /tests
parent1b422df12ac8eb26514849fb117e0dcf58623b88 (diff)
parent81f9d9a690ee540e640865d9e21f53ae8c37c6bf (diff)
downloadnextcloud-server-d3f50f28e14eabc317417450c0f932f71a291d38.tar.gz
nextcloud-server-d3f50f28e14eabc317417450c0f932f71a291d38.zip
Merge pull request #38953 from nextcloud/backport/38917/stable27
[stable27] fix(l10n): Fix plural issue with different locale and language
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/L10N/L10nTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php
index f224592432c..67ad5843546 100644
--- a/tests/lib/L10N/L10nTest.php
+++ b/tests/lib/L10N/L10nTest.php
@@ -85,6 +85,15 @@ class L10nTest extends TestCase {
$this->assertEquals('5 oken', (string)$l->n('%n window', '%n windows', 5));
}
+ public function testGermanPluralWithCzechLocaleTranslations() {
+ $transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json';
+ $l = new L10N($this->getFactory(), 'test', 'de', 'cs_CZ', [$transFile]);
+
+ $this->assertEquals('1 Datei', (string) $l->n('%n file', '%n files', 1));
+ $this->assertEquals('2 Dateien', (string) $l->n('%n file', '%n files', 2));
+ $this->assertEquals('5 Dateien', (string) $l->n('%n file', '%n files', 5));
+ }
+
public function dataPlaceholders(): array {
return [
['Ordered placeholders one %s two %s', 'Placeholder one 1 two 2'],