I activated the drupal locale module and imported the italian po file but date.module dates aren't translated. How can this be done? Do I have to translate every string manually from drupal interface?
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | date.inc__0.txt | 74.44 KB | karens |
| #16 | date.inc_.txt | 73.68 KB | karens |
Comments
Comment #1
dodorama commentedI tried to extract a pot file from date.module files but there are not strings to translate months, weeks, days.
So I think this must be a kind of bug(or missing feature) since date releated to post submission are translated.
P.S.
while extracting the pot files with extractor.php I had this errors:
Comment #2
dodorama commentedI mark this as a bug since, I guess, there must be something wrong on those strings I mention above.
Comment #3
dodorama commentedThis must be the problem.
I try to solve it by myself then I'll come back here asking for help :)
Comment #4
dodorama commentedI haven't been able to solve this.
Any help?
Comment #5
karens commentedI think maybe the translate function won't work on variables like this. I'm no expert on how that function works, though. If anyone knows the best way to set this up I'll be glad to make the changes.
Comment #6
dodorama commentedis it possible to use the translate function while creating the array?
Comment #7
dodorama commenteddigging to the code I haven't been able to understand how to solve this;
but I found another way to have dates translated. I used the translate (t) function in my template (node-content_mycontent.tpl.php) like this (just in case someone want to use this trick):
Comment #8
karens commentedShould be fixed now.
Comment #9
dodorama commentedThe strings to translate months and days are now avaiable for translation but once translated only the strings on the input form are translated (not the output in the node view).
P.S. there's still an error when extracting the po file from date_views.inc :
Comment #10
karens commentedfixed the last translation error in the latest commit
Comment #11
svendecabooterThe day texts still don't get updated here...
I installed the 4.7-dev version, but the fields keep displaying "Mon, Tue, Wed", where i want these to be local.
When editing the field, the dropdown boxes also show the english names of the days, even though my locale is set to Dutch as standard setting.
What can be the cause why this isn't working yet?
Comment #12
vito_swat commentedI have the same problem with 5.x version. Dates in the output aren't translated. In my opinion problem is in date.inc in function date_show_date which is responsible for the output string. I made following changes in the code, using default drupal format_date function:
For my case (I only need month and year) it seems to work. Gimme a feedback is it working for you.
Comment #13
dodorama commentedComment #14
karens commentedI'm going to try to work on this today. The last suggestion will break many things, so don't use that.
This thread is getting hard to follow. Can you summarize exactly where you are now getting values that are not translated in forms, on the node display and wherever else you see them.
Comment #15
dodorama commentedDate strings aren't translated on node display.
Date strings are translated on the input form.
Comment #16
karens commentedThe problem is that those dates are coming from the php date format function so they don't behave the way translation normally works. I'm posting a file for you to try as a replacement for the date.inc file to see if it works for you. I don't want to commit anything until I see if this approach will work.
This is the 4.7 version, since that's the way this issue is marked.
I had to rename the file to date.inc.txt to get it to upload, but change the name back.
Comment #17
karens commentedAnd here's a file with a different approach. Same thing, use this as a replacement to date.inc and rename it.
Let me know which works better.
Comment #18
dodorama commentedIs this for drupal 5?
both patches cause a fatal error on 5:
Call to undefined function: module_exist() in /home/yuppiefl/public_html/cms/sites/all/modules/date/date.inc on line 41
I'll try with 4.7
Comment #19
dodorama commentedthe second patch works great!
Comment #20
karens commentedNo, as noted in #16 this is the 4.7 version since this issue is marked as a 4.7 issue.
Anyway, I don't think the first method is going to work right, so the second is the one I'm going to try. It doesn't seem to break anything in English and at least theoretically should work for other languages.
Committed in all branches.
Comment #21
karens commentedOops, cross-posted, but that confirms what I thought.
Comment #22
peddecke commentedCan you make a patch for 5.x too? Thanks!
Comment #23
karens commentedThis was committed to all branches, no patch needed. You just need the latest nightly snapshot (-dev) release.
Comment #24
(not verified) commented