xdate icon indicating copy to clipboard operation
xdate copied to clipboard

I18N support

Open c9s opened this issue 13 years ago • 5 comments

Hi,

does this library support i18n ? or any way to define i18n texts?

c9s avatar Feb 29 '12 08:02 c9s

It looks like you can pass a locale definition in toString(). Search for "January" in the source code to see an example of the JSON object format for a locale.

You could save some CPU by extending that existing array/map that only has one element for the default '' key, then you should be able to just pass the key to the toString(), rather than the whole JSON mess. (The docs hint at that... I haven't tried it.)

janicki avatar Aug 17 '12 02:08 janicki

above pull request #17 implements es

arshaw avatar Mar 31 '13 01:03 arshaw

@janicki, currently, you can just pass in the key (like '' or hypothetically 'es') and it will work. The method argument is settings but is overloaded to support object or string.

arshaw avatar Mar 31 '13 01:03 arshaw

@c9s, you are correct, XDate is very lacking on the i18n and it should ideally have a load of external JS files, each specifying it's own settings.

arshaw avatar Mar 31 '13 01:03 arshaw

This would be a great feature for the roadmap.

elisechant avatar Jan 02 '20 04:01 elisechant