summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-10-09 10:14:36 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-10-14 20:45:36 +0200
commit056a74e3230071191fc0c19cfb8c17d2f8c8ab12 (patch)
tree2f64bf10686fbdb8f2be0d6b0acd6a7f2b07f162 /core/js/tests
parent365f68372f7d1e773ede9e428535e52406835212 (diff)
downloadnextcloud-server-056a74e3230071191fc0c19cfb8c17d2f8c8ab12.tar.gz
nextcloud-server-056a74e3230071191fc0c19cfb8c17d2f8c8ab12.zip
Fix plural function to be hardcoded
No more weird eval to construct a plural function. We just use the plural function from symfony. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/l10nSpec.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/core/js/tests/specs/l10nSpec.js b/core/js/tests/specs/l10nSpec.js
index 219c9348717..01ec69aaf43 100644
--- a/core/js/tests/specs/l10nSpec.js
+++ b/core/js/tests/specs/l10nSpec.js
@@ -87,7 +87,6 @@ describe('OC.L10N tests', function() {
spyOn(console, 'warn');
OC.L10N.register(TEST_APP, {
});
- expect(console.warn).toHaveBeenCalled();
expect(
n(TEST_APP, 'download %n file', 'download %n files', 0)
).toEqual('download 0 files');
@@ -107,26 +106,6 @@ describe('OC.L10N tests', function() {
'_download %n file_::_download %n files_':
['%n Datei herunterladen', '%n Dateien herunterladen']
});
- expect(console.warn).toHaveBeenCalled();
- checkPlurals();
- });
- it('generates plural with generated function when forms is specified', function() {
- OC.L10N.register(TEST_APP, {
- '_download %n file_::_download %n files_':
- ['%n Datei herunterladen', '%n Dateien herunterladen']
- }, 'nplurals=2; plural=(n != 1);');
- checkPlurals();
- });
- it('generates plural with function when forms is specified as function', function() {
- OC.L10N.register(TEST_APP, {
- '_download %n file_::_download %n files_':
- ['%n Datei herunterladen', '%n Dateien herunterladen']
- }, function(n) {
- return {
- nplurals: 2,
- plural: (n !== 1) ? 1 : 0
- };
- });
checkPlurals();
});
});
@@ -164,7 +143,6 @@ describe('OC.L10N tests', function() {
OC.L10N.register(TEST_APP, {
'Hello world!': 'Hallo Welt!'
});
- expect(console.warn).toHaveBeenCalled();
OC.L10N.load(TEST_APP, callbackStub).then(promiseStub);
expect(callbackStub.calledOnce).toEqual(true);
expect(promiseStub.calledOnce).toEqual(true);