Closed (cannot reproduce)
Project:
Address Field
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2012 at 01:48 UTC
Updated:
11 Jan 2017 at 14:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
j0rd commentedLooking for this as well. Any progress or plans?
Comment #2
kojow7 commented+1
Comment #3
g10 commentedtranslation of country values on node view w/ patch in attachment
(does not changes the dropdown values, only part of fix)
Comment #4
rv0 commentedstrangely, the list of countries comes from iso.inc
http://api.drupal.org/api/drupal/includes%21iso.inc/function/_country_ge...
where it is already prepended with $t().
this might need another type of fix.
Comment #5
frank.schram commentedIs there a plan to fix this definately?
It is really a pain that the dropdown list of the countries is not getting translated.
Comment #6
owenwilliams commentedAny updates on this? Really need it
Comment #7
kumkum29 commentedHello,
i have the same problem on a multilingual site (french/english). The countries list on the node edit page is French. The name of country is french on the view node in english and french pages.
Thanks.
Comment #8
Anonymous (not verified) commentedfor multilingual drupal site I would also like to have the possibility to offer the names of countries in the language chosen by the user.
I also need to sort the records in the view by country name in the language:
USA (english) or Etats-Unis (french) brings a totally different ordering of the records
Comment #9
frank.schram commentedAny plans to fix this? this is really annoying.
I also have the issue in 7.x-1.0-beta5, even when displaying the content, the countries don't get translated.
Comment #10
frank.schram commentedComment #11
le72Any update?
Comment #12
estebant commentedApart from using #3...
In order to translate the dropdown values, add the following code to the function
function _addressfield_country_options_list($field = NULL, $instance = NULL)
(in addressfield.module)
Comment #13
jansete commented#12 works for me :P
Comment #14
firfin commentedManually applying patch works for me on addressfield version 1.0-beta5
Will make a patch for dev version ASAP. Probably this weekend.
Comment #15
hosais commented@firfin
Waht do you mean? #13 or #3 (the patch file) works for you?
Thanks
hosais
Comment #16
bojanz commentedYou can't pass a variable for t(), so a real fix would definitely need to be somewhere else.
Comment #17
estebant commented@bojanz, I works perfectly passing the variable to t() ;-)
Comment #18
hosais commentedHello estebant,
Thank you for the idea of fix this problem. I just would like to clarify the issue here:
In the API it says
t($text);
, unless the text that the variable holds has been passed through t() elsewhere (e.g., $text is one of several translated literal strings in an array). It is especially important never to call.
I think the countries names has been translated of course, but I am not sure how can I be sure of that. Could you help explain more? Thanks.
hosais
Comment #19
estebant commentedHello hosais,
I don't know what to respond you. I made this workaround some time ago and it worked well.
And I do not know why it should not do it. You are free to use it or find another solution :)
Comment #20
hosais commentedHi estebant,
First of all, thank you for your work and I suppose the solution works because the name of countries definitely should be translated already.
However, on the other hand, the t() should not has variable as parameter because the translators need to know What to translate BEFORE the t() is called. If the content is dynamic, how can the translators translate the terms before it is called. That is there is no guarantee the text would be translated correctly every time.
In theory, in my mind (I did not trace the code about how t() is working), I suppose there is no risk in this case. If t() did not find the translation info, it just not translate it. Also in this case there is nothing saved to the database (I mean the address field itself). I mention this because I try to be supportive to clarify the right thing to do. On the other hand, I am very cautious to the patches/code modification since I will put it to my production site.
I really appreciate that you gave me your opinion as a contributor. Thank you again.
hosais
Comment #21
estebant commentedYou are welcome mate!
Comment #22
adam1 commentedhello,
i am glad having found this thread. problem is, i tried to apply patch #3 in the recent module version 1.2 and the recent dev version also, but this error was thrown out:
Since i am not coding-savvy, if someone could update the patch, i would be much obliged.
Comment #23
markdcIs this issue old? Because translation works perfectly fine for me out of the box. I'm running this module on an English/German website, and I see the German names of countries when translating content. However, I'm not using core content translation, rather field translation through the Entity Translation module.
Comment #24
firfin commentedSeems to work now.