https://www.drupal.org/node/2291875 fixed the translation of the Scald types but there was an error in the code (and I'm ashamed to admit that I also reviewed it), namely in the implementation of hook_i18n_string_info():

+/**
+ * Implements hook_i18n_string_info().
+ */
+function scald_18n_string_info() {
+  $groups['scald_type'] = array(
+    'title' => t('Scald atom type'),
+    'description' => t('The title and description of the different atom types supported by Scald.'),
+    'format' => FALSE,
+    'list' => TRUE,
+  );
+
+  return $groups;
+}

See it? Probably not. The function name is scald_18n_string_info and "i" is missing before "18". I discovered this when I called i18n_string_group_info('scald') and I got nothing. Investigating further I saw that in i18n_string_group_info that hook_i18n_string_info() is invoked and I found the problem. Fixing the function name is not all however. Looking further I saw that scald_i18n_string_info() returns group called 'scald_type', while above, in scald_locale() the group is declared as 'scald'. I'll provide a patch for this.

Comments

angel.h’s picture

Issue summary: View changes
angel.h’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB
new561 bytes

Here is the patch. I also provided a small test and a test-only patch.

Status: Needs review » Needs work

The last submitted patch, 2: 2420741-1-scald-error-hook-implementation-test-only.patch, failed testing.

angel.h’s picture

Status: Needs work » Needs review

For some reason the test-only patch appeared second ( I uploaded it first) and since it failed (of course) it moved this to "Needs work". Moving it back to "Needs review".

jcisio’s picture

Status: Needs review » Fixed

Thanks. Committed and pushed.

  • jcisio committed c001f8c on 7.x-1.x authored by angel.h
    Issue #2420741 by angel.h: Scald implementation of hook_i18n_string_info...

Status: Fixed » Closed (fixed)

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

slayne40’s picture

Status: Closed (fixed) » Needs work

Hi,
When you change the group name in scald_i18n_string_info() an error occured in the admin/config/regional/translate/export and import pages :

- strlen() expects parameter 1 to be string, array given in strlen()
- Array to string conversion in strtr()

And the name in the group list is "Array".

This is because the page use module_invoke_all('locale', 'groups') to construct the options list.
i18n_string_locale() use scald_i18n_string_info() to answer 'Scald atom type'
and
scald_locale() answer 'Scald'

Finally scald group's name is an array of the two values and not a string.

Perhaps you have to test the presence of the module i18n_string :

function scald_locale($op = 'groups') {
  if (!module_exists('i18n_string')) {
    switch ($op) {
      case 'groups':
        return array('scald' => t('Scald'));
    }
  }
}
renatog’s picture

Status: Needs work » Needs review
StatusFileSize
new459 bytes

Hi @slayne40 and @jcisio.

Here is the file with the fix.

Regards.

cebasqueira’s picture

StatusFileSize
new129.97 KB

It1s works fine. +RTBC

cebasqueira’s picture

Status: Needs review » Reviewed & tested by the community

  • nagy.balint committed 4b2dbdb on 7.x-1.x authored by renatog
    Issue #2420741 by angel.h, renatog, cebasqueira, slayne40: Scald...
nagy.balint’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed.

renatog’s picture

I thank you @nagy.balint.

Hugs.

renatog’s picture

Issue tags: +ciandt-contrib

Status: Fixed » Closed (fixed)

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