Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Toolkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Web Component Framework
Toolkit
Commits
ca674dc5
Commit
ca674dc5
authored
5 years ago
by
Reiter, Christoph
Browse files
Options
Downloads
Patches
Plain Diff
Port to new i18next wrapper
parent
281e80bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/auth/package.json
+0
-1
0 additions, 1 deletion
packages/auth/package.json
packages/auth/src/i18n.js
+2
-25
2 additions, 25 deletions
packages/auth/src/i18n.js
packages/auth/vendor/common
+1
-1
1 addition, 1 deletion
packages/auth/vendor/common
with
3 additions
and
27 deletions
packages/auth/package.json
+
0
−
1
View file @
ca674dc5
...
...
@@ -25,7 +25,6 @@
"vpu-common"
:
"file:./vendor/common"
},
"dependencies"
:
{
"i18next"
:
"^17.0.3"
,
"lit-element"
:
"^2.1.0"
},
"scripts"
:
{
...
...
This diff is collapsed.
Click to expand it.
packages/auth/src/i18n.js
+
2
−
25
View file @
ca674dc5
import
i18next
from
'
i18next
'
;
import
{
createInstance
}
from
'
vpu-common/
i18next
.js
'
;
import
de
from
'
./i18n/de/translation.json
'
;
import
en
from
'
./i18n/en/translation.json
'
;
const
i18n
=
i18next
.
createInstance
();
i18n
.
init
({
lng
:
'
de
'
,
fallbackLng
:
[
'
de
'
],
debug
:
false
,
initImmediate
:
false
,
// Don't init async
resources
:
{
en
:
{
translation
:
en
},
de
:
{
translation
:
de
}
},
});
console
.
assert
(
i18n
.
isInitialized
);
function
dateTimeFormat
(
date
,
options
)
{
return
new
Intl
.
DateTimeFormat
(
i18n
.
languages
,
options
).
format
(
date
);
}
function
numberFormat
(
number
,
options
)
{
return
new
Intl
.
NumberFormat
(
i18n
.
languages
,
options
).
format
(
number
);
}
export
{
i18n
,
dateTimeFormat
,
numberFormat
};
export
const
i18n
=
createInstance
({
en
:
en
,
de
:
de
},
'
de
'
,
'
en
'
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
common
@
378256b0
Subproject commit
b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7
Subproject commit
378256b0ae92712fd5b8feed3a987cd014617c0b
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