Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
0091df2b
Commit
0091df2b
authored
9 years ago
by
Vincent Petry
Browse files
Options
Downloads
Patches
Plain Diff
Improved JS L10N bundle merging + tests
parent
78570a5f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/js/l10n.js
+1
-3
1 addition, 3 deletions
core/js/l10n.js
core/js/tests/specs/l10nSpec.js
+8
-0
8 additions, 0 deletions
core/js/tests/specs/l10nSpec.js
with
9 additions
and
3 deletions
core/js/l10n.js
+
1
−
3
View file @
0091df2b
...
...
@@ -78,9 +78,7 @@ OC.L10N = {
}
}
else
{
// Theme overwriting the default language
_
.
each
(
bundle
,
function
(
translation
,
key
)
{
self
.
_bundles
[
appName
][
key
]
=
translation
});
_
.
extend
(
self
.
_bundles
[
appName
],
bundle
);
}
},
...
...
This diff is collapsed.
Click to expand it.
core/js/tests/specs/l10nSpec.js
+
8
−
0
View file @
0091df2b
...
...
@@ -52,6 +52,14 @@ describe('OC.L10N tests', function() {
t
(
TEST_APP
,
'
Hello {name}
'
,
{
name
:
'
<strong>Steve</strong>
'
},
null
,
{
escape
:
false
})
).
toEqual
(
'
Hello <strong>Steve</strong>
'
);
});
it
(
'
keeps old texts when registering existing bundle
'
,
function
()
{
OC
.
L10N
.
register
(
TEST_APP
,
{
'
sunny
'
:
'
sonnig
'
,
'
new
'
:
'
neu
'
});
expect
(
t
(
TEST_APP
,
'
sunny
'
)).
toEqual
(
'
sonnig
'
);
expect
(
t
(
TEST_APP
,
'
new
'
)).
toEqual
(
'
neu
'
);
});
});
describe
(
'
plurals
'
,
function
()
{
function
checkPlurals
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment