0

I've altered a form where I set the save button text to t("Buy Product");

But how can I make sure that I can translate this string in admin/config/region/translate/translate ?

I've tried to add this

$conf['locale_custom_strings_en'][''] = array(
 'Buy Product' => 'Koop Product',
);

to my settings.php but no result. How can I make sure the string in my code can be translated in drupal itself?

1

Every single string passed to t($string) function will be added to the database, and you can find it in the path you montioned above "admin/config/regional/translate/translate"

clear the cache, and search it again with help of filters existing on the admin translate page.

[EDIT]

First of all a must have module in multilangual sites is the internationalization module, it's a powerfull and helpfull module...

But the most important thing in your case is that before you can see your string in the transltion page:

  1. you must enable(switch to) the desired language
  2. visit the page that contain that needle string
  3. visit again the translation interface.

That's it you will find your string ;)

2
  • I've added t('factuur') in a custom module (which is enabled). Cleared my cache and check but when I search for string factuur I get no results (filters show all fields with equal to factuur). I don't have to install an extra module or something no? – nielsv May 22 '14 at 21:53
  • I have updated the post hope that is clear enough :) – Boussetta moez May 23 '14 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.