-
Notifications
You must be signed in to change notification settings - Fork 107
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
No translation for timestamps with ISO 8601 #76
Comments
Comment by fburatti When I used Mqtranslate, the ideal setting for the dates in my themes was "Use strftime instead of date formats and replace with the predefined formats for each language." Now with Qtranslate-x seems more compatible "Use emulated date function".
|
Comment by johnclause Hi guys, could you test the latest version from GitHub? It has some changes in date/time functions, but I am not sure it they would address this problem. |
Comment by fburatti Hi John, in a fresh install, I can confirm that |
Comment by johnclause Thank you, @filippo, I guess we can close this one then? You can still write to closed issue and we can re-open it again if needed. |
Comment by felixwerner on both versions i still have the same problem when using get_the_date( 'c' ). crawling through the plugin files i found this function qtranxf_convertFormat() which has a exception for this would be especially useful for other plugins like yoast seo which are using for meta fields ISO timestamps with get_the_date( 'c' ) |
Comment by johnclause @felixwerner: the date/time code of former qTranslate almost never got updated and apparently quite obsolete by now. There must be a better way of doing the whole thing by now in a more native way. Do you understand PHP code? Would you mind to take a lead to find out the best way and to implement it? |
Comment by johnclause @felixwerner: Please, help me to understand how it is supposed to work, I never paid close attention to date/time conversions so far. Do you mean by "emulated date with language translation" the choice "Use emulated date function and replace formats with the predefined formats for each language."? If this is so, then 'c' will be overridden with what you have in the field "Date Format" of language configuration, and then it worked correctly in my test. Is this how it should be? |
Comment by felixwerner yes if using the 'Use emulated date function and replace formats with the predefined formats for each language.' the 'c' will be overridden with general language date settings if('c'==$format) return qtranxf_convertDateFormatToStrftimeFormat($format); it seems to work now if this line is added the 'c' date will show correctly. |
Comment by johnclause I believe, exception for 'U' is there because 'U' basically means unformatted, raw format, so it stays raw in any case. But 'c' would not fit this logic. Why do you need exception, could not you use "Use emulated date function" option without override, if you provide your own format? |
Comment by johnclause In fact it seems that there are 4 special formats, which may not need to be converted: 'Z', 'c', 'r' and 'U'. I do not really know how it should be, I did not designed this thing, and I am pretty sure there is a better WP standardized way by now. Please, help me to design it, if you have knowledge on how WP now expects to do date time localization. |
Comment by johnclause I added exceptions language-neutral formats exceptions ( 'Z', 'c', 'r', 'U') to the |
Comment by fburatti I was trying the beta version 3.8 but then you have already published the 3.9! |
Comment by johnclause Thank you, @fburatti, 3.2.9 is the same as 3.2.8, I just increased the number, so that when people update the release, it would not mix with development version. Thanks a lot for your testing, if you found something I would do another release right away ;) I guess, we can close this issue. We can still write to closed issue and may reopen it later if needed. |
Issue by felixwerner
Wednesday Mar 11, 2015 at 22:01 GMT
Originally opened as qTranslate-Team/qtranslate-x#76
timestamps are translated if time format convert function is turned on.
a exception in the qtranxf_convertFormat() function would be great for iso timestamps if using get_the_date('c')
The text was updated successfully, but these errors were encountered: