I'm using ET with i18n on l10n_install profile

Right now admin can configure language filter and fallback in 2 different places:
Enable language fallback in /admin/config/regional/entity_translation
and
Select nodes by language in /admin/config/regional/i18n/select

These configurations do not correctly fallback. For example, if the language is selected as EN and a node is not in that language the fallback system will show nodes in all other languages, including UND. It should fallback only to UND (undefined language), or give option to fallback to any languages enalbed.

Also, filtering nodes for a specific language in /admin/config/regional/entity_translation displays only nodes originally written in that languge. It does not display the translations done on ET. It has to be fixed to display that nodes translated using ET.

Comments

plach’s picture

Component:Code» Base system
Priority:Major» Normal
heldercor’s picture

My original language is PT and when viewing in EN I get the content in FR which is the next available one.

Doesn't make sense, I would rather fallback to the original language (in my case, PT).

drupal core: 7.21
entity_translation: 7.x-1.0-beta2

heldercor’s picture

Forget my comment. I solved it by changing the order of my languages in admin/config/regional/language.

Decided to leave it here in case others are looking for the same thing.

palamida’s picture

thanks,
this solved my problem

I had a similar situation:
- using Entity translation
- Language fallback was checked
- default language was set to ENGLISH
- on the Entity translation settings page the default language for the node was set to ENGLISH
- content was in ENGLISH and CROATIAN

when looking the ITALIAN page I get the CROATIAN content insted of ENGLISH

even using the Language Fallback module didn't solve the issue, but reordering the list of languages as you said did the job
I don't know, maybe I overlooked this note somewhere but it took me few hours until I find your solution

thanks,
regards
Marko

Mac_Weber’s picture

Category:feature» bug

It does not solve the issue.

There are 2 places for configuring fallback. Displaying ALL nodes is not fallback.

plach’s picture

Category:bug» feature

One of the places to configure fallback is provided by a submodule of i18n that is not compatible with ET and this is clearly stated in the documentation.

Additionally the OP does not provide any bug report, just a request for a behavior change without explaining what's wrong with the current one.

I really cannot understand what's the goal of this issue, but certainly this is not a bug report atm.

Calystod’s picture

Category:Feature request» Bug report
Issue summary:View changes

I confirm the problem and this problem have generated many bugs on our website. We have 4 languages: English, Japanese, Chinese and Korean.

For a question of presentation, the customer asked us to sort language in the switcher like this: Japanese, Korean, Chinese and English. We done.

When they have begun the translation in japanese, they had no problem. But, presently, they translate the site in chinese and have many problems:

  • Taxonomy is display in japanese and not in english.
  • When vocabulary isn't translated in japanese yet, terms are empty in the content
  • When we validate the chinese translation with TMGMT in chinese, the english title becomes japanese.

English is configured as the fallback language in admin/config/regional/entity_translation for all nodes, vocabularies and panels.

After have read this issue, I have changed the order of languages for have english in first and all bugs are corrected....

It's a very frustrating bug....

daro.pl’s picture

+1
it's a bug.

daro.pl’s picture

I write some code to workaround this issue

<?php
/**
 * Implements hook_field_language_alter().
 */
function tweaks_field_language_alter(&$display_language, $context) {
  if (
path_is_admin(current_path())) {
    return;
  }

  if (
variable_get('locale_field_language_fallback', TRUE) && entity_translation_enabled($context['entity_type'])) {
   
$entity = $context['entity'];
   
$entity_type = $context['entity_type'];
   
$handler = entity_translation_get_handler($entity_type, $entity);
   
$translations = $handler->getTranslations();

    if (!empty(
$translations->data)) {
      list(, ,
$bundle) = entity_extract_ids($entity_type, $entity);
     
$instances = field_info_instances($entity_type, $bundle);

      foreach (
$translations->data as $langcode => $translation) {
        if (
$langcode != $context['language'] && $langcode != $translations->original) {
          foreach (
$instances as $instance) {
            unset(
$entity->{$instance['field_name']}[$langcode]);
          }
        }
      }
    }
  }
}
?>
plach’s picture

Category:Bug report» Feature request

It's not a bug, it's meant to work exactly this way. By default fallback is determined by language weight, there is a hook exactly to let you implement whichever logic suits your use case.

You are probably facing a Title module bug instead.

daro.pl’s picture

Maybe it's Drupal logic here (because field languages are supported by the core), but it can't be accepted that Drupal displays German field values translations on English site, for example. Translations shouldn't complement each other. Original node values should be able to do it only.
Entity translation should provide some option to fix it (allow users to adjust it).

plach’s picture

I agree the behavior suggested above makes sense and is probably a more sensible default behavior, but this is new functionality not a fix. If #9 becomes a patch that also adds an option to enable/disable this alternative fallback logic I'm happy to commit it.

We also need an update function disabling this, so that existing sites keep working as before.