Hi there, this is basically a follow up from #1070256: Localize terms show always the default language.

I still have the issue that my taxonomy terms are not translated on node/add or node/edit.. The terms are in English originally and then translated to French.. I can see the translations in the translation interface, but even if I go to the "list terms" in the taxonomy, they're not translated. Only on the node view page they are..

Any help would be appreciated.

Cheers

Comments

Jose Reyero’s picture

Status: Active » Closed (works as designed)

We are not translating them on taxonomy pages. For node/view, node/edit you need to choose the right field widgets (read 'Translated', 'Localized') and use the right language page.

arski’s picture

Status: Closed (works as designed) » Active

I am, and they're working perfectly on view, but not on edit/add.. let me know if/what further details I can provide to help.

Jose Reyero’s picture

Status: Active » Postponed (maintainer needs more info)

We need to know:
- Vocabulary settings (i18n)
- Field and widget settings

A screenshot would help too.

arski’s picture

Status: Postponed (maintainer needs more info) » Active

vocabulary is set to "Localize. Terms are common for all languages, but their name and description may be localized. "

Field is a "term reference", "select list" widget.

Field display setting set to "link (localized)" - I tried "plain text (localized)" too but im pretty sure this option has no effect on the node/edit page.

The site is a 2-language site, with default English and 2nd language French. The terms are added in English and translated in the taxonomy interface, and also if I search for the term string via string translation interface..

Let me know if you need anything else.

Jose Reyero’s picture

Which language are you editing the node in?

arski’s picture

tried both, i.e. switching the site language between english-french and editing the node. all the field names and description texts etc. all translate correctly, so the language is indeed switched, though the taxonomy term values are not.

ttapada’s picture

Same problem here.

In my case, I've installed Drupapl in English, added portuguese, and now trying to support mulitlanguage site.
Not working.
Localized terms are only shown in its original; never get translated either in content creation or exposed filters.

Mschudders’s picture

+1

arski’s picture

Version: 7.x-1.2 » 7.x-1.4

the issue has disappeared for me in 1.4, don't think anything else was changed on the site :x

jdanthinne’s picture

I've this problem as well…
When I create a node in a language different than the one I'm currently working in, the language assigned to the terms is the one from the admin, and not the language I've chosen when creating the node (say I create a french node from the english admin, then the terms are considered english and not french, which is wrong…).
I'm using a vocabulary with mode = Translate.

Jose Reyero’s picture

Status: Active » Postponed (maintainer needs more info)

Maybe using 'Administration Language' module?

Jose Reyero’s picture

pmusaraj’s picture

I'm running into this issue as well, and it's a considerable problem. It happens on vocabularies that are either Localized or translated. Is it not possible at all for the term language on the edit screen to be same as the node's language?

pmusaraj’s picture

I looked into this issue in more detail, and I think I have come up with a solution.

So, to clarify, the problem affects sites where in i18n's content selection options (admin/config/regional/i18n/select) are checked for taxonomy and node. These force the translated terms and the node references to use the interface language, and not the node language. If these settings are turned off, all terms are made available, i.e. for both languages. This issue also affects node reference fields.

I have fixed this using a data_query_alter that I put in a custom module, but it should likely be done inside i18nselect. I.e. if i18nselect detects that the current node is assigned to a specific language, it should alter queries to use that language, and disregard the interface language.

Here's the code for the terms that I put in a custom module:

function MODULE_lang_query_term_access_alter(QueryAlterableInterface $query) {

  $path = request_uri();
  $path = ltrim($path, '/'); // remove starting slash (present only in some cases)
  
  // change queries on node/edit to look only for terms with language = current node language
  if (preg_match('|^[a-zA-Z]*/node/([0-9]*)/edit(/.*)?|', $path, $matches)) {
    $node = node_load(arg(1));
    if ($node->language != LANGUAGE_NONE) {
      if (module_exists('i18n_taxonomy') && 
        ($table_alias = i18n_select_check_table($query, 'taxonomy_term_data', 'tid'))) {
          $conditions =& $query->conditions();      
          foreach ($conditions as $key => $condition) {
            if ($condition['field']== $table_alias . '.language') {
              unset($conditions[$key]);
            }
          }
        $query->condition($table_alias . '.language', array($node->language, 'und'), 'IN');
        // $conditions =& $query->conditions();      
      }
    }
  } 

  // change taxo autocomplete query to look only for terms with language = current node language
  if (preg_match('|^[a-zA-Z]*/taxonomy/autocomplete(/.*)?|', $path, $matches)) {
    $referrer = $_SERVER['HTTP_REFERER'];
    global $language;
    if ($referrer) {
      $referrer = parse_url($referrer);
      $referrer = explode('/', $referrer['path']);
      if (is_numeric($referrer[3])) {
        $node = node_load($referrer[3]);
        if ($node->language != $language->language) {
          if (module_exists('i18n_taxonomy') && 
            ($table_alias = i18n_select_check_table($query, 'taxonomy_term_data', 't'))) {
              $conditions =& $query->conditions();      
              foreach ($conditions as $key => $condition) {
                if ($condition['field'] == $table_alias . '.language') {
                  unset($conditions[$key]);
                }
              }
              $query->condition($table_alias . '.language', array($node->language, 'und'), 'IN');
          }
        }
      }
    }
  }
}

