Hi,

i try to translate interface in french, it's easy for texte inside tpl but i'd like to know if it possible to rename text inside form and function in module file.

Do you think it's could be possible?

Thanks.

Comments

rfay’s picture

The majority of the strings that should be translatable are, you can translate using the locale module. Drupal supports translation very well - You should check out http://localize.drupal.org, which is probably the way to do it these days. Your contribution back to the module will be much appreciated.

There are, as you mention, some things that are in the tpl.php files. Those can either be made translatable or done as part of your theme.

lentreprenaute’s picture

rfay,

Can i have more informations? what kind of drupal module, i had to use? to translate some texts wich comme with module file :

///listing
merchant
add to cart
Sold by
.....was added to your cart
view cart

///// cart
quantitiy
update quantity

I don't know if it a lot of work, it's could be nice to have alls texts, that let us the ability to translate it in
tpl file without to add extra module?

An other question, are you still working on this module, are you interessted to add new fonction? I have on small idea, which could be nice, it's a "favorite list" that let to customer to put product in a spécific page. It's very similar than cart function. This page will store only picture and name product and let the ability to comme back on this page to add the product in cart.

Thanks for your work
Florent

rfay’s picture

Status: Active » Fixed

Information about translation in general is at http://drupal.org/contribute/translations

Drupal is fantastically capable in the translation area.

This module is not being actively developed, but new features are sometimes added.

I don't really understand your feature request, but to make a feature request, please open another issue and explain it really clearly.

The Amazon module itself provides many features to create pages showing info from Amazon.com. See the documentation at http://drupal.org/node/595464

lentreprenaute’s picture

Component: Code » User interface
Status: Fixed » Active

Hi rfay,

i installed module stingoverride to try the translation, in module files Merchant and was added cant'be translated.

Some others texts like Cart quantity updated to, failed....
I suppose that it's the same.


if (empty($results->error)) {
    drupal_set_message("Cart quantity updated to $actual_quantity"); <<<<<<<<<<<<<<<<<<here
    return TRUE; 
  } else {



 } else { // No offers yet due to missing selections
    $selects = array(t('Make other selections first'));
  }
  $form['fields']['offer'."-$asin"] = array(
      '#title' => "Merchant",  <<<<<<<<<<<<<<<<<<<<<<<<here

/////////

/**
 * Submit function - do the add-to-cart
 *
 * @param unknown_type $form
 * @param unknown_type $form_state
 */
function amazon_store_addcart_form_submit($form,&$form_state) {
  $asin = $form_state['values']['fields']['asin'];
  $offer = $form_state['values']['fields']["offer-$asin"];

  $result = _amazon_store_add_to_cart(NULL,$offer);
  if ($result) {
    $directory = drupal_get_path('module', 'amazon_store');
    drupal_set_message(t('%item  was added <<<<<<<<<<<<<<<<<<<<<<<here

Do you think that it"scould be change in a new version?

Thanks
Florent

rfay’s picture

Title: How to translate in other langage (best practice) » Fix up strings that are not translatable
Category: support » bug

The way to get it added *soon* is to create a patch that fixes as many of the problems as you can. Then I don't have to do all the work. All I have to do is review it and test and commit.

The first item is clearly a mistake that it doesn't have t() around it.

However, the second one should work if you use the exact string that is the first argument of the t(). So the string to use in stringoverrides is
%item was added to your cart. <br/><em>!link</em>

I'm changing this to a bug. Had hoped that somebody would have addressed this by now.

lentreprenaute’s picture

Thanks again Rfay,

it' hard for me to help, i don't have the skills and my english is not perfect :o). So i have others questions ou suggestions. Hope that i'm not boring :o)

for this case, t() isn't used. i have to turn on locale module for this?
drupal_set_message("Cart quantity updated to $actual_quantity");

Florent

rfay’s picture

That one is terribly wrong. It should be:

drupal_set_message(t("Cart quantity updated to %quantity", array('%quantity" => $actual_quantity));

See http://api.drupal.org/t

Thanks,
-Randy

lentreprenaute’s picture

read t() function last night! in a excellent book ( apress, Pro drupal development)

if you check your file, you have the same error in one or two others cases.

regards,
Florent

rfay’s picture

Hi Florent - I'm glad you read up on the t() function... Now you need to understand about Drupal and contributed modules. It's not "my module", it's "our module". I spend more time with it than anybody else, but if you want to make it better, use your new knowledge to create a patch and contribute it.

Welcome to Amazon Store development!

There is no "they" in Drupal. Saying "They ought to..." just doesn't make it happen. This is a do-ocracy, as webchick says. What people do is what gets done.

rfay’s picture

I think these specific examples are all fixed, and I took a look through looking for others in the process of doing #671682: Localization errors should be corrected.

Thanks for the help, all.

rfay’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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