This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="jquery_i18n/CLDRPluralRuleParser.js"></script> | |
<script src="jquery_i18n/jquery.i18n.js"></script> | |
<script src="jquery_i18n/jquery.i18n.messagestore.js"></script> | |
<script src="jquery_i18n/jquery.i18n.fallbacks.js"></script> | |
<script src="jquery_i18n/jquery.i18n.language.js"></script> | |
<script src="jquery_i18n/jquery.i18n.parser.js"></script> | |
<script src="jquery_i18n/jquery.i18n.emitter.js"></script> | |
<script src="jquery_i18n/jquery.i18n.emitter.bidi.js"></script> | |
<script src="jquery_i18n/main-jquery_i18n.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en" dir="ltr"> | |
<!-- ... --> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<a href="#" class="lang-switch" data-locale="en">English</a> | | |
<a href="#" class="lang-switch" data-locale="ru">Русский</a> | |
<h1 data-i18n="welcome"></h1> | |
<p id="messages"></p> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function() { | |
$.i18n().load({ | |
'en': { | |
'welcome': 'Welcome!', | |
} | |
'ru': { | |
'welcome': 'Добро пожаловать!', | |
} | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function() { | |
var update_texts = function() { $('body').i18n() }; | |
$.i18n().load({...}); | |
update_texts(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.i18n().load({ | |
'en': { | |
'welcome': 'Welcome!', | |
'message_from': '$1 has send you $2 {{plural:$2|message|messages}}. {{gender:$3|He|She}} is waiting for your response!' | |
}, | |
'ru': { | |
'welcome': 'Добро пожаловать!', | |
'message_from': '$1 {{gender:$3|отправил|отправила}} вам $2 {{plural:$2|сообщение|сообщения|сообщений}}. {{gender:$3|Он|Она}} ждёт вашего ответа!' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"dateFormats": { | |
"medium": "MMM d, y" | |
}, | |
"timeFormats": { | |
"medium": "h:mm:ss a" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"dateTimeFormats": { | |
"medium": "{1}, {0}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"currencies": { | |
"USD": { | |
"symbol": "$" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#earnings').text( | |
globalize.messageFormatter('earned')({ | |
amount: globalize.formatCurrency(500.5, 'USD'), | |
date: globalize.formatDate( new Date(), { | |
datetime: "medium" | |
}) | |
}) | |
) |