Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
the translated strings "Billing information" and "Shipping information" are not translated at the checkout-page and at "de/admin/commerce/config/checkout" but at "de/admin/commerce/customer-profiles/types" they are.
Worked fine in 1.1. Updated to 1.2 and installed shipping module. My customer will bite my head off :)
Comment | File | Size | Author |
---|---|---|---|
#86 | commerce_lang_repair.zip | 1.6 KB | haggins |
#54 | 1451132-54-translate-profile-labels.patch | 669 bytes | farald |
#29 | 1451132-translate-profile-labels.patch | 712 bytes | Jax |
#27 | 1451132-translate-profile-labels.patch | 748 bytes | Jax |
#21 | localized-customer-profile-label-1451132-21.patch | 1.27 KB | helior |
Comments
Comment #1
MickL CreditAttribution: MickL commentedsame for "Order total" at checkout page. The string is translated when editing the view.
Comment #2
MickL CreditAttribution: MickL commentedi found out that i needed to activate "field translations". it is already part of the internationalization module. now i could theoretically translate the strings Billing information and Shipping information BUT when I click on edit there is the field "english" (original text) instead of "german" (default language). When adding a third language (dutch) i COULD translate it into dutch but still not into german.
I created an issue for that with screenshots but maybe it is a problem of commerce?
http://drupal.org/node/1454360
The translation of "order total" is a duplicate of http://drupal.org/node/1121722 which is still not solved.
Comment #3
akalam CreditAttribution: akalam commentedSame problem, didn't work for me
After installing the "field translation" module I found the strings "Billing information" and "Shipping information" at translate interface.
But after translation, I see http://example.com/user/39/orders/77 with both strings untranslated
Comment #4
akalam CreditAttribution: akalam commentedSorry, I found it, it is not under translate interface, but if you go to:
http://example.com/admin/commerce/config/order/fields
and then to edit fields "Billing information" and "Shipping information" you will find a "translate" tab where to manage those strings!
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedI have the same issue..
I wrote this patch.. haven't tested it yet
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedwhoops...
wrong directory..
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThe (dutch) translation of "Billing information" is now working on my site.. so i would suggest the patch..
I haven't implemented the Commerce Shipping module yet.. so maybe one of you guys could test it for me..
The problem was that the original code used an untranslated instance label, where the profile type name should be used.
Comment #8
elmotri CreditAttribution: elmotri commentedWorks for me with billing and shipping.
Comment #9
MickL CreditAttribution: MickL commenteddoes it fix the problem? I attached a screenshot of the problem.
Comment #10
no2e CreditAttribution: no2e commentedThe patch by wbressers (#6) works for me, too.
Please commit this.
Comment #11
Ske CreditAttribution: Ske commentedThe patch works great for me but the same problem is on the view oders page. As example, "Billing information:" does not translate in user/1/orders/2. Have anyone a hint to find the right place to fix this?
Comment #12
dready2011 CreditAttribution: dready2011 commentedsubscribe
Comment #13
no2e CreditAttribution: no2e commentedIt is translated at my site.
But I don't know if it is translated because of the patch (#6) or if it worked before.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedI've noticed also similar translation issues on other parts of the commerce module..
i'll try to fix them as soon as i've found the time..
Comment #15
samuel.pismel CreditAttribution: samuel.pismel commentedwbressers maybe this can help you: #1454360: Field translation - only english ?!
Comment #16
tregismoreira CreditAttribution: tregismoreira commentedThe patch #6 works for "Billing information" label, but not for "Order total". :(
So, the patch #37 works fine for "Order total" string.
Comment #17
greenmother CreditAttribution: greenmother commented#6 works fine for me (for "Shipping information"), thanks
Comment #18
rszrama CreditAttribution: rszrama commentedLet's get a review in of this before 1.3. We'll need to reproduce the multi-lingual scenario before we can commit it, because a simple reading of the patch doesn't make it immediately obvious to me how this is fixing the problem. I would've expected us to want to preserve the old ordering. With the patch, it just appears to prioritize the name coming from the customer profile type itself, which I wouldn't have supposed would be translatable through the interface.
Comment #19
helior CreditAttribution: helior commentedfield_info_instance() does not return localized info, so it's not a reliable source for getting a localized label for the pane header. The documentation for hook_commerce_customer_profile_type_info() specifies that the "name" key should be translatable, so taking preference to this info is the right direction.
Comment #20
rszrama CreditAttribution: rszrama commentedAhh, I must have taken the red herring about field translation up above. I suppose that's what was needed for other parts of the interface but that that wasn't sufficient for the checkout form. The thing is... $profile_type['name'] will never turn up empty. It's a required parameter of customer profile types, so we'll never have a fallback to the instance label. I'm wondering what we should do about that.
For example, right now on a single language website, I can go change the label of the customer profile reference field on the order to anything else and have that appear as the title of the checkout pane. This patch will remove that possibility, because the name of the profile type will always be used.
Perhaps we just need an extra bit of optional integration to the field translation module to pick the language specific instance label if it exists. I feel like we're doing that elsewhere in the code... ahh, for attribute field options in the Cart module (grep the source for i18n to see where).
Moving back to needs work, as this is a feature regression as is.
Comment #21
helior CreditAttribution: helior commentedMakes sense. i18n_field integration added - best of both worlds :)
Comment #22
rszrama CreditAttribution: rszrama commentedHuzzah! With the patch applied, I was able to translate "Billing information" to "Informations de facturation" in the Translate interface for field labels and have it show up just fine when visiting /fr/checkout/[order-id]. Committing #21, which is dependent on i18n_field.
Comment #24
Summit CreditAttribution: Summit commentedHi,
This patch works great.
For documentation purposes:
1)
You have to go to this page admin/config/regional/i18n/strings
And set the language to english..than the translation strings can be made to your language.
2)
You need to go to admin/config/regional/translate/i18n_string and enable
3)
Then the fields are between the normal translation page to be able to translate: admin/config/regional/translate/translate
4)
After adding translation and nothing showing, back to admin/config/regional/translate/i18n_string
Enable Fields and click REFRESH.
Greetings, Martijn
Comment #25
Jax CreditAttribution: Jax commentedThe label is escaped twice. Try to translate the shipping information label to: "Données d'expédition" and you will see the html entity in the fieldset legend. Should I reopen this ticket or create a new one?
Comment #26
Jax CreditAttribution: Jax commentedIt's the check_plain that is too much for the title. The title will be escaped again when it is rendered.
Comment #27
Jax CreditAttribution: Jax commentedAnd the patch.
Comment #29
Jax CreditAttribution: Jax commentedPatch against HEAD instead of 1.3.
Comment #30
vasikeAll this translations could be achieved just by using Field translation (i18n_field) module from i18n package.
No patch needed.
I am using Drupal Commerce 7.x-1.3 and i18n 7.x-1.5
p.s. : without Field translation (i18n_field) module i am not able to have the translations.
Comment #31
FAAREIA CreditAttribution: FAAREIA commentedI think the translation should be done by core modules OR i18n module. I have only 1 language and i won't install a complex module to translate one string, it has no sense.
Comment #32
rszrama CreditAttribution: rszrama commentedHey Jax, I can't commit the patch as is, because for untranslated fields you actually don't get sanitization on the instance label. For example, I was able to execute JavaScript if I just added it to the instance label on a single language site. I'm happy to update the code so that we only sanitize the label for output if translation does not occur, but I'm actually at a loss to know why this is being sanitized in the first place. When I follow the code through for field translation, it looks like sanitization should be off by default. Do you have any insight there? I'd hate to just always assume translated instance labels are sanitized and open up a security hole.
Comment #33
Jax CreditAttribution: Jax commentedSometimes sanitized and sometimes not? That isn't very practical. I'll try to find time to have a look at that this week.
Comment #34
rszrama CreditAttribution: rszrama commentedYeah, it really is odd. And really I can't figure out why i18n_field is sanitizing when by all appearances it sets sanitize => FALSE by default for object translation. : ?
Comment #35
ntigh52 CreditAttribution: ntigh52 commentedI found that if on admin/commerce/config/checkout/form/pane/customer_profile_billing
I chenge the Checkout pane configuration -> Related customer profile reference field -> -None-
then the "Billing information" fieldset display translate.
I want to Related customer profile reference field to Billing information but ....
Hopes will help anything.
Thanks
Comment #36
vasikei think this issue is (very) related with #1121722: Improve DX of instance translation issue, if not they are the same.
Comment #37
quiptime CreditAttribution: quiptime commentedTranslate "Billing information", "Shipping information" and "Order total" is possible and works.
But,
the problem is the missing documentation to do this.
Comment #38
AdamGerthel CreditAttribution: AdamGerthel commentedSo, how do you translate it? Using i18n is not an option for me because the website only has one language. Installing such a huge package just for this is insane.
Comment #39
quiptime CreditAttribution: quiptime commentedExactly that is the problem.
Needed modules:
Entity Translation
Field translation (i18n part module)
Comment #40
FAAREIA CreditAttribution: FAAREIA commented@AdamGerthel. I have the same issue, i will not install i18n for two words. Try patch #6, it works for me, but i think it's not te correct way to go.
Comment #41
DuaelFr#29 works for me but I agree it is a bit overkill
Comment #42
rszrama CreditAttribution: rszrama commentedThe patch in #29 is insecure per my comments in #32.
Comment #43
DuaelFrYou are right but it is a moderated security flaw because specific permissions are needed to exploit it.
Actually, only my user#1 can access this settings so I prefer something working instead of an untranslated string on my client's website :/
Comment #44
AdamGerthel CreditAttribution: AdamGerthel commentedSo... Is there a temporary workaround? Having mixed languages in the checkout is very likely to scare customers off.
Comment #45
rszrama CreditAttribution: rszrama commentedI'm not particularly interested in committing a half solution, so honestly this just needs to be pursued through i18n as described in my comments above.
Comment #46
corbin CreditAttribution: corbin commented... one more with the "or" at the foot of each page of the checkout;
a good idea if you can't sleep : open your favorite editor and try to find "or" in kickout ;oD !
i mean :-((((
Comment #47
FAAREIA CreditAttribution: FAAREIA commentedyeah...'or' word is a pain. it's redundant, since there are two buttons, one next to the other.
cleanup =)
Comment #48
corbin CreditAttribution: corbin commentedi'd like to clean it up .. but where is it ?!
Comment #49
rszrama CreditAttribution: rszrama commentedThe "or" comes from commerce_checkout.pages.inc and was included to imitate other checkout systems (such as Shopify). That said, it's fully translatable through the normal translation interface and is not related to this issue. Additionally, there's a separate issue that will wrap that "or" in a class so it's easily themed out, and in the meantime it can just be form altered out. ; )
And again, all this issue needs is for my someone to research the lead I give in comment 32. None of the comments have changed anything since then.
Comment #50
golubovicm CreditAttribution: golubovicm commentedComment #24 works fine for me. Try it before applying any patch.
Comment #51
farald CreditAttribution: farald commentedIf you just want to quick-fix the translation on checkout, you can do this:
Much more lightweight than adding a bunch of modules :)
Comment #52
yatil CreditAttribution: yatil commentedI used the solution in #51 and added a translation for 'Order total' also. Probably there are better ways to handle this, but it does the job. Just add the following to your
template.php
file:Comment #53
FiNeX CreditAttribution: FiNeX commentedBoth #51 and #52 only fix commerce checkout forms (btw, #52 works fine), but the translation should be done on review page too.
Comment #54
farald CreditAttribution: farald commentedIf we need the check_plain, how about just adding a t() ?
Comment #55
rszrama CreditAttribution: rszrama commentedt() cannot be used to wrap variables, as we have to point out in every issue dealing with internationalization at some point in time. : P
It can only wrap string literals per its documentation.
Comment #56
farald CreditAttribution: farald commentedD'oh! Of course! :)
Comment #57
kaido.toomingas CreditAttribution: kaido.toomingas commentedI just made a little module based on #52. https://github.com/kaido24/commerce_lang_repair . Its really only copy paste but its much better than use this as a theme function..
Comment #58
farald CreditAttribution: farald commentedThe easiest for single-language sites is to :
Problem solved.
Comment #59
OlafskiThanks for your module, kaido24! It's really helpful as I don't want to use i18n. Commerce Language Repair works well during checkout but it doesn't seem to affect admin order pages like admin/commerce/orders/1. Do you intend to support the translations there, too?
Comment #60
kaido.toomingas CreditAttribution: kaido.toomingas commentedShort answer is no.. I just dont have to time and motivation at this point. But if someone tracks this variable down then I can do it.
Comment #61
ram4nd CreditAttribution: ram4nd commented#54 worked for me, thank you
Comment #62
Anonymous (not verified) CreditAttribution: Anonymous commented@Summit thanks for your instructions in #24 - saved me a lot of time!
Comment #63
astutonetThe Order total and others solved by instructions in #24. This saved me a lot of time too.
But when a try to translate expressions like as
I receive a message of error, saying that expression have HTML not allowed.
Any ideas?
Comment #64
ntigh52 CreditAttribution: ntigh52 commentedmaybe is helping?!
Comment #65
astutonet@ntigh52, tks to the answer.
Are you saying me to "try to clear language field in action that sending message."?
I tried to do this, but nothing. Can you help me? How you did this?
Tks
Comment #66
ntigh52 CreditAttribution: ntigh52 commentedwhere do you try to translate this line?!
rules?!
translateion window?!?!
Comment #67
astutonet@ntigh, ok.
To translate this, access admin/commerce/config/checkout/form/pane/checkout_completion_message
Tks
Comment #68
candelas CreditAttribution: candelas commentedthanks :)
Comment #69
steveoriolThe above tips work well for the translation of "Billing Information" and "Shipping Information" in the background processes of payment, but in pages like :
"user/xxx/invoices/xxx" or "user/xxx/orders/xxx" or "admin/commerce/orders/xxxx/view"
, translation does not work ... :-(
Comment #70
gianfrasoft CreditAttribution: gianfrasoft commented#57 is the solution for me. Well done, @kaido24. I say "If Mohammed will not go to the mountain, the mountain must come to Mohammed".
Thank you.
Comment #71
gianfrasoft CreditAttribution: gianfrasoft commented... But #57 doesn't translate "Order total" on Shopping Cart Summary:
user/X/orders/Y
Comment #72
kaido.toomingas CreditAttribution: kaido.toomingas commentedYes its only for this one form.. And its not really the right way to do it.. If you dont find better solution you can pm me and we will find some solution..
Comment #73
gianfrasoft CreditAttribution: gianfrasoft commentedOk, as a temporary solution I changed fields' label in order type's page:
admin/commerce/config/order/fields
This way I changed "Billing informations" label only.
The definitive solution is, I think, installing Internationalization module but I'll not do it because my site is shown in one only language.
Hope this helps...
Comment #74
gianfrasoft CreditAttribution: gianfrasoft commentedAnd for "Order Total" label in order's detail I used this patch:
http://drupal.org/node/1776644#comment-7372464
Hope this helps, too.
Bye.
Comment #75
bojanz CreditAttribution: bojanz commentedThere is nothing more to be done.
I have tested translation with i18n_field 1.8, could translate everything (billing information, order total, etc), and had no double-escaping problems.
Since the original report of that is a year old and there have been i18n releases in the meantime, I am assuming that got fixed.
(Especially since I have confirmed that the code is explicit about requesting non-sanitized strings).
You will always need i18n_string and i18n_field to fully translate a Drupal 7 site, Commerce or no Commerce.
Comment #76
gianfrasoft CreditAttribution: gianfrasoft commentedNono, this isn't true!
I Made dozens of drupal sites in my home language: italian, and I always used only locate module without Internationalization module.
Mine are not multilanguage sites but I have to translate everything the same. I can't install a so big module (i18n and some submodules) to translate 1 or 2 strings! Do you agree?
Comment #77
rszrama CreditAttribution: rszrama commentedI suppose the question is how are you translating field labels and option values apart from i18n?
Comment #78
bojanz CreditAttribution: bojanz commentedThere is no way to translate a field instance label, help text, allowed values without i18n.
The Commerce team can't fix D7's multilingual problems. This is just the way it is. Feel free to help D8 become better (it already is, by a long shot).
i18n_string and i18n_field are relatively small modules (other i18n modules can remain disabled, and they are not enabled or installed), so I'm not accepting that as an argument.
Comment #79
gianfrasoft CreditAttribution: gianfrasoft commentedAny module have to process any string and label by using t() function. So I don't need any i18n module in my translation activity, only locale module is the module I need.
If I have to install i18n to translate commerce module's string, there is something wrong in commerce module, I think...
Comment #80
zambrey CreditAttribution: zambrey commentedI have to agree with gianfrasoft about installing i18n module for one-language site.
It's just too much for translating few strings.
I'm using this little function to change field labels:
Maybe someone will find this useful. Cheers.
Comment #81
bojanz CreditAttribution: bojanz commentedYou are free to ask any drupal core developer and / or multilingual expert (Gabor Hojtsy, for example) for a second opinion, and you will get the same reply.
Drupal's locale module can't translate a field instance title (such as "Billing information"). Hence, i18n_field.
This is my last reply on this subject.
Comment #82
kloewer CreditAttribution: kloewer commented#24 does the trick!
Comment #84
webxtor CreditAttribution: webxtor commentedThanks, this (#24) helped me to solve my translation issues without any source codes alteration!
Comment #85
sw3b CreditAttribution: sw3b commentedFor me #58 solve my probleme... thanks !
Comment #86
haggins CreditAttribution: haggins commented#57 is working fine. However, it misses
Order total
on the review form.I also cleared the code so that it uses
$form_id
instead of$form['#id']
.Another issue with that fix was, that it replaces all occurences of
Order total
of the whole cart table - including product titles. As the shop sells event tickets and some bands may have crazy names, I won't bet on that this string doesn't occur in any title ;)So I search and replace
Order total</td>
instead.Attached is the updated helper module.
Comment #87
AnybodyI can confirm that there is still a problem with this. I've installed DC in my German site (using i18n and co) and "Source Language" was set to "German".
The problem is, that the fields are locked and the imported Text "Billing information" / "Order total" are used as German(!) translated field titles that are not editable!
Even "Translation Table" did not help here, which is normally very helpful for these cases.
Only solution was to translate the binary field in the database...
Comment #88
gianfrasoft CreditAttribution: gianfrasoft commentedYou have to translate some commerce views, too...
Comment #89
AnybodyI did what was possible, but that's not possible for the fields named above, because they are not editable in the views. "Order total" is part of a fixed output in the views footer - without customization possible (or am I wrong?)
"Billing information" is a not a view, but a field in the checkout. Same problem as described above. But perhaps this is not a real DC problem, but a general problem in Drupal translation. My point was firstofall to describe the steps to reproduce this problem!
Comment #90
a.milkovskyThis is the work around how to get translatable titles for panes:
If you want to get all the titles translated you can use this code:
Comment #91
dotoree CreditAttribution: dotoree commentedIn order to translate 'Order total' you can use the theme function from commerce.price module:
In order to translate Shipping, billing and order total in forms you can use this code:
Comment #92
semanthis CreditAttribution: semanthis commentedthis problem still exists. I have a DC-Installation in German language, I defenetly do not want to install i18n just to translate one single string. By the way, maby you'd like to use commerce for other purposes then selling products, so it would be smart to have a opportunity to change the lable, either in the pane-settings or in the view. I belive this is more then a just a translation issue.
Comment #93
MyriamB CreditAttribution: MyriamB commented#91 second code worked perfectly for me, thank you! I implemented it into a custom module instead of my theme.
Comment #94
odw_calvin CreditAttribution: odw_calvin commented#4 worked well for my "shipping information" translation.
Comment #95
Cyclodex CreditAttribution: Cyclodex commentedIt looks one can not even change the title after you created it once yes ?
Thanks to #91 which solves the problem for now. I can translate the strings now or change it.
Comment #96
kpatsali CreditAttribution: kpatsali commented#91 works for translating Order total label on commerce Shopping cart
Thank you soooooooooooo much
Comment #97
Damien Tournoud CreditAttribution: Damien Tournoud commentedDrupal Commerce is fully translatable, and committed to stay that way.
Translating field labels (like "Billing information" and "Shipping information") in Drupal (and Drupal Commerce) simply requires the
i18n_field
module, part of the i18n package.No crazy hacks are necessary. Locking this issue for future reference.
Comment #98
dmegatool CreditAttribution: dmegatool commentedDamien Tournoud is right. I installed the i18n_field module and could translate the missing strings just fine.
Comment #99
dmegatool CreditAttribution: dmegatool commentedAnd set the source language as english in internationalisation : admin/config/regional/i18n/strings
Comment #100
kerios83 CreditAttribution: kerios83 commentedcause of https://www.drupal.org/node/2227523 do not use i18n-7.x-1.11, try the dev version instead.
Comment #101
PhilYSorry for reopeng the issue but I'd like to contribute to comment #91 second code for anyone using the Commerce Addressbook module as shipping and billing titles are not translated neither.
All needed is to insert the following code inside the hook_form_alter function:
so the full function is (as per comment #91, second code):