Jump to content

[MODULE] Translate back office tab texts and other texts in the database (version 1.3)


presta-dyr
 Share

Recommended Posts

The first time I installed PrestaShop I added the Danish translations and was pleased to see how the texts in the front office and the back office suddenly changed. But I was wondering why the tab texts in the back office were not translated. Also the category "Home" and the names of the countries were still in English.

So for a while I have been playing with the idea of a module that would allow translation of all the texts via the tools->translations menu. The texts in the database are in English, French and Spanish and origins from db_settings_lite.sql.

I have finished the module and translated the texts to Danish. It was pretty boring to translate the 244 countries but I still think it was worth the effort. With the module I have supplied the Python script I used to extract the texts from db_settings_lite.sql.

I'm pretty sure the module won't damage your database but in any case you should backup before trying this module.

To make this module better I need support for more languages than just Danish. So if you will spend some time translating the tabs etc. to your language please send your contribution to me so I can update the module.

Install the module and go to tools->translations. Select module translations and click the relevant flag. The texts I want you to translate is in the section "tabtranslate". Be careful not change the ISO code for the language (e.g. changing "nl" to "NL" causes problems).

 

Click here to get the newest module (now support for PrestaShop 1.6).

Edit 2010-08-05: Now with Swedish texts thanks to kungfumunchkin.
Edit 2010-08-25: Now with Dutch texts thanks to deech123.

/Kjeld

tabtranslate_0.4.zip

Edited by presta-dyr (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Thank you for this great contribution which I think is absolutely useful.

Need a few days to finish 387 x 2 fields for both traditional Chinese and simplified Chinese. Will be back with the files.

A minor bug:

 // should be logo.gif here. 



p.s. Do you use two whitespaces as one indent in those files by the way, as I just notice this sematic. I am wondering where I can define it for Python programming, interpreter or IDE. I assume the latter...Sorry if this is a bit off-topic.

Share this post


Link to post
Share on other sites

Thanks for the bug report. I will update it soon.

I'm not quite sure what you mean about defining indent for Python. I tried to sent you a PM but it seems I can't do that since your ID is a number.

/Kjeld

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Hi,

I found an error.
I made the Dutch translations, but after I did this , my special block is set back to English and my contactform is also English again.
When I look at the module blockspecials, all translations are there, so I think you have double entries on that.

can somebody check this out?

thx

Share this post


Link to post
Share on other sites

jolvil wrote:

I'm not sure you need to translate countries in your language, if your
customer comes from another country than yours, he will not speak danish
language but is own language or at least english name of country.


I get your point. But as you know language and country are two separate things. That's why PrestaShop finally changed the language ID from ISO codes for country to ISO codes for language.

I have customers from Greenland and Faroe Islands. They have their own language but also speak Danish. So they expect their country to appear as Grønland and Færøerne.

Also, when you setup zones etc. in the back office, it's nice to see the country names in Danish.

This module is for PS 1.3 (see the subject).

/Kjeld

Share this post


Link to post
Share on other sites

The problem with the Dutch translation is weird enough something that is happening to me as well. It is bugging me for a couple of days now. My test shop is running and some parts are translated correctly in to Dutch (about 80%) but some pages in the order process not, and some details (after selecting a category) still show up in English (Cart & View) below the products.

Anybody? Here you can find my testshop: click

Share this post


Link to post
Share on other sites

Dank Kjeld!

(LOL I think Dank must be thanks in Danish, but it did not work for me yet, maybe I am doing stuff totaly wrong I don't know. I will wait for more people to respond, but thanks again Kjeld!

Share this post


Link to post
Share on other sites

Guzzman,

the bug was not the suhosin.
I had contact with Presta-dyr and he told me he solved the problem.
so I will test this again offline first and let you know.

but it will not be in the first 4 days.


Okay, please let me know. The only new thing I found out is that it doesnt happen with the original prestashop template...

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 1 month later...

Install your own language (you probably already have) and install the module. Then go to the tools->translations function and for "module translations" click your flag. Locate tabtranslate and translate all the texts (countries etc.). When you're done please e-mail me the new language file from modules/tabtranslate.

/Kjeld

Share this post


Link to post
Share on other sites

Install your own language (you probably already have) and install the module. Then go to the tools->translations function and for "module translations" click your flag. Locate tabtranslate and translate all the texts (countries etc.). When you're done please e-mail me the new language file from modules/tabtranslate.

/Kjeld


After install, and translate some word, after that I install new module which have install new Tab on BO, I found you load file db_settings_lite.sql for you module instead you load Table on database.

So, all word of the new module can not effect with your module.
Anyway that is nice module.

If you can change code that allow translate all word which was creat by moudle "installModuleTab" then that is one of GREATEST MODULE.
At that time we only translate some word which don't have in file db_settings_lite.sql instead translate all word for all language at present

I hope you can understand my ideal bcs my English not well :-).

Share this post


Link to post
Share on other sites

The list of words and sentences are based on the contents of db_settings_list.sql. I base my module on PrestaShop version 1.3.1.1. If you are using version 1.3.2.3 there are a few entries that are changed. Is that what is causing problems?

/Kjeld

Share this post


Link to post
Share on other sites

The list of words and sentences are based on the contents of db_settings_list.sql. I base my module on PrestaShop version 1.3.1.1. If you are using version 1.3.2.3 there are a few entries that are changed. Is that what is causing problems?

/Kjeld


Dear Kjeld,

I mean, I want change your below code:
.....
$table = new StdClass();
$table->name = 'configuration_lang';
$table->fields = array('id_configuration', 'id_lang', 'value', 'date_upd');
$table->flags = array(0, 0, 1, 0);
$table->data = array(
array(A, 1, $this->l(B, true), $now), // some sentences code can do like that
$tables[] = $table;
.......
With A is all of number (A = i+1) in 'id_configuration' and B is any words or sentences in 'value'
Purpose to auto load all number on 'id_configuration' and any words or sentences in 'value' after that we translate to new language

Instead:
.....
$table = new StdClass();
$table->name = 'configuration_lang';
$table->fields = array('id_configuration', 'id_lang', 'value', 'date_upd');
$table->flags = array(0, 0, 1, 0);
$table->data = array(
array(36, 1, $this->l('IN', true), $now),
array(38, 1, $this->l('DE', true), $now),
array(46, 1, $this->l('a|the|of|on|in|and|to', true), $now));
$tables[] = $table;
.......


If you can do that your module can run all PS's ver and can modified any new words or sentences after install any new module.

Ideal like that. You can do that? If not? I will do this problem in the near day. I hope so, bcs I'm not good coder
Tks

Share this post


Link to post
Share on other sites

  • 2 months later...

I'm having a little bit of trouble to use your module, I have added a new language "Português (Portuguese)" with ISO code "br", uploaded the translation and set it as the default language, then installed your module and translated the tabs, my problem is that the language "Português (Portuguese)" had its to ISO code changed to "us" and I can't get it right again...

I'm using the lastest stable version - 1.3.3.0

Share this post


Link to post
Share on other sites

  • 4 months later...
  • 3 years later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More