Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions core/js/tests/specs/l10nSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,67 +110,4 @@ describe('OC.L10N tests', function() {
checkPlurals();
});
});
describe('async loading of translations', function() {
afterEach(() => {
document.documentElement.removeAttribute('data-locale')
})
it('loads bundle for given app and calls callback', function(done) {
document.documentElement.setAttribute('data-locale', 'zh_CN')
var callbackStub = sinon.stub();
var promiseStub = sinon.stub();
var loading = OC.L10N.load(TEST_APP, callbackStub);
expect(callbackStub.notCalled).toEqual(true);
var req = fakeServer.requests[0];

console.warn('fff-', window.OC.appswebroots)
loading
.then(promiseStub)
.then(function() {
expect(fakeServer.requests.length).toEqual(1);
expect(req.url).toEqual(
OC.getRootPath() + '/apps3/' + TEST_APP + '/l10n/zh_CN.json'
);

expect(callbackStub.calledOnce).toEqual(true);
expect(promiseStub.calledOnce).toEqual(true);
expect(t(TEST_APP, 'Hello world!')).toEqual('你好世界!');
})
.then(done)
.catch(e => expect(e).toBe('No error expected!'));

expect(promiseStub.notCalled).toEqual(true);
req.respond(
200,
{ 'Content-Type': 'application/json' },
JSON.stringify({
translations: {'Hello world!': '你好世界!'},
pluralForm: 'nplurals=2; plural=(n != 1);'
})
);
});
it('calls callback if translation already available', function(done) {
var callbackStub = sinon.stub();
spyOn(console, 'warn');
OC.L10N.register(TEST_APP, {
'Hello world!': 'Hallo Welt!'
});
OC.L10N.load(TEST_APP, callbackStub)
.then(function() {
expect(callbackStub.calledOnce).toEqual(true);
expect(fakeServer.requests.length).toEqual(0);
})
.then(done);

});
it('calls callback if locale is en', function(done) {
var callbackStub = sinon.stub();
OC.L10N.load(TEST_APP, callbackStub)
.then(function() {
expect(callbackStub.calledOnce).toEqual(true);
expect(fakeServer.requests.length).toEqual(0);
})
.then(done)
.catch(done);
});
});
});
2 changes: 1 addition & 1 deletion dist/1521-1521.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/1642-1642.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/1656-1656.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/2142-2142.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/2452-2452.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.2
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/2983-2983.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/3485-3485.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/3920-3920.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/4013-4013.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/4215-4215.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/5085-5085.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/5528-5528.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/7265-7265.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This file is generated from multiple sources. Included packages:
- version: 7.4.47
- license: Apache-2.0
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/7367-7367.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/7462-7462.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/7493-7493.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/8057-8057.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/8158-8158.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/8737-8737.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/9279-9279.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.2
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/comments-comments-tab.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/comments-init.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-install.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.2
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/core-legacy-unified-search.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-login.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-main.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-profile.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-recommendedapps.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-unified-search.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/core-unsupported-browser.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is generated from multiple sources. Included packages:
- version: 3.3.2
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/dashboard-main.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/dav-settings-admin-caldav.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/router
- version: 3.0.1
Expand Down
2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This file is generated from multiple sources. Included packages:
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- version: 3.3.0
- license: GPL-3.0-or-later
- @nextcloud/logger
- version: 3.0.2
Expand Down
Loading
Loading