I’ve made some progress.
Possibly it’s not a plugin problem.
Maybe it’s my theme’s problem.
I explain why i think that:
It seems that the following Hook is only executed when I’m on the Backend:
– add_filter(‘init’, ‘sociable_init_locale’);
if i override the Hook and “hard code” the function, the translation works in both Backend and Frontend:
+ $sociablei18npath = ‘wp-content/plugins/sociable/i18n/’;
+ load_plugin_textdomain(‘sociable’, $sociablei18npath);
This “workaround” seems to be a bad idea…
I would like to use Hooks, they are there for that, but i’m a bit lost.
Thanks for reading! i’ll be glad reading your suggestions 🙂
excuse my poor english,
Daniel
i think i know why this happens!
But if i’m right, nobody is getting Sociable translated in frontend!
The localization file is loaded on “init” hook, but the array (with the ‘localized’ descriptions) is loaded when the plugin is included (before the localization is loaded).
Following this guess i’ve modified sociable.php in this way:
(maybe line numbers are not exact)
sociable.php:36
– add_filter(‘init’, ‘sociable_init_locale’);
+ add_action(‘init’, ‘sociable_init_locale’);
later, in $sociable_known_sites, modify the description NOT to call tranlations (because they are not available yet)
ej:
sociable.php:142
– ‘description’ => __(‘E-mail this story to a friend!’,’sociable’),
+ ‘description’ => ‘E-mail this story to a friend!’),
oh! but i lost my tranlations that way!!
yes, but let the next modification to do the magic (translate when output, so the translations are already loaded):
sociable.php:577
– $description = $site[‘description’];
+ $description = __($site[‘description’],’sociable’);
i’m worry about updates…
i’ll contact the developer to see if he decides to include the patch!
Regars to the audience 🙂
Daniel
other handycap found on this solution:
you can’t automaticly build the .po for the translation, because “__(” calls are “dinamycly” generated…
so regex stop working properly…
if someone follows me, don’t forget to add each $sociable_known_sites[‘description’] to your .po file (if not, they will not be translated, no mayor problem at all).
d
I tried to prepare translation file for Czech language, but I was not successful. Files sociable-cs_CZ are not used… Any help? Thank you very much…
@tarrero I’m interested in the es_ES files. Is there a place I can download them from?
On the other hand, do you know whether the bug was eventually fixed by the developer of the plugin? Tx! JM