aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-10 18:05:48 +0200
committerGitHub <noreply@github.com>2023-07-10 18:05:48 +0200
commit1c59a7a5db0a750a2f841a4211814f28178737d3 (patch)
tree5c5dc565701154adad10aa8071b92b6e1f5696af /tests
parent61835be271d29a2269cada83e763443974f69cc2 (diff)
parent756e1191628b6a47dfef92e4c4d2edfc47fdb140 (diff)
downloadnextcloud-server-1c59a7a5db0a750a2f841a4211814f28178737d3.tar.gz
nextcloud-server-1c59a7a5db0a750a2f841a4211814f28178737d3.zip
Merge pull request #39031 from nextcloud/backport/38917/stable26
[stable26] 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'],