mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-01 23:37:43 +02:00
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72803 467b73ca-7a2a-4603-9d3b-597d59a354a9
40 lines
913 B
JavaScript
40 lines
913 B
JavaScript
if(typeof(ss) == 'undefined') ss = {};
|
|
|
|
/**
|
|
* Stub implementation for ss.i18n code.
|
|
* Use instead of sapphire/javascript/i18n.js
|
|
* if you want to use any SilverStripe javascript
|
|
* without internationalization support.
|
|
*/
|
|
ss.i18n = {
|
|
currentLocale: 'en_US',
|
|
|
|
defaultLocale: 'en_US',
|
|
|
|
_t: function (entity, fallbackString, priority, context) {
|
|
return fallbackString;
|
|
},
|
|
|
|
sprintf: function(S) {
|
|
if (arguments.length == 1) return S;
|
|
|
|
var nS = "";
|
|
var tS = S.split("%s");
|
|
|
|
var args = [];
|
|
for (var i=1, len = arguments.length; i <len; ++i) {
|
|
args.push(arguments[i]);
|
|
};
|
|
|
|
for(var i=0; i<args.length; i++) {
|
|
if (tS[i].lastIndexOf('%') == tS[i].length-1 && i != args.length-1)
|
|
tS[i] += "s"+tS.splice(i+1,1)[0];
|
|
nS += tS[i] + args[i];
|
|
}
|
|
return nS + tS[tS.length-1];
|
|
},
|
|
|
|
// stub methods
|
|
addDictionary: function() {},
|
|
getDictionary: function() {}
|
|
}; |