As I did some debug the problem comes in this function:

function i18n_string_l10n_client_add($string, $langcode) {
  // If current language add to l10n client list for later on page translation.
  // If langcode translation was disabled we are not supossed to reach here.
  if (($langcode == i18n_langcode()) && function_exists('l10_client_add_string_to_page') && i18n_string_translate_access($string)) {
    $translation = $string->get_translation($langcode);
    $source = !empty($string->source) ? $string->source : FALSE;
   <strong> l10_client_add_string_to_page($source, $translation ? $translation : FALSE, $string->textgroup, $string->context);</strong>
  }
}

The l10_client_add_string_to_page expects 3 args but here are sending 4 args:

function l10_client_add_string_to_page($source = NULL, $translation = NULL, $textgroup = 'default') {

Also in the function function _l10n_client_string_list($strings) { consider that the parameter $translation should be TRUE when doesn't exist translation and on l10_client_add_string_to_page function is passed $translation = FALSE

// TRUE means we don't have translation, so we use the original string,
// so we always have the string displayed on the page in the dropdown.
$original = $values[1] === TRUE ? $values[0] : $values[1];

Other more problem is that function i18n_string_l10n_client_save_string() { validate for the custom strings that doesn't have !empty($_POST['context']) and this is the 4th argument that is passed on l10_client_add_string_to_page but not received on l10_client_add_string_to_page expects so it is not defined.

There are a lot of dependencies to resolve this problem and I don't know all the understanding of this module to resolve the problem. I'm creating a patch but is not probably the correct approach because it looks like there is a transition on how this modules are doing the things but is incomplete more than a mistake. I will provide my solution later.

Thanks.

Comments

citlacom’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB

The function l10_client_add_string_to_page is fixed in the development version of i10n_client so I only updated to dev version and maked small patch for i18n_string for the $translation = TRUE and when the $string->source is not defined take the $string->string

This fix the problem and I can use the string translate with my loved l10n_client UI. :)

Status: Needs review » Needs work

The last submitted patch, i18n_string-fix_l10n_string_integration-1427614.patch, failed testing.

webflo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB

Rerolled

Status: Needs review » Needs work

The last submitted patch, i18n_string-fix_l10n_string_integration-1427614-3.patch, failed testing.

webflo’s picture

Issue tags: +i18n compatibility

tagging

webflo’s picture

Status: Needs work » Needs review
Issue tags: -i18n compatibility

Status: Needs review » Needs work
Issue tags: +i18n compatibility

The last submitted patch, i18n_string-fix_l10n_string_integration-1427614-3.patch, failed testing.

webflo’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
webflo’s picture

Status: Needs work » Needs review
jose reyero’s picture

The patch looks good, though I am not sure what's going on with the automated testing.. ?

webflo’s picture

Status: Needs review » Reviewed & tested by the community

The testing branch was wrong. Changed it in #8 to 7.x-1.x-dev. Patch is fine.

jose reyero’s picture

Ok, then go ahead.

jose reyero’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Automatically closed -- issue fixed for 2 weeks with no activity.