Feedback is more than welcome. I would be happy to provide this as a patch, if deemed reasonable by the maintainer(s). (It would be my first patch, but I'm keen on doing it.)

pav’s picture

Issue tags: +default language also displayed on the term page

+1

I have a vocabulary with translation mode set to "Localize". When I translate the name and description of the vocabulary or individual terms, the system seems to remember it - "Status" changes to "translated" and a translated title is displayed. But this is not displayed on any other page - not in widgets, not on the term pages, nowhere at all! When I navigate to the term page, I get it in the default English, when I use the dropdown selector in content creation screens ditto...

Have I missed a setting somewhere?

I am on Drupal 7.14 and i18n 7.x-1.5. THe language detection method is set to "URL" and "Default".

batigol’s picture

Same problem here

lmeurs’s picture

Same here, but the terms are in main language English only when the widget is set to "Autocomplete term widget (tagging)", when set to "Select list" or "Check boxes/Radio buttons" the localized terms appear.

Jose Reyero’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Autocomplete terms are just not translated because that is not implemented, see #1085190: Make taxonomy autocompletion work / tagging / block tagging ?

webdrips’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Category: bug » support
Status: Closed (duplicate) » Active

@Jose, forgive me, but I don't understand how this is a duplicate of the autocomplete issue.

The original poster indicated an issue with select, not autocomplete. I'm seeing the issue with checkboxes, and otherwise have the same settings as #4.

When I attempt to add a term when the language is set to the secondary language, I'm only seeing the English terms. After the node is saved, the selected terms are displayed with the text properly translated.

batigol’s picture

Strange thing: i18n 1.5 and drupal 7.15

When i create a news (node) and add few tags to it - everything is fine. But when I translate this news to other language then all tags are wrong linked to other language (I HAVE translated all tags).

But when i create a news, translate it and in translation I use DIFFERENT tags then in source translation news, their links are fine...

The think there is a problem - when adding taxonomy terms to the content. It seems that when you have 2 tags in different language but they have the same name [for example you translate computer (en) to computer (fr)] then link to this term is broken. Drupal choose wrong tag, it's not looking at you actual language that you adding content with.

So something is fu#@ up here. It also seems that translated Vocabulary Name is not used in translated taxonomy links - the default language name is used. I'm gona test it with i18n 1.7 and see if the problem repeat it self.

EDIT: Same thing with i18n 1.7

webdrips’s picture

Category: support » bug

Setting this back to bug since I believe this issue still persists (see #19).

batigol’s picture

airstarh’s picture

Copy-paste from
http://drupal.org/node/1070256#comment-7258638
(still do not have solution)

I think I tried everything here and in all Internet at all.
Nothing is working.

BTW:
I am also confused, that on admin page when I cross:
Structure -> Content types -> I see all Content types on the language I've created them, despite on use of translating their names via Entity Translating and Title modules.

Thanks God, there are no bugs on front end. But another language on node creating or edditting seems very unprofessional.

So, what about #26 - I have not found these admin settings to...

So,,, Subscribe )))

plach’s picture

Issue summary: View changes

If you are using an entity reference widget you need #2013849-4: Term names are not translated.

pixelpreview@gmail.com’s picture

I have the same problem, I have read a lot of posts and I don't find solution to this problem ... someone can show me the right way ???

I have a site in 3 languages
url language detection is active
I have a localized vocabulary (all terms are translated)
when I edit a node at LANG/node/add/article or LANG/nid/edit, the select /autocomplete field for term reference is always in default language (english) :(

After one year, no solutions ?

pwiniacki’s picture

@pixelpreview it's good that you can use auto-complete cause it was bugged before if I remember correctly :) and only option was to check(form) correct tags (LOT of clicks).

You need to change language to language the node is written in and then edit it - add tags. Otherwise it will not work. VERY frustrating, agree.

pixelpreview@gmail.com’s picture

thank you @pwiniacki, I have found a solution
I active the select multilingual module, check taxonomy select in it admin page.
I use a little hook to modify the link when we click in a translate link

When I create a node in DE/node/add/article
the select is in DE with a localized vocabulary
when I click on the translate tab (the current language is DE) and choose to create a translation in FR for example, with my hook, the url contains ...FR/node/add/topic?destination=node/3601/translate&translation=3601&target=fr ... in place of .... DE/node/add/topic?destination=node/3601/translate&translation=3601&target=fr

Thus the select show me my localized terms in DE :) and my users are happy.

I think that the module works like that before and that these functionality has been removed from the team. before, each translate link redirect with the language prefix from the translation that you want create and not the current language like now.

gonssal’s picture

Read this for an easy fix: #2418629: Make taxonomy_get_tree load entities by default

It's a core module modification, so you will have to apply everytime you update. The good part is that it's just changing a FALSE for a TRUE.

Another option is using the Taxonomy Term Reference Tree Widget module.

evets33’s picture

Hello pixelpreview
I'm interested about your hook. Can you show me an example please
Thank you

PMorris’s picture

This is still an issue. Taxonomy terms are not displaying in the correct node language. The terms are instead getting switched to whichever language is set in the site language switcher. Which results in a list of terms with uncheck fields in the wrong language.

In i18n /admin/config/regional/i18n/select
I have "Select taxonomy terms by language" turned on