It would be a nice feature to allow a custom button per language (like a "share" or "partager" or "deel" image depending the language).
Another way would be the option to choose a background image and a translateable string to put on top of it.

Maybe when I get some time off later I'll submit a patch for this myself :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

micropat’s picture

That's a really great idea. :)

micropat’s picture

Status: Active » Needs work
ao2’s picture

Version: 6.x-2.3 » 6.x-3.3
Status: Needs work » Needs review
FileSize
687 bytes

I am reusing this issue for a patch which makes the custom text translatable.
Maybe we want also the alt text translated for images?

About the background image for the custom text, I am setting it just via css:

.da2a_button {
  padding-left: 20px;
  background: url(images/share_16_16.png) center left no-repeat;
}

Regards,
Antonio

micropat’s picture

Hmm... I like the thinking behind the patch, but translation doesn't make sense in this case because the text is variable (user inputted) and there's no default value.

Re: background-image, I kind of prefer that method myself anyway. Thanks for sharing. :)

ao2’s picture

@micropat: maybe instead of this rough approach of using t() we could mark the _input_filed_ for custom text as a multilanguage field, I have to look into that, but the point stands: it makes perfectly sense to have a user defined string translatable (think to multilanguage sites); do we agree on that?

Regards,
Antonio

ao2’s picture

Ok, in order to have the custom text as a multilingual variable it is enough to add 'addtoany_link_text' to $conf['i18n_variables'] in your site settings.php.

This is ok to me and keeps the multilanguage complexity out from AddToAny. Patch discarded and issue closed?

Thanks,
Antonio

ao2’s picture

Some other modules define their own multilingual variables:
http://blog.eood.cn/make-user-inputed-variables-translatable-in-drupal

maybe addtoany could do that instead of the patch in #3, and instead of leaving that to the site specific config like stated in #6:

global $conf;
$conf['i18n_variables'][] = 'addtoany_image_attributes';
$conf['i18n_variables'][] = 'addtoany_link_text';

Comments?

micropat’s picture

Status: Needs review » Needs work

I like that method! Thanks very much for your persistence on this issue.

Would you like to offer a patch against the latest version?

ao2’s picture

Status: Needs work » Needs review
FileSize
1.38 KB

Here we are. Patch is against 6.x-3.x branch, you can use git am to apply it so I get attribution in the git history.

Thanks,
Antonio

micropat’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)