-
Notifications
You must be signed in to change notification settings - Fork 1k
Support for localization of AM/PM #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…has support for this thing, but it is obviously localized.
Ok, I like your changes! Thanks! Only thing I notice right off is around line 680 we will need to force toLowerCase() on all lower case t's. I would say it should be in the localization, but it would be much more convenient and backwards compatible to change the timeFormat. So, I guess like you defaulted will be upper case. |
Also if you could possibly issue your pull request for the dev branch? Trent |
Regarding to case: in English there is AM/PM ... in czech we use lower case form dop./odp., so I tried to find all case conversions and removed them. But there might be some corner case where it would cause a problem? But seeing uppercased ODP./DOP. would not look like natural for Czech people. I try to make pull request to the dev branch as soon as I found out how to do it. I'm a newbie in Git. |
It is possible in English to see AM/PM, am/pm, A/P, or a/p. I would say AM/PM is the correct/formal way, however its not uncommon to see it other ways, in more informal situations. So possibly we can place the "formal" way in the localization file, and use "TT" to leave it the formal way (upper case, lower case, etc.. which ever is formal). Then we can specify lower case.
This should leave it lower case for "TT" and for "tt" for Czech as long as in the localization file you set it as lower case. So TT would always represent exactly how it is in the localization file. |
I'm also working for the localized AM/PM markers to integrate with Trac - http://trac.edgewall.org/ticket/10245. jun66j5/jQuery-Timepicker-Addon@trentrichardson:dev...jun66j5:l10n-ampm |
Hey jun66j5, What is the status of your changes? This looks to be a thorough update of the AM/PM structure. |
The work is almost done, excepted default AM/PM markers to show. When a picker show the selected datetime, it uses the first entry of Then I think that the first entry should be "AM"/"PM". diff --git a/localization/jquery-ui-timepicker-cs.js b/localization/jquery-ui-timepicker-cs.js
index 74ef405..e02534b 100644
--- a/localization/jquery-ui-timepicker-cs.js
+++ b/localization/jquery-ui-timepicker-cs.js
@@ -12,8 +12,8 @@
currentText: 'Nyní',
closeText: 'Zavřít',
timeFormat: 'h:m',
- amNames: ['dop.', 'AM', 'A'],
- pmNames: ['odp.', 'PM', 'P'],
+ amNames: ['AM', 'A', 'dop.'],
+ pmNames: ['PM', 'P', 'odp.'],
ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['cs']); Thoughts? |
Should I invest time into the merging my changes into the dev when jun66j5 has more in-depth implementation then? I'am not sure I understand the logic well - but according to this implementation there are multiple abbreviations available for certain languages - for czech dop. either as AM could be used (I do not have use-case for that, but jun66j5 probably has?). Do I get it right? Primary abbreviation should be of course localized one - ie. dop. in this case. More than that it is necessary to consider character cases - as multiple combinations are allowed in English. This gets really a bit complicated at the end. |
Right, I think that the picker should parse
Ok. In the my current changes, primary abbr is localized one. I will not modify the code any more. |
Ok, I've merged the changes by jun66j5. Thanks both for your contributions! |
In czech language we are supporting AM/PM, but we have localized strings "dop." and "odp." for such thing. This is even supported by Java language (and probably others) for formatting and parsing purposes. I tried to add similar support in this patch for the timepicker addon.