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
44a2f780
Commit
44a2f780
authored
Mar 31, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hook in `ar` and `eu` locales and document.
parent
6381128a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
docs/source/translations.rst
docs/source/translations.rst
+28
-2
src/converse-core.js
src/converse-core.js
+1
-1
src/i18n.js
src/i18n.js
+2
-0
No files found.
docs/source/translations.rst
View file @
44a2f780
...
...
@@ -104,8 +104,8 @@ To do this for ALL languages, run:
The resulting `.po` file is then what gets translated.
Generating a J
avaScript
file from a translations file
-----------------------------------------------
------
Generating a J
SON
file from a translations file
-----------------------------------------------
Unfortunately `Jed <http://slexaxton.github.io/Jed>`_, which we use for
translations in converse.js cannot use the `.po` files directly. We have
...
...
@@ -136,3 +136,29 @@ To do this for ALL languages, run:
If you are adding translations for a new language that is not already supported,
you'll have to add the language path in main.js and make one more edit in ./src/locales.js
to make sure the language is loaded by require.js.
Making sure the JSON file will get loaded
------------------------------------------
Finally, make sure that the language code is added to the list of default
values for the ``locales`` config setting.
This is done in ``src/converse-core.js``.
Look for the following section:
.. code-block:: javascript
// Default configuration values
// ----------------------------
this.default_settings = {
// ... Omitted for brevity
locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
locales: [
'af', 'ar', 'bg', 'ca', 'de', 'es', 'en', 'fr', 'he',
'hu', 'id', 'it', 'ja', 'nb', 'nl',
'pl', 'pt_BR', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'
],
// ... Omitted for brevity
};
src/converse-core.js
View file @
44a2f780
...
...
@@ -312,7 +312,7 @@
keepalive
:
true
,
locales_url
:
'
locale/{{{locale}}}/LC_MESSAGES/converse.json
'
,
locales
:
[
'
af
'
,
'
bg
'
,
'
ca
'
,
'
de
'
,
'
es
'
,
'
en
'
,
'
fr
'
,
'
he
'
,
'
af
'
,
'
ar
'
,
'
bg
'
,
'
ca
'
,
'
de
'
,
'
es
'
,
'
eu
'
,
'
en
'
,
'
fr
'
,
'
he
'
,
'
hu
'
,
'
id
'
,
'
it
'
,
'
ja
'
,
'
nb
'
,
'
nl
'
,
'
pl
'
,
'
pt_BR
'
,
'
ru
'
,
'
tr
'
,
'
uk
'
,
'
zh_CN
'
,
'
zh_TW
'
],
...
...
src/i18n.js
View file @
44a2f780
...
...
@@ -15,10 +15,12 @@
"
lodash.noconflict
"
,
"
moment
"
,
'
moment/locale/af
'
,
'
moment/locale/ar
'
,
'
moment/locale/bg
'
,
'
moment/locale/ca
'
,
'
moment/locale/de
'
,
'
moment/locale/es
'
,
'
moment/locale/eu
'
,
'
moment/locale/fr
'
,
'
moment/locale/he
'
,
'
moment/locale/hu
'
,
...
...
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