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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | screenshot-localhost-2016-11-24-08-49-55.png | 129.97 KB | cebasqueira |
| #9 | scald-locale-2420741-9.patch | 459 bytes | renatog |
Comments
Comment #1
angel.hComment #2
angel.hHere is the patch. I also provided a small test and a test-only patch.
Comment #4
angel.hFor 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".
Comment #5
jcisio commentedThanks. Committed and pushed.
Comment #8
slayne40 commentedHi,
When you change the group name in scald_i18n_string_info() an error occured in the admin/config/regional/translate/export and import pages :
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 :
Comment #9
renatog commentedHi @slayne40 and @jcisio.
Here is the file with the fix.
Regards.
Comment #10
cebasqueira commentedIt1s works fine. +RTBC
Comment #11
cebasqueira commentedComment #13
nagy.balint commentedThanks! Committed.
Comment #14
renatog commentedI thank you @nagy.balint.
Hugs.
Comment #15
renatog commented