abritinthebay / datejs

DateJS: Evolved. An updated, bug fixed, and actively maintained continuation of DateJS
Other
354 stars 79 forks source link

exclude en-US localization from sources to allow flexibility #204

Open atus opened 10 years ago

atus commented 10 years ago

It would be nice to be able to customize the English like other languages. I would like to remove the short forms for yesterday yes and do other fixes, but I have to edit the source files which is a maintenance nightmare.

abritinthebay commented 10 years ago

Hmmm will think on this. There are other knock on issues that this would cause.

Can you elaborate on the fixes? I'm trying to not diverge from the original DateJS formats for v1.

It sounds like this might end up being a later milestone fix

atus commented 10 years ago

When parsed at 2014-05-02 13:45:00 I get this

I have no idea where it picks up the second one. These are the ones I discovered that bother me most because they are common words. The first one is an abbreviation of yesterday, but I think the second one is a bug. I will keep a list and write them here as I find more.

I can fix the first one and other abbreviations easily if I can edit the localization files, I just change the regex. Most of this is customizing it to fit my needs. E.g., I want to disable short forms by editing the regex instead of writing some crazy configuration for this :)

abritinthebay commented 10 years ago

wow, that "say" one is... weird.

One of the features I want to keep of the current system is that en-US is the default (and always present). I think it's becoming clear that the solution I had of making the keys the en-US ones is not very maintainable right now though.

Will have to rework that.

atus commented 10 years ago

I would use the keys from line 255 in i18n.js in all localization files and add rich documentation/comments to each localization file header or next to each key value pair to clearly state what is the purpose.

This way adding new keys and changing old values is easily done without maintenance. A nice thing I like is that I can skip a key and he simply assumes the English version.

abritinthebay commented 10 years ago

Right, that's a feature that having the key be the original key allows with a lot of simplicity. Would have to change the logic a bunch to fix that.

In general though I think it requires a rethink of how that is organized...