Fixes broken translation after i18next-client update to 1.8.0.

This commit is contained in:
paweldomas 2015-03-17 09:24:42 +01:00
parent 0848283f6d
commit f3274ea42e
3 changed files with 29 additions and 82 deletions

View File

@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=37"></script>
<script src="libs/app.bundle.js?v=38"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=6"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@ -17411,11 +17411,11 @@ var XMPP = {
module.exports = XMPP;
},{"../../service/RTC/StreamEventTypes":92,"../../service/UI/UIEvents":93,"../../service/xmpp/XMPPEvents":98,"./SDP":50,"./moderator":54,"./recording":55,"./strophe.emuc":56,"./strophe.jingle":57,"./strophe.logger":58,"./strophe.moderate":59,"./strophe.rayo":60,"./strophe.util":61,"events":1,"pako":64}],63:[function(require,module,exports){
// i18next, v1.8.0
// Copyright (c)2015 Jan Mühlemann (jamuhl).
// i18next, v1.7.7
// Copyright (c)2014 Jan Mühlemann (jamuhl).
// Distributed under MIT license
// http://i18next.com
(function(root) {
(function() {
// add indexOf to non ECMA-262 standard compliant browsers
if (!Array.prototype.indexOf) {
@ -17489,7 +17489,8 @@ module.exports = XMPP;
}
}
var $ = root.jQuery || root.Zepto
var root = this
, $ = root.jQuery || root.Zepto
, i18n = {}
, resStore = {}
, currentLng
@ -17504,6 +17505,16 @@ module.exports = XMPP;
// If we're not in CommonJS, add `i18n` to the
// global object or to jquery.
if (typeof module !== 'undefined' && module.exports) {
if (!$) {
try {
$ = require('jquery');
} catch(e) {
// just ignore
}
}
if ($) {
$.i18n = $.i18n || i18n;
}
module.exports = i18n;
} else {
if ($) {
@ -17549,7 +17560,7 @@ module.exports = XMPP;
var todo = lngs.length;
f.each(lngs, function(key, lng) {
var local = f.localStorage.getItem('res_' + lng);
var local = window.localStorage.getItem('res_' + lng);
if (local) {
local = JSON.parse(local);
@ -18269,16 +18280,6 @@ module.exports = XMPP;
f.log('failed to set value for key "' + key + '" to localStorage.');
}
}
},
getItem: function(key, value) {
if (window.localStorage) {
try {
return window.localStorage.getItem(key, value);
} catch (e) {
f.log('failed to get value for key "' + key + '" from localStorage.');
return undefined;
}
}
}
}
};
@ -18412,9 +18413,6 @@ module.exports = XMPP;
} else {
f.extend(resStore[lng][ns], resources);
}
if (o.useLocalStorage) {
sync._storeLocal(resStore);
}
}
function hasResourceBundle(lng, ns) {
@ -18435,15 +18433,6 @@ module.exports = XMPP;
return hasValues;
}
function getResourceBundle(lng, ns) {
if (typeof ns !== 'string') {
ns = o.ns.defaultNs;
}
resStore[lng] = resStore[lng] || {};
return f.extend({}, resStore[lng][ns]);
}
function removeResourceBundle(lng, ns) {
if (typeof ns !== 'string') {
ns = o.ns.defaultNs;
@ -18451,9 +18440,6 @@ module.exports = XMPP;
resStore[lng] = resStore[lng] || {};
resStore[lng][ns] = {};
if (o.useLocalStorage) {
sync._storeLocal(resStore);
}
}
function addResource(lng, ns, key, value) {
@ -18483,9 +18469,6 @@ module.exports = XMPP;
}
x++;
}
if (o.useLocalStorage) {
sync._storeLocal(resStore);
}
}
function addResources(lng, ns, resources) {
@ -18827,10 +18810,6 @@ module.exports = XMPP;
if (potentialKeys === undefined || potentialKeys === null || potentialKeys === '') return '';
if (typeof potentialKeys === 'number') {
potentialKeys = String(potentialKeys);
}
if (typeof potentialKeys === 'string') {
potentialKeys = [potentialKeys];
}
@ -18867,27 +18846,11 @@ module.exports = XMPP;
}
}
var postProcessorsToApply;
if (typeof o.postProcess === 'string' && o.postProcess !== '') {
postProcessorsToApply = [o.postProcess];
} else if (typeof o.postProcess === 'array' || typeof o.postProcess === 'object') {
postProcessorsToApply = o.postProcess;
} else {
postProcessorsToApply = [];
}
if (typeof options.postProcess === 'string' && options.postProcess !== '') {
postProcessorsToApply = postProcessorsToApply.concat([options.postProcess]);
} else if (typeof options.postProcess === 'array' || typeof options.postProcess === 'object') {
postProcessorsToApply = postProcessorsToApply.concat(options.postProcess);
}
if (found !== undefined && postProcessorsToApply.length) {
postProcessorsToApply.forEach(function(postProcessor) {
var postProcessor = options.postProcess || o.postProcess;
if (found !== undefined && postProcessor) {
if (postProcessors[postProcessor]) {
found = postProcessors[postProcessor](found, key, options);
}
});
}
// process notFound if function exists
@ -18904,14 +18867,10 @@ module.exports = XMPP;
notFound = applyReplacement(notFound, options);
notFound = applyReuse(notFound, options);
if (postProcessorsToApply.length) {
if (postProcessor && postProcessors[postProcessor]) {
var val = _getDefaultValue(key, options);
postProcessorsToApply.forEach(function(postProcessor) {
if (postProcessors[postProcessor]) {
found = postProcessors[postProcessor](val, key, options);
}
});
}
}
return (found !== undefined) ? found : notFound;
@ -18968,7 +18927,6 @@ module.exports = XMPP;
if (needsPlural(options, lngs[0])) {
optionWithoutCount = f.extend({ lngs: [lngs[0]]}, options);
delete optionWithoutCount.count;
optionWithoutCount._origLng = optionWithoutCount._origLng || optionWithoutCount.lng || lngs[0];
delete optionWithoutCount.lng;
optionWithoutCount.defaultValue = o.pluralNotFound;
@ -18998,21 +18956,12 @@ module.exports = XMPP;
var clone = lngs.slice();
clone.shift();
options = f.extend(options, { lngs: clone });
options._origLng = optionWithoutCount._origLng;
delete options.lng;
// retry with fallbacks
translated = translate(ns + o.nsseparator + key, options);
if (translated != o.pluralNotFound) return translated;
} else {
optionWithoutCount.lng = optionWithoutCount._origLng;
delete optionWithoutCount._origLng;
translated = translate(ns + o.nsseparator + key, optionWithoutCount);
return applyReplacement(translated, {
count: options.count,
interpolationPrefix: options.interpolationPrefix,
interpolationSuffix: options.interpolationSuffix
});
return translated;
}
}
@ -19133,7 +19082,7 @@ module.exports = XMPP;
// get from localStorage
if (o.detectLngFromLocalStorage && typeof window !== 'undefined' && window.localStorage) {
userLngChoices.push(f.localStorage.getItem('i18next_lng'));
userLngChoices.push(window.localStorage.getItem('i18next_lng'));
}
// get from navigator
@ -19566,7 +19515,6 @@ module.exports = XMPP;
i18n.preload = preload;
i18n.addResourceBundle = addResourceBundle;
i18n.hasResourceBundle = hasResourceBundle;
i18n.getResourceBundle = getResourceBundle;
i18n.addResource = addResource;
i18n.addResources = addResources;
i18n.removeResourceBundle = removeResourceBundle;
@ -19582,11 +19530,10 @@ module.exports = XMPP;
i18n.functions = f;
i18n.lng = lng;
i18n.addPostProcessor = addPostProcessor;
i18n.applyReplacement = f.applyReplacement;
i18n.options = o;
})(typeof exports === 'undefined' ? window : exports);
},{}],64:[function(require,module,exports){
})();
},{"jquery":"jquery"}],64:[function(require,module,exports){
// Top level file is just a mixin of submodules & constants
'use strict';

View File

@ -17,7 +17,7 @@
"dependencies": {
"events": "*",
"pako": "*",
"i18next-client": "*",
"i18next-client": "1.7.7",
"sdp-interop": "jitsi/sdp-interop#f65fedfe57a"
},
"devDependencies": {