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
9f975c79
Commit
9f975c79
authored
Apr 22, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`preferred_locale` might be a JSON string, not an object
parent
9faf9c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/utils.js
src/utils.js
+6
-6
No files found.
src/utils.js
View file @
9f975c79
...
...
@@ -459,12 +459,12 @@
utils
.
getLocale
=
function
(
preferred_locale
,
isSupportedByLibrary
)
{
if
(
isSupportedByLibrary
(
preferred_locale
))
{
return
preferred_locale
;
}
else
if
(
_
.
isObject
(
preferred_locale
))
{
try
{
return
preferred_locale
.
locale_data
.
converse
[
""
].
lang
;
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
try
{
var
obj
=
window
.
JSON
.
parse
(
preferred_locale
)
;
return
obj
.
locale_data
.
converse
[
""
].
lang
;
}
catch
(
e
)
{
console
.
log
(
e
);
}
return
utils
.
detectLocale
(
isSupportedByLibrary
)
||
'
en
'
;
};
...
...
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