-
-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
I really like this functionality. A lot. Thanks for taking the time to put this together. i18n is not my strong point. It's important to take a second to note that as written, this is a pretty big shift in philosophy. Right now, whatever the author puts in the from or to box appears on the front end as is. Gives the plugin ownership of that output. Think about the possible inputs:
All but the last will be parsed by As for "Estimated", again, what if I want "Anticipated" or "Expected" or "Planned" (or nothing)? Here's my thinking: Merge the pull request with the intention of beefing up the API calls in Also, noticed a few strings that need to be given translation support which I can take care of.. |
Added initial support for qTranslate handing of position start/end dates props Fale
About the 5 cases: one and four should be fine ;). For the other 3, I'm thinking ;). About the "Estimated", "Anticipated", "Expected" or "Planned" is possible to add those words. If you put I was thinking about a flag in the "option" page. Something like "Auto-fix dates (suggested for internationalization)". |
I took a stab at the problem in 2c0d510. If possible, I'd prefer to make a decision, rather than an option, or at the very least, let the software make the decision. Here's my suggestion: If qTranslate isn't installed (or the user hasn't forced translation via the api hook), date is simply passed through If they do want translation, the I added two additional properties (and associated filters). Also, before stable, will make a note to memorialize all this in the FAQ, so per your suggestion, users know they can use the "May 2011 (Expected)" format to bypass this whole process. Beyond that, just did a bit of code cleanup/simplification, and allowed either from or to to be optional (and still translate). Give it a try and let me know if it works with qTranslate as expected? |
I tried it with qTranslate and it does print the strings as I gave them to it. :( |
Editing a position the following error is returned: |
Hi,
Fabio On Mon, Feb 13, 2012 at 11:46 PM, Benjamin J. Balter
Fabio Alessandro Locati Home: Segrate, Milan, Italy (GMT +1) PGP Fingerprint: 5525 8555 213C 19EB 25F2 A047 2AD2 BE67 0F01 CA61 Involved in: KDE, OpenStreetMap, Ubuntu, Wikimedia |
Sorry about the sloppy code. Promise to test more thoroughly next time before I commit. :) I believe I fixed the "Expected" feature. Just a typo in the method name. The whole API class is designed to force me to consistently prefix filters (previously some were resume, some were wp_resume, etc.). You should be able to just pass the filter name (e.g., "date"), and it will actually run ("wp_resume_date"). I added the translation filter to resume_date (not wp_resume_date), which should be fixed now. I opened issue #7 to deal with hResume and non-parsable dates. I'll have to check the spec, but thoughts on what should be outputted? |
With this changes, dates are managed directly by the system. This way is possible to manage them in an automatic way through the different languages :).
If a date is recognizable by strtotime() the strtotime() output will be used. Otherwise the user string will be used. If the first option is used, it will be automatically internationalized based on the blog/qtranslate options.
If a date is in the future, automatically will be add "(estimated)". This string can be translated with the lang system.
If the ending date is not yet known, is possible to use "present" (case insensitive). In this case, "Present" will be shown and translated, if needed.