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
6afcc0fb
Commit
6afcc0fb
authored
May 20, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring lang detect code in line with coding style.
Change html files so that we auto-detect the lang now.
parent
99a017fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
converse.js
converse.js
+19
-15
dev.html
dev.html
+0
-1
index.html
index.html
+0
-1
No files found.
converse.js
View file @
6afcc0fb
...
...
@@ -215,32 +215,36 @@
// Translation machinery
// ---------------------
this
.
isAvailableLocale
=
function
(
locale
){
ret
=
null
;
if
(
locales
[
locale
])
ret
=
locales
[
locale
];
else
{
this
.
isAvailableLocale
=
function
(
locale
)
{
ret
=
null
;
if
(
locales
[
locale
])
{
ret
=
locales
[
locale
];
}
else
{
sublocale
=
locale
.
split
(
"
-
"
)[
0
];
if
(
sublocale
!=
locale
&&
locales
[
sublocale
])
ret
=
locales
[
sublocale
];
if
(
sublocale
!=
locale
&&
locales
[
sublocale
])
{
ret
=
locales
[
sublocale
];
}
}
return
ret
;
};
this
.
detectLocale
=
function
(){
ret
=
null
;
if
(
window
.
navigator
.
userLanguage
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
userLanguage
);
else
if
(
window
.
navigator
.
languages
&&
!
ret
){
this
.
detectLocale
=
function
()
{
ret
=
null
;
if
(
window
.
navigator
.
userLanguage
)
{
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
userLanguage
);
}
else
if
(
window
.
navigator
.
languages
&&
!
ret
)
{
for
(
var
i
=
0
;
i
<
window
.
navigator
.
languages
.
length
&&
!
ret
;
i
++
)
{
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
languages
[
i
]);
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
languages
[
i
]);
}
}
else
if
(
window
.
navigator
.
browserLanguage
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
browserLanguage
);
else
if
(
window
.
navigator
.
language
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
language
);
else
if
(
window
.
navigator
.
systemLanguage
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
systemLanguage
);
else
{
ret
=
locales
.
en
}
else
if
(
window
.
navigator
.
browserLanguage
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
browserLanguage
);
else
if
(
window
.
navigator
.
language
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
language
);
else
if
(
window
.
navigator
.
systemLanguage
&&
!
ret
)
ret
=
this
.
isAvailableLocale
(
window
.
navigator
.
systemLanguage
);
else
{
ret
=
locales
.
en
;
}
return
ret
;
};
this
.
i18n
=
settings
.
i18n
?
settings
.
i18n
:
this
.
detectLocale
();
var
__
=
$
.
proxy
(
utils
.
__
,
this
);
var
___
=
utils
.
___
;
...
...
dev.html
View file @
6afcc0fb
...
...
@@ -53,7 +53,6 @@
require
([
'
converse
'
],
function
(
converse
)
{
converse
.
initialize
({
bosh_service_url
:
'
https://conversejs.org/http-bind/
'
,
// Please use this connection manager only for testing purposes
i18n
:
locales
[
'
en
'
],
// Refer to ./locale/locales.js to see which locales are supported
keepalive
:
true
,
message_carbons
:
true
,
play_sounds
:
true
,
...
...
index.html
View file @
6afcc0fb
...
...
@@ -251,7 +251,6 @@
})();
converse
.
initialize
({
bosh_service_url
:
'
https://conversejs.org/http-bind/
'
,
// Please use this connection manager only for testing purposes
i18n
:
locales
[
'
en
'
],
// Refer to ./locale/locales.js to see which locales are supported
keepalive
:
true
,
message_carbons
:
true
,
play_sounds
:
true
,
...
...
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