
assets.es-head.src.vendor.i18n.i18n.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirius-search Show documentation
Show all versions of sirius-search Show documentation
Provides a thin layer above Elasticsearch (Fluent Query API, Automatic Mapping, Utilities)
The newest version!
(function() {
/**
* provides text formatting and i18n key storage features
* implements most of the Sun Java MessageFormat functionality.
* @see Sun's Documentation
*/
var keys = {};
var locale = undefined;
var format = function(message, args) {
var substitute = function() {
var format = arguments[1].split(',');
var substr = escape(args[format.shift()]);
if(format.length === 0) {
return substr; // simple substitution eg {0}
}
switch(format.shift()) {
case "number" : return (new Number(substr)).toLocaleString(locale);
case "date" : return (new Date(+substr)).toLocaleDateString(locale); // date and time require milliseconds since epoch
case "time" : return (new Date(+substr)).toLocaleTimeString(locale); // eg i18n.text("Key", +(new Date())); for current time
}
var styles = format.join("").split("|").map(function(style) {
return style.match(/(-?[\.\d]+)(#|<)([^{}]*)/);
});
var match = styles[0][3];
for(var i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy