Hello, I want to translate store into my language. Can you tell me what files are responsible for language version. Thank you.
Translation
|
|
ok, I found .po files and translate some of them in msgstr lines. But how to install this translation ?
I have just imported the content of the .po files via the locale module in drupal. it works.
Awesome... sorry we weren't any help. I've actually never done any translation, but I'm glad you were able to work it out! If you have any tips for others or any program you're using, feel free to post it up here.
Hey Ryan
I'm the guest in the above post, joined in the meantime.
Übercart is cool! I plan on using it on a shop for specials here in switzerland starting in september...so time is running.
The translation I have downloaded from ubercart.de is good but not completely suited to switzerland as we are using slightly different terms. Is there a list of which strings are used where in Ubercart? with such a thing I could adapt some strings in the .po files to read them in again.
One more thing: when the user manipulates the cart, the status string goes 'your cart has been updated' in english. where can i change that?
thanks for the help and keep up the good work.
Chris
Hey Pomp.
Go to "Localization" -> "Import" and select ur local .po file.
greetings
M
The "Your cart has been updated." string is a translatable string in uc_cart.module. You should be able to adjust this w/ the localizer, but I'm not expert on localization. The .po files we've shipped with Ubercart are bound to be outdated.
i'm also using übercart on a bi-lingual site. most of the strings translated fine, except i'm having trouble with the text that can be set in admin/store/settings/checkout like "Next", "Review Order", "Submit Order", etc.
has anyone else had similar problems or know what the fix to this might be?
The particular strings you mention ("Review order", "Submit order") are actually not in the localization tables. They are stored and fetched in the variables table (at least a couple of releases ago). I did a quick "fix" by adding some t() functions in the cart module so that I could translate those strings.
Hope that helps.
______________
Thomas Kulvik
Ny Media AS
www.nymedia.no
@ Ryan:
"The .po files we've shipped with Ubercart are bound to be outdated" When can we expect uptodate ones? Now every user of Ubercart is translating on-the-fly by using Drupal's translation interface, without having easy options of sharing it with others.
Could you please provide complete, correct and future proof PO/POT files for sharability sake of the translations? This also makes the translation task more delegable between translators.
Future-proof .po files will be hard to come by until we get a stable release, and we're still several releases away from that. Keeping them up to date has to be the responsibility of the Übercart community because none of know anything besides English. (I may do an Esperanto translation at some point, if I get enough of a vocabulary and free time.) We're going to update the .pot files with each release to make the translation job easier, and any changes will hopefully be easy to find.
Clear, I understand, thanks.
hey kulvik, thanks for your reply. i took a look in the cart.module and didn't manage to get those strings working. could you please be a bit more specific about what you did?
here is an example of one of the strings that isn't working as expected:
t('Next buttons on checkout panes say %text.', array('%text' => variable_get('uc_checkout_next_button', t('Next')))),here, %text should be 'Next' in english and 'Suivant' in french, but it always reads 'Next', even though the 'Next' string has been translated. it works if i change it to this:
t('Next buttons on checkout panes say ') . t('Next'),but that seems like a huge change to the code...
Maybe that line should be
<?php
t('Next buttons on checkout panes say %text.', array('%text' => t(variable_get('uc_checkout_next_button', 'Next'))));
?>The problem with this is that the translation string extractor might not have gotten t('Next') from somewhere else, and it is very likely that any particular value for 'uc_checkout_next_button' won't have a translation available. This value isn't likely to change, though, so you could add the translation to fr.po or whatever else you have manually. Repeat for every other time we need to translate a Drupal variable.
The bottom line is that translating user input is a lot of work for each individual site.
gee, lyle, it's kinda spooky how you can do that. that code is exactly what i needed to fix the problem, thanks!

augh, i'm trying to use this method to get the 'title' values on /admin/store/settings/orders/edit/workflow to translate, but to no avail. has anyone managed to translate the order statuses ('pending', 'processing', etc)?
anyone? anyone? bueller? anyone?
I also opt for the possibility of translating the workflow titles.
Shouldn't we post this as an feature request?
I did not check latest release, maybe it's taken care of already.
Kees
Do either the i18n or localizer modules take care of this? I was told that's the solution for translating stored variables.
I don't know localizer.module. I know a little of i18N.module, it works mainly with the t() function for strings, and has it's own implementation for translating blocks, taxonomy and other stuff. The important part is linking translated stuff together (so blockX is known as translation from blockY f.e.).
I don't really understand what you mean by "stored variables". I think as long it's not t() parsed, it's never gonna be translated, but I'm not 100% sure.
I think this is a quit important issue though, thanks for giving it attention.
Regards,
Kees
I'd like to point out that the "Add to cart" string has the problem mentionned for Next.
So I modified 8 lines in product.module and 1 line in product_kit.module
It's not everywhere, it's only in the submit buttons.
I haven't gotten that far as to see the same problem with other things. A lot of strings aren't translated (a good deal of them) in the french translation provided up to beta 1, used on a beta 2 install.
Hopefully the french translation team ( http://drupalfr.org ) can support ubercart as a core module for a special distribution as soon as ubercart 1.0 is out.
Thanks for digging this up, alliax. I think the ultimate solution will be to remove the user interface for customizing the text on these buttons and directing users who want to change these labels to use a module for the translation. As it is right now, Ubercart isn't very friendly for multi-lingual sites. 
Hello,
about the variable translation issue, I think it should work with the internationalization module. Only the i18n module would be needed, not the translation module.
You have to add an array in 'settings.php' containing the names of the variables you want to be translatable. Example :
$conf['i18n_variables'] = array(
'menu_primary_menu',
'contact_form_information',
'site_map_show_menus',
'site_map_message',
'site_name',
);Then, the associated textfields or textareas will be language aware : you enter the text in english, submit, switch language (using the i18n block), enter the translated text, submit and that's it.
I never tested it with ubercart (will soon
), but it should work the same.
That would be excellent! Please let me know if you're able to test this so we can get it in some formal documentation here.
Now this is handy. I'd like to see if there's anything that can be changed by the Übercart modules at install time.
Ok, just tested it :
- installed 'internationalization' module and enabled only 'internationalization' (formerly 'i18n')
- activated 'language switcher' block
- added this code in settings.php :
$conf['i18n_variables'] = array(
'uc_teaser_add_to_cart_text',
'uc_product_add_to_cart_text',
);Then, when I go to product settings, the language beeing set to english :
- the two 'add to cart' textfields are empty.
- the sentence This is a multilingual variable is added in each textfield's description
- enter 'Add to cart' twice, then submit
- switch language
- the textfields are empty
- enter the translated string twice, then submit
- go to a product node, and switch language : the 'Add to cart' button is translated accordingly

So, it works. But a drawback is that, as soon as you make a variable translatable, the default value is ignored (I had to enter 'Add to cart' again).
will investigate this later 
Very exciting development. This is a shot in the dark, but can you do something like:
<?php
$conf['i18n_variables'] = array(
'uc_teaser_add_to_cart_text' => 'Add to cart',
'uc_product_add_to_cart_text' => 'Add to cart',
);
?>
Unfortunately, you can't do such things... this would be too easy 
First, about this kind of code (without using i18n):
variable_get('uc_variable', t('Something'));
It will work as the variable is not initialized (ie not stored in the 'variable' table). Once the form (where the variable is used) is submitted, the provided default value will be ignored "forever", and so it will break translation.
IMHO, you can safely remove those t().
With i18n :
I examined the i18n code and realized that if a variable is initialized, its content will be shown in the multilingual textfield.
In the previous test, I had to type 'Add to cart' again, just because 'uc_product_add_to_cart_text' had not been stored yet.
So, first solution would be :
- Explicitly sets those variables during installation(in 'ubertcart.profile'). For instance:
variable_set('uc_product_add_to_cart_text','Add to cart'); - add the
$conf['i18_variables']in settings.php
This way, if the site in monolingual and not english, users will have to translate those textfields.
If the site is multilingual, users only have to install i18n, and translate textfields (which will be populated with the values set during install process).
Then, we could do a little better, by using the 'st' function :
variable_set('uc_product_add_to_cart_text', st('Add to cart'));
This would improve the monolingual case : variables initial values could be translated via .po files.
Will test the latter and report...
Very interesting. Thanks for your continued help and for the nice little write-up. 
I wonder... does anyone have experience or can they test out the following project in a multilingual setting?
http://drupal.org/project/translatable
It looks like it will do exactly what kulvik's been wishing we'd do all along. 
If i understand correctly, multi lingual stores are impossible with ubercart ,
for example because of the link "add to cart"
Hi,
Drupal/Ubercart based projects can be entirely multilingual. It could happen that you encounter strings that aren't translatable. This would be a bug. please post an issue for that. I did not encounter untranslatable strings in the end-user part of the interface in recent Ubercart versions.
Good luck,
Kees
During the development of a multilingual Ubercart store I found a couple of non-multilingual strings.
These were Ubercart variables which provide customizations:
- Order statuses (Completed, Canceled, ... etc.)
- Address fields (First name, Last name, ... etc.)
- Product attributes
The first two category of strings are available in pot files but these aren't stored in the {variable} table and thus cannot be converted to a multilingual variable via i18n module. For example Order status real values reside in {uc_order_statuses} and it can only get value for one language.
Is there any other way to make these working without re-writing for ex. the uc_order.module corresponding functions?
Forgot to mention that I'm talking about Drupal 5.x here.
|
|








Joined: 08/08/2007