Hello All,
I setup an English site, the client wanted an english/arabic website. I then created an en-US to fix any English changes the client wanted and set it as default. So the site now had en, ar & en-US and I changed default language to en-US. After setting it up and creating a number of vocabularies and some English terms, the client asked that Arabic be set as default, so I went on and changed the default language to AR (I did hear this opens a big can of worms).
Still translation worked great. When I search for a t() string it shows up as EN, I translate it to AR and en-US and life is great. It was smart enough to guess the t's didn't suddenly become AR because I changed the default language. But when I enabled i18n_taxonomy it didn't work as expected. I went to the taxonomy, enabled i18n on a vocab and set it as (terms are the same but names and descriptions localized), I refreshed taxonomy strings from translate, and here are my observations:
1. Taxonomy strings didn't show up in the string search at all.
2. I went ahead and edited the term itself from the vocab pages to translate it from there, when I went to the translate tab, I found that the existing term is considered AR (orignal) which I presume is because I changed the default language (so what happens if I change the default to french now?!). There were 2 untranslated english-es (en, en-US).
3. I just went ahead and edited the en, en-US and put something bogus to see if it will translate, no translations showed up in the pages that listed the terms via views (just ignored the bogus translations I did when switching languages).
Tried to be as thorough as possible as I saw so many complaints about this that are non-reproducible. I think the main problem I'm facing is because of the default language change but I could be wrong.
Any help highly appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | i18n-fix-i18n_mode-field-no-retrieved-1317972-13.patch | 1023 bytes | citlacom |
Comments
Comment #1
Ashraf Amayreh commentedSome (possibly useless) analysis, it seems that systems which depend on user input consider the user input to be the default language while systems that translate from code always consider the text in the t's to be EN regardless of default language. When looking at it, it makes sense.
What would be more logical, however, is that when you switch language, the systems which rely on user input should 1. Still consider user input EN like the t system does or 2. Ask the user what it should consider the user input allowing them the flexibility.
I don't think this explains why, when I did a search, I didn't get results though. Nor does it explain why, when I put some bogus translations for terms they still appeared non-translated.
Comment #2
konradesko commentedominds: did you managed the taxonomy terms to be translated? Becouse I can't.
I have:
Drupal: 7.7
taxonomy_menu: 7.x-1.2
i18n: 7.x-1.1
First of all, here is what I did to have taxonomy terms translated.
1. Added i18n module to my site with one language (FR) at the beginning. Site language is chosen by url - subdomain.
2. Added next language (EN), french as default as it was.
3. I wen to my taxonomy used in menu and saw options:
4. Now, happy that my terms will be translated and I don't need to create new taxonomy terms I translated several to test it. I've edited term, saw that there is button "Save and translate", so click it. Then drupal hold me on this page and asked to fill section: Relation -> Parents. It was empty. Weird, I thought, becouse it should be just translation of term, not new term with parent setup. But I chosed same level and saved, on the next page added translation of term.
5. When I refreshed frontend there was no changes at all. Still menu was in french and my translated earlier term was not translated.
I can't pick other options becouse user can't have 3 fields-each-in-different-language-and-bunch-of-categories-to-pick. It can't be one HUUUGE field with all categories in 3 languages. It must be translated. And I have no idea how to do it.
I can provide more infos if anybody would like to.
I even don't know where I should look for it. In wich module: taxonomy_menu, taxonomy_translation, i18n, string translation...? Please help.
Comment #3
Anonymous (not verified) commentedSame problem, using localized terms with Format: Plain text (localized). No results, terms are not translated in the frontend.
Comment #4
selinav commentedI've the same problem, term are well translated in the backend but they still display in english (default language) in the frontend.
Comment #5
drupalpal commentedSubscribe. I have the same problem. The translated terms are only shown in the website default language, this applies to the front-end, the tags autocomplete and views. This is very disturbing.
Thanks!
Comment #6
nico.knaepen commentedWe've also experienced the same problem.
At first, we had set-up our taxonomy vocabulary without any multilingual configuration and then added some terms. It seemed that when enabling the i18n Taxonomy translation module and setting up the multilingual settings per vocabulary to 'Localize' it wasn't possible to translate the terms that where already added before the enabling of the module.
The exact problem was that the tables i18n_string and locales_source did not contain the records of the already existing terms. After adding these records, it was possible to translate the terms.
Comment #7
catorghans commentedI cannot confirm the solution by #6.
Also terms that where created after enabling the module and where translated did not show.
The only non-optimal solution is change the Taxonomy translation setting to Translate in stead of Localize.
Option "Translate" works as expected, however "Localize" would suit my needs better.
Comment #8
zetagraph commentedSame Issue here. Can't get translated terms to show up in the term view with term translation being set to "Localize"
Comment #9
jose reyero commentedIf making these kind of changes, try 'Translate interface', 'Strings' tab and refresh the taxonomy text group.
Comment #11
khumbu commentedissue still exist...tried #9 but no changes
I can translate the terms but when I use them they won't show the translations.....anyone else some ideas?
term translation being set to "Localize"
Comment #12
Shanks commentedSame problem here. I am using the 7.x-1.4 version. Translated taxonomy terms are only displayed in the back-end, in the front-end the default language is used. Tried #6 and #9, none of them worked for me.
Comment #13
citlacom commentedI have the same issue, but also after enable the localize option in the Vocabulary the configuration is not recognized and the traslation tab in the terms doesn't diplay. After some debugging the reason is related to the i18n_mode when retrieved by i18n_taxonomy_vocabulary_mode function taxonomy_vocabulary_load doesn't add in the entity_load query the field '18n_mode'. So here is a proof calling only that function in a D 7.12 installation with the last i18n dev release:
The field 'i18n_mode' is not retrieved so I add it explicit with query alter:
Then reset the cache and execute the function again:
This resolve the issue of lost the translation tabs and localize configuration but still I don't see the terms translated in the front end. Probably could be that I'm displaying the terms with a terms view and that could be not supported yet? I need to show a block with a list of cities that are terms so I'm creating a View with that terms but doesn't localize when I switch language.
Comment #14
citlacom commentedHere I provide a patch to resolve the i18n_mode field issue that could be a reason to won't be able to translate terms. For all the developers that are trying to see the terms translated in a view I alert you that the i18n_taxonomy doesn't support this and you will need to install http://drupal.org/project/i18nviews and change all your views that display terms entities to use the special handlers (translate) for field name and description. Not sure if this could work with other fields because there are only few views fields handlers that are implemented in i18nviews:
Probably if you have other fields you will need to create a new field handler.
Comment #15
pieterdc@citlacom: Thanks a lot for mentioning i18nviews. It saved my day ;-)
Comment #16
jose reyero commented@citlacom,
I don't understand how that field can be missing because it is added to the schema by i18n_taxonomy.
Question: Are you using latest Drupal core?
Comment #17
citlacom commented@Jose Reyero Yes I'm using the latest Drupal core 7.12 and I accept that is weird but it happened. I had been debugging with Xdebug and the problem is that every time the schema is cached it doesn't add altered fields as this case. I never get an explanation of why it doesn't cache correctly the schema. Probably could be a conflict with other contrib module so let's see if other people have the same issue in that case my patch could resolve the problem adding the field explicit to the entity_load query.
Warm regards.
Comment #18
jose reyero commentedAfter looking at the code I think the only chance this may happen is some other module hacking around the schema, and either calling drupal_get_schema() really (really) early in the bootstrap or using drupal_alter('schema'..) too early too.
See http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_...
(All install files are included. Though Drupal core way of handling this, when we not having module.inc yet I'd call it a bug too)
So please would you take a look a your module list..?
Comment #19
jose reyero commentedClosing, no follow up.