-
Notifications
You must be signed in to change notification settings - Fork 147
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
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".
|
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. |
Hi John, in a fresh install, I can confirm that |
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. |
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' ) |
@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? |
@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? |
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. |
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? |
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. |
I added exceptions language-neutral formats exceptions ( 'Z', 'c', 'r', 'U') to the |
I was trying the beta version 3.8 but then you have already published the 3.9! |
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. |
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: