mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
7ecbf49ac9
git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@117896 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() {}
|
|
}; |