Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
86c4853b
Commit
86c4853b
authored
Oct 15, 2020
by
bernard-ng
Committed by
JC Brand
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2290 format dayjs locale
parent
62c657be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/i18n/index.js
src/i18n/index.js
+4
-2
No files found.
src/i18n/index.js
View file @
86c4853b
...
...
@@ -73,12 +73,14 @@ function isLocaleAvailable (locale, available) {
*/
async
function
fetchTranslations
(
_converse
)
{
const
{
api
,
locale
}
=
_converse
;
const
dayjs_locale
=
locale
.
toLowerCase
().
replace
(
'
_
'
,
'
-
'
);
if
(
!
isConverseLocale
(
locale
,
api
.
settings
.
get
(
"
locales
"
))
||
locale
===
'
en
'
)
{
return
;
}
const
{
default
:
data
}
=
await
import
(
/*webpackChunkName: "locales/[request]" */
`../i18n/
${
locale
}
/LC_MESSAGES/converse.po`
);
await
import
(
/*webpackChunkName: "locales/dayjs/[request]" */
`dayjs/locale/
${
locale
.
toLowerCase
().
replace
(
'
_
'
,
'
-
'
)
}
`
);
dayjs
.
locale
(
getLocale
(
locale
,
l
=>
dayjs
.
locale
(
l
)));
await
import
(
/*webpackChunkName: "locales/dayjs/[request]" */
`dayjs/locale/
${
dayjs_locale
}
`
);
dayjs
.
locale
(
getLocale
(
dayjs_
locale
,
l
=>
dayjs
.
locale
(
l
)));
jed_instance
=
new
Jed
(
data
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment