Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The term names that are shown in a list are not translated. To do this you will need to integrate with i18n_taxonomy if enabled. Attached patch is based on a similar issue in the hierarchical select module issue queue and has thus been tested there and now also here by me.
Comment | File | Size | Author |
---|---|---|---|
#8 | translate_term_options-1264264-8.patch | 590 bytes | mcgowanm |
#2 | translate_term_options-1264264-2.patch | 914 bytes | mmartinov |
#1 | translate_term_options-1264264.patch | 894 bytes | mmartinov |
translate_term_options.patch | 702 bytes | fietserwin |
Comments
Comment #1
mmartinov CreditAttribution: mmartinov commentedThanks for the effort! i18n is a good feature.
I was going to mark your patch "needs work" as it is not correct in many aspects, but it's a simple change in a simple module so I've did the work myself. I'm attaching my patch bellow, please review and test if you have the possibility.
A few notes Re: your patch.
- It was not generated with "git diff" command, so I was not able to apply it, please take a look here how to create patches: http://drupal.org/project/webform_term_opts/git-instructions
- The version of this issue and the patch should be against 7.x-1.x-dev, not 1.0
-
$prefix = $flat ? str_repeat('-', $term->depth) : '';
- This line is against the logic of the code, should be the opposite.-
t($term->name)
- This is not a good idea.Comment #2
mmartinov CreditAttribution: mmartinov commentedSorry, posted the patch file too early, here's the right one.
Comment #3
fietserwinI'm only working from git on my own contrib module (and core, if I want to create a patch for that). For most other modules it is indeed often simple enough to pick up the change and just implement it. (I think the reason the patch didn't apply is that I left the .orig extension to the file in the resulting patch.)
- the $flat logic is indeed reversed (did not test it on a hierarchical vocabulary)
- the t() fallback is indeed questionable. Hierarchical Select did use it and I left that as it was, but taxonomy itself doesn't, so this could lead to strange (even erroneous) situations. I guess your decision is better. I think I will report this back to HS. (edit: done, see #1216214: D7 i18n Taxonomy compatibility)
Comment #4
mmartinov CreditAttribution: mmartinov commentedCommitted in the 7.x-1.x branch.
Comment #6
bluesman2014 CreditAttribution: bluesman2014 commentedHi, I just installed the recommended version of this module and encountered the same problem.
I have a taxonomy translated into several languages. I can select the vocabulary inside the component, but on the form the terms are only displayed in the original language.
Is a new patch required or is there a setting that I might be missing?
Comment #7
giupenni CreditAttribution: giupenni commentedSame problem here
Comment #8
mcgowanm CreditAttribution: mcgowanm at Fenix Solutions Inc commentedUpdated the patch for 7.x-4.0