Hello,

Has anyone been able to translate the TITLE (tooltip that appears on hover over a button) with Juicebox?

I purchased the PRO version and I can set a languageList from the API settings, but I believe it won't change for my multilingual site.

Any ideas?

Thanks

Comments

rjacobs’s picture

Hi,

I assume that you are referring to the translation of Juicebox interface options via the languageList variable described at http://juicebox.net/support/creation/#language-list ? Furthermore, you are wanting this languageList variable to change dynamically based on the active language that is reported within Drupal?

This would be possible with the use of the juicebox_gallery_data alter hook (these kinds of dynamic substitutions of XML data is what that hook was setup for). However, this does require some custom coding.... is that something you would be up for so long as you had some general guidance?

rjacobs’s picture

Version: 7.x-1.1 » 7.x-2.x-dev

I thought about this more and I'd like to prioritize it as an interface option, not just something that can be done in a local customization. I don't think it will be that hard to integrate the "languageList" XML option with the Drupal translation system, and since "languageList" works in both Juicebox Lite and Pro, this concept should probably be natively supported by the module. I'm also personally all-for better multilingual support.

It looks like we just need to pass a base (English) set of interface strings through Drupal's t() function, and then add them to the XML output via the "languageList" option. So long as a site admin enters translations into the site for this set of strings (via the Locale module for example), the Juicebox interface will become language aware along with the rest of the site. That'll be quite nice.

I'll try to get something in place soon. It'll have to be against 7.x-2.x.

rjacobs’s picture

Title: Allow HTML Title tag to be translated » Allow Juicebox javascript interface (tooltips, etc.) to be translated
Status: Active » Needs review

Alright, I'm moving fast on a lot of 7.x-2.x development, and have committed some changes that should enable this new translation feature.

Here's how it works:

  1. Navigate to the Juucebox global settings admin form at /admin/config/media/juicebox
  2. Enable the "Translate the Juicebox javascript interface" option. This will tell the module to send a languageList configuration option to the Juicebox javascript after passing it through the core Drupal translation system. Enabling this option opens up some other related options, but the default for those should typically be fine.
  3. Once this is done, you still need to actually enter the interface translation(s) into your site. This is probably best done with the Locale module's "translate interface" tool at admin/config/regional/translate. It will probably be useful to first navigate to a gallery with an alternative language active so that Locale detects the new untranslated string and adds it to the list of items to be translated.

You will essentially be translating a single string who's english version is something like:

Show Thumbnails|Hide Thumbnails|Expand Gallery|Close Gallery|Open Image in New Window|Next Image|Previous Image|Play Audio|Pause Audio|Show Information|Hide Information|Start AutoPlay|Stop AutoPlay|AutoPlay ON|AutoPlay OFF|Go Back|Buy this Image|Share on Facebook|Share on Twitter|Share on Google+|Share on Pinterest|Share on Tumblr|of

And who's translation will become something like (for French):

Afficher Vignettes|Masquer Vignettes|Afficher Plein Ecran|Quitter Plein Ecran|Ouvrir Dans Nouvelle Fenêtre|Suivant|Précédent|Démarrer Audio|Pause Audio|Afficher Informations|Masquer Informations|Démarrer Lecture Auto|Arrêter Lecture Auto|Lecture Auto ON|Lecture Auto OFF|Aller Retour|Acheter Cette Image|Partager sur Facebook|Partager sur Twitter|Partager sur Google+|Partager sur Pinterest|Partager sur Tumblr|des

That's it, after the translation is entered (via Locale) the Juicebox interface should automatically toggle along with the rest of Drupal.

rjacobs’s picture

Status: Needs review » Fixed

I just released 7.x-2.0-beta2, which includes this new feature, so I'm going to go ahead and mark this as fixed. At a minimum it adds the base framework for interface/tooltip translation. If additional comments come up on this it'll probably be best to open a separate issue.

voodoodan245730’s picture

Very cool work, Sorry didnt reply any sooner!

Many thanks!

voodoodan245730’s picture

Very cool work, Sorry didnt reply any sooner!

Many thanks!

Status: Fixed » Closed (fixed)

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