I am creating a multilingual site, using i18n and related modules. For nodes that are in a language other than English, I am unable to translate the strings like "Print" and "Email" in the links area. I checked the settings forms and they look like system settings forms. This means the "Text strings" settings are saved as variables, but I do not see any option to enable translation for these under the "Multilingual variables" settings. Does this mean to translate these strings I have to write a custom module that implements the Variable module hooks?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Did you modify the default text strings? Those are usually 'Printer-friendly version' and 'Send by e-mail/Send to friend'.

If you did, you should also have seen in the form where you did the warning: "Saving these strings will disable their translation via Drupal's language system. Use the reset button to return them to the original state."

What part of the warning was not clear?

a6hiji7’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I must have missed the message somehow. As there is no way to change the text as well as translate them, marking this as closed. If you have any plans for adding this feature let me know the path that you are considering. I will try to find a solution too, considering client requests.

jcnventura’s picture

The next version of the module will mostly disable the ability to change these. The recommended path is to use the String Overrides module, which let's you keep them translatable. You can use it already also: just install that module and make sure you've reset the print module's custom strings to the default value.

Devin Carlson’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Assigned: Unassigned » Devin Carlson
Status: Closed (works as designed) » Needs review
FileSize
1.81 KB

+1 for supporting configurable link text.

Attached is a patch which declares the link variables in hook_variable_info() (provided by the variable module, a dependency of the internationalization module) which will allow them to be translated using the internationalization module.

This will allow i18n users to translate the links while having no impact on regular users.

jcnventura’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

Thanks for the patch. It's going to be 7.x-2.x specific, though. I'm no longer adding new stuff to the 1.x branch.

Committed as http://drupalcode.org/project/print.git/commit/9d21706

Status: Fixed » Closed (fixed)

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

Peacog’s picture

It took me a while to figure out how to translate the links so I thought I'd post the solution here in case anyone else is stuck on the same issue.
The link text is no longer translated via the i18n string translation interface. It is now a multilingual variable and is translated as follows:

1. Select the Printer-friendly version variable (and Email and PDF variables if required) in the Other variables section at admin/config/regional/i18n/variable
2. Now when you go to the Print module settings at admin/config/user-interface/print you will see, "THERE ARE MULTILINGUAL VARIABLES IN THIS FORM" at the top of the page.
3. In the Custom Link Text section, check the box and enter your link text for your default language.
4. Go back to the top of the page, select another language, and enter the translated link text in Custom Link Text.
5. Rinse and repeat.

schifazl’s picture

I switched to the dev version and here the reset button is missing. I've disabled the custom link, translated the strings in admin/config/regional/translate/translate, but it still won't get translated, only english. What am I missing?

schifazl’s picture

Issue summary: View changes
Status: Closed (fixed) » Active
jayjaydluffy’s picture

#7 works! thanks..

sinasalek’s picture

#7 Tx a lot, it works

sinasalek’s picture

Status: Active » Closed (fixed)

Should be closed

hwasem’s picture

Is anyone using this for custom PDF link text? It is working on custom HTML print text using #7 instruction, but not PDF. In Print's PDF tab, I don't have the "There are Multilingual Variables in this Form" section at all.

I tried to find my link text in the admin/config/regional/translate/translate interface after refreshing strings, but that didn't work either.

Am I missing something? I'm using wkhtmltopdf conversion if that matters.

Thanks in advance for any direction you can give,
Heidi

hwasem’s picture

I'll answer my question :)

I missed the "PDF Version" check box in step 1 of #7 above (admin/config/regional/i18n/variable). The Printer-friendly version and PDF version need to be check in the admin/config/regional/i18n/variable page in order to get the Spanish option in both.

All fixed!
Heidi

schifazl’s picture

I don't know what's wrong with my site, but I can't get it to work :'(

hwasem’s picture

@schifazl,
What version of Print are you using?
Did you enable Printer-friendly version and PDF version variables in admin/config/regional/i18n/variable?
Are you seeing the English | Spanish (or whatever your languages are) at the top of the /admin/config/user-interface/print or /admin/config/user-interface/print/pdf pages?