Project:Share Buttons (AddToAny) by Lockerz
Version:6.x-3.3
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:needs review

Issue Summary

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 :)

Comments

#1

That's a really great idea. :)

#2

Status:active» needs work

#3

Version:6.x-2.3» 6.x-3.3
Status:needs work» needs review

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

AttachmentSize
addtoany-custom-text-translatable-469720.patch 687 bytes

#4

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. :)

#5

@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

#6

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

#7

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?

#8

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?

#9

Status:needs work» needs review

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

AttachmentSize
0001-Issue-469720-by-ao2-make-user-inputed-variables-tran.patch 1.38 KB