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
96281893
Commit
96281893
authored
Aug 26, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can't call i18n.translate directly if we bundle without i18n support
parent
1d6f2dbe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
23 deletions
+34
-23
Makefile
Makefile
+1
-1
converse.js
converse.js
+30
-19
index.html
index.html
+1
-1
tests_main.js
tests_main.js
+2
-2
No files found.
Makefile
View file @
96281893
...
...
@@ -35,7 +35,7 @@ help:
@
echo
" text to make text files"
pot
:
xgettext
--keyword
=
__
--keyword
=
translate
--from-code
=
UTF-8
--output
=
locale/converse.pot converse.js
--package-name
=
Converse.js
--copyright-holder
=
"Jan-Carel Brand"
--package-version
=
0.4
-c
--language
=
"python"
;
xgettext
--keyword
=
__
--keyword
=
___
--from-code
=
UTF-8
--output
=
locale/converse.pot converse.js
--package-name
=
Converse.js
--copyright-holder
=
"Jan-Carel Brand"
--package-version
=
0.4
-c
--language
=
"python"
;
release
:
r.js
-o
build.js
...
...
converse.js
View file @
96281893
...
...
@@ -76,6 +76,8 @@
_
.
extend
(
this
,
_
.
pick
(
settings
,
whitelist
));
var
__
=
$
.
proxy
(
function
(
str
)
{
/* Translation factory
*/
if
(
this
.
i18n
===
undefined
)
{
return
str
;
}
...
...
@@ -86,6 +88,18 @@
return
t
.
fetch
();
}
},
this
);
var
___
=
function
(
str
)
{
/* XXX: This is part of a hack to get gettext to scan strings to be
* translated. Strings we cannot send to the function above because
* they require variable interpolation and we don't yet have the
* variables at scan time.
*
* See actionInfoMessages
*/
return
str
;
};
this
.
msg_counter
=
0
;
this
.
autoLink
=
function
(
text
)
{
// Convert URLs into hyperlinks
...
...
@@ -1427,22 +1441,20 @@
},
actionInfoMessages
:
{
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been banned
301
:
converse
.
i18n
.
translate
(
'
<strong>%1$s</strong> has been banned
'
),
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been kicked out
307
:
converse
.
i18n
.
translate
(
'
<strong>%1$s</strong> has been kicked out
'
),
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been removed because of an affiliasion change
321
:
converse
.
i18n
.
translate
(
"
<strong>%1$s</strong> has been removed because of an affiliation change
"
),
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been removed for not being a member
322
:
converse
.
i18n
.
translate
(
"
<strong>%1$s</strong> has been removed for not being a member
"
)
/* XXX: Note the triple underscore function and not double
* underscore.
*
* This is a hack. We can't pass the strings to __ because we
* don't yet know what the variable to interpolate is.
*
* Triple underscore will just return the string again, but we
* can then at least tell gettext to scan for it so that these
* strings are picked up by the translation machinery.
*/
301
:
___
(
"
<strong>%1$s</strong> has been banned
"
),
307
:
___
(
"
<strong>%1$s</strong> has been kicked out
"
),
321
:
___
(
"
<strong>%1$s</strong> has been removed because of an affiliation change
"
),
322
:
___
(
"
<strong>%1$s</strong> has been removed for not being a member
"
)
},
disconnectMessages
:
{
...
...
@@ -1474,9 +1486,8 @@
info_msgs
.
push
(
this
.
infoMessages
[
stat
]);
}
else
if
(
_
.
contains
(
_
.
keys
(
this
.
actionInfoMessages
),
stat
))
{
action_msgs
.
push
(
this
.
actionInfoMessages
[
stat
].
fetch
(
Strophe
.
unescapeNode
(
Strophe
.
getResourceFromJid
(
$el
.
attr
(
'
from
'
)))
));
__
(
this
.
actionInfoMessages
[
stat
],
Strophe
.
unescapeNode
(
Strophe
.
getResourceFromJid
(
$el
.
attr
(
'
from
'
))))
);
}
}
}
...
...
index.html
View file @
96281893
...
...
@@ -168,7 +168,7 @@
prebind
:
false
,
show_controlbox_by_default
:
true
,
xhr_user_search
:
false
,
debug
:
false
debug
:
true
});
});
</script>
...
...
tests_main.js
View file @
96281893
...
...
@@ -3,10 +3,10 @@ require.config({
paths
:
{
"
jquery
"
:
"
components/jquery/jquery
"
,
"
locales
"
:
"
locale/locales
"
,
"
tinysort
"
:
"
components/tinysort/src/jquery.tinysort
"
,
"
jquery.
tinysort
"
:
"
components/tinysort/src/jquery.tinysort
"
,
"
underscore
"
:
"
components/underscore/underscore
"
,
"
backbone
"
:
"
components/backbone/backbone
"
,
"
locals
torage
"
:
"
components/backbone.localStorage/backbone.localStorage
"
,
"
backbone.localS
torage
"
:
"
components/backbone.localStorage/backbone.localStorage
"
,
"
strophe
"
:
"
components/strophe/strophe
"
,
"
strophe.muc
"
:
"
components/strophe.muc/index
"
,
"
strophe.roster
"
:
"
components/strophe.roster/index
"
,
...
...
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