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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | i18n_string-fix_l10n_string_integration-1427614-3.patch | 1.14 KB | webflo |
| #1 | i18n_string-fix_l10n_string_integration-1427614.patch | 1.13 KB | citlacom |
Comments
Comment #1
citlacom commentedThe 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. :)
Comment #3
webflo commentedRerolled
Comment #5
webflo commentedtagging
Comment #6
webflo commented#3: i18n_string-fix_l10n_string_integration-1427614-3.patch queued for re-testing.
Comment #8
webflo commentedComment #9
webflo commented#3: i18n_string-fix_l10n_string_integration-1427614-3.patch queued for re-testing.
Comment #10
jose reyero commentedThe patch looks good, though I am not sure what's going on with the automated testing.. ?
Comment #11
webflo commentedThe testing branch was wrong. Changed it in #8 to 7.x-1.x-dev. Patch is fine.
Comment #12
jose reyero commentedOk, then go ahead.
Comment #13
jose reyero commentedCommitted.