Cherry-pick only those languages from Moment which we support in converse.js

This commit is contained in:
JC Brand 2015-06-22 22:05:33 +02:00
parent 98f6ea8a3f
commit c745e1ebff
10 changed files with 63 additions and 10 deletions

View File

@ -22,7 +22,7 @@
"almond": "~0.3.0",
"requirejs-text": "~2.0.12",
"requirejs-tpl-jcbrand": "*",
"momentjs": "~2.6.0",
"momentjs": "~2.10.3",
"jquery.browser": ">=0.0.7",
"jquery-easing-original": "https://raw.githubusercontent.com/jcbrand/jquery.easing/7de3458b1845a72c1f407debf6b223c8446396bf/jquery.easing.1.3.js",
"bootstrap": "~3.2.0",

View File

@ -6126,14 +6126,15 @@
}
},
'env': {
'jQuery': $,
'Strophe': Strophe,
'$build': $build,
'$iq': $iq,
'$pres': $pres,
'$msg': $msg,
'$pres': $pres,
'Strophe': Strophe,
'_': _,
'b64_sha1': b64_sha1
'b64_sha1': b64_sha1,
'jQuery': $,
'moment': moment
}
};
}));

20
main.js
View File

@ -26,7 +26,7 @@ require.config({
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/dist/jquery.browser",
"jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
"moment": "components/momentjs/min/moment-with-langs",
"moment": "components/momentjs/min/moment.min",
"strophe-base64": "components/strophejs/src/base64",
"strophe-bosh": "components/strophejs/src/bosh",
"strophe-core": "components/strophejs/src/core",
@ -83,6 +83,24 @@ require.config({
"uk": "locale/uk/LC_MESSAGES/converse.json",
"zh": "locale/zh/LC_MESSAGES/converse.json",
"moment_with_locales": "src/moment_locales",
'moment_af': "components/momentjs/locale/af",
'moment_de': "components/momentjs/locale/de",
'moment_es': "components/momentjs/locale/es",
'moment_fr': "components/momentjs/locale/fr",
'moment_he': "components/momentjs/locale/he",
'moment_hu': "components/momentjs/locale/hu",
'moment_id': "components/momentjs/locale/id",
'moment_it': "components/momentjs/locale/it",
'moment_ja': "components/momentjs/locale/ja",
'moment_nb': "components/momentjs/locale/nb",
'moment_nl': "components/momentjs/locale/nl",
'moment_pl': "components/momentjs/locale/pl",
'moment_pt-br': "components/momentjs/locale/pt-br",
'moment_ru': "components/momentjs/locale/ru",
'moment_uk': "components/momentjs/locale/uk",
'moment_zh': "components/momentjs/locale/zh-cn",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",

View File

@ -10,6 +10,7 @@
} (this, function ($, mock, test_utils) {
var $msg = converse_api.env.$msg;
var Strophe = converse_api.env.Strophe;
var moment = converse_api.env.moment;
return describe("Chatboxes", $.proxy(function(mock, test_utils) {
describe("A Chatbox", $.proxy(function () {

View File

@ -2,7 +2,7 @@ define("converse-dependencies", [
"jquery",
"utils",
"otr",
"moment",
"moment_with_locales",
"strophe",
"strophe.vcard",
"strophe.disco",

View File

@ -1,7 +1,7 @@
define("converse-dependencies", [
"jquery",
"utils",
"moment",
"moment_with_locales",
"strophe",
"strophe.vcard",
"strophe.disco",

View File

@ -1,7 +1,7 @@
define("converse-dependencies", [
"jquery",
"utils",
"moment",
"moment_with_locales",
"strophe",
"strophe.vcard",
"strophe.disco",

View File

@ -3,7 +3,7 @@ define("converse-dependencies", [
"underscore",
"utils",
"otr",
"moment",
"moment_with_locales",
"strophe",
"strophe.vcard",
"strophe.disco",

View File

@ -3,6 +3,8 @@
*
* Translations take up a lot of space and you are therefore advised to remove
* from here any languages that you don't need.
*
* See also src/moment_locales.js
*/
(function (root, factory) {
define("locales", ['jquery', 'jed',

31
src/moment_locales.js Normal file
View File

@ -0,0 +1,31 @@
/*
* This file specifies the supported locales for moment.js.
*
* Translations take up a lot of space and you are therefore advised to remove
* from here any languages that you don't need.
*
* See also src/locales.js
*/
(function (root, factory) {
define("moment_with_locales", [
'moment', // Everything below can be removed except for moment itself.
'moment_af',
'moment_de',
'moment_es',
'moment_fr',
'moment_he',
'moment_hu',
'moment_id',
'moment_it',
'moment_ja',
'moment_nb',
'moment_nl',
'moment_pl',
'moment_pt-br',
'moment_ru',
'moment_uk',
'moment_zh'
], function (moment) {
return moment;
});
})(this);