Open
Description
I'd like to be able to switch locales dynamically at client-side if possible. Would it be possible to store the locale settings in hashes, like this (adapted from the fr locale):
// French
jQuery.timeago.settings.strings['fr'] = {
// environ ~= about, it's optional
prefixAgo: "il y a",
prefixFromNow: "d'ici",
seconds: "moins d'une minute",
minute: "environ une minute",
minutes: "environ %d minutes",
hour: "environ une heure",
hours: "environ %d heures",
day: "environ un jour",
days: "environ %d jours",
month: "environ un mois",
months: "environ %d mois",
year: "un an",
years: "%d ans"
};
This would enable multiple locales to be pulled in at once and selected by using jQuery.timeago.settings.strings = jQuery.timeago.settings.strings['fr'];
rather than by overriding jQuery.timeago.settings.strings
by pulling in an additional locale file (which either necessitates an additional HTTP request or some server side locale switching).
I'm happy to put together a PR with tests if there is any demand for this.
Metadata
Metadata
Assignees
Labels
No labels