Jump to content

Translation Breaks The Admin Tabs Menu

Recommended Posts

please for better understanding check here

.But i thought to report it and here.

Briefly:when i import a new language the admin menu backoffice tabs wont translate so after some searcing . . .
i found the bug but i dont know how to fix this!
the tab_lang table from the database seems to have the same values no matter if the lang_id is different!!!
so what can we do about it !?
for instance ( this is what phpmyadmin gave me . . . )

. . .
`id_lang` int(10) unsigned NOT NULL,
`id_tab` int(10) unsigned NOT NULL,
`name` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id_tab`,`id_lang`)

-- 'Αδειασμα δεδομένων του πίνακα `ps_tab_lang`

INSERT INTO `ps_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(1, 1, 'Catalog'),
(1, 2, 'Customers'),
(1, 3, 'Orders'),
(1, 4, 'Payment'),
(1, 5, 'Shipping'),
(1, 6, 'Stats'),
(1, 7, 'Modules'),
(1, 8, 'Preferences'),
(1, 9, 'Tools'),
(1, 10, 'Manufacturers'),
(1, 11, 'Attributes and groups'),
(1, 12, 'Addresses'),
(1, 13, 'Statuses'),
(1, 14, 'Vouchers'),
(1, 15, 'Currencies'),
(1, 16, 'Taxes'),
(1, 17, 'Carriers'),
(1, 18, 'Countries'),
(1, 19, 'Zones'),
(1, 20, 'Price ranges'),
. . . . .. .

and some records below we find . . .

(3, 1, 'Catalog'),
(3, 2, 'Customers'),
(3, 3, 'Orders'),
(3, 4, 'Payment'),
(3, 5, 'Shipping'),
(3, 6, 'Stats'),
(3, 7, 'Modules'),
(3, 29, 'Employees'),
(3, 8, 'Preferences'),
(3, 9, 'Tools'),
(3, 60, 'Tracking'),
(3, 10, 'Manufacturers'),
(3, 34, 'Suppliers'),
(3, 11, 'Attributes and groups'),
(3, 36, 'Features'),
(3, 58, 'Image mapping'),
(3, 66, 'Tags'),
(3, 68, 'Attachments'),
(3, 12, 'Addresses'),
(3, 63, 'Groups'), .
. . . .etc etc .. .

Basically i'm qurious about 2 things
1.why this is not updated (the lang 3 records i mean)?
2.why is this so messy?i mean the records are added kind strange here.
e.g 3,4 3,5 3,6 3,7 and then it jumps to 3,29 . . .

I can fix this by altering the table values but where's the real bug?


Share this post

Link to post
Share on other sites
  • 5 months later...

Because Import / export Lang does not actually do anything with the database but rather it is only related to the hard coded lnguage files in your pretashop

the export lang gets 2 variables ( the lang ID) and the theme ID, based on this it collects all the files with the name ID.php from the locations that prestashop expexts the language files in ,
and this is why the langID.gz file you are getting (forr example en.gz) is an archive of all the en.php files scatered all over the site
, and the import works backwords , you select the lanng package to import and thhe only thing BackOffice does is to extract the archive and put each file in this archive in its prospective prosition ,

but the tab does work diffrently , translation of the tabs does not come directly from those langID.php files , it comes stright from the database dependinng on the lang_id you are currently using,
for example if you have fr and en in your site and you are displaying the en lang that means that some parts will be translated based on the lang_id from the database ( the system will get the record ID and sshow the value corresponding to this ID only when lang_id=1 (remember lang-id 1= en, 2=fr this information comes from the database because it is expecting very dinamic type of data, ex products, categories etc.. items that you could end up having thousands of .

as for the basic layout of the page the design doesnt expect that many because they are as dinamic as your layout regardless of the ammount of data you have in your store (producs, catigories, suppliers, manucaturers etc...), so those language translations are stored in predefined files each file have the name LANG.php (en.php, fr.php, es.php) like the language files inside the modle directory,
each modle would have its own set of language files , each barinng the 2 leters name of the language or fot eh case of the MAIL directory you will have a subdirectory that bares the name of the language prestashop/mail/en/filename.php ( in the prestashop/mail/en and prestashop/mail/fr/ you will have the same files with the same nnames the only diffrence is that the files in the en directory have ennglish dfinitions, and the corresponding file in the fr directory has the difinition for the same variable in frensh,

you are right about the fact that import and exporting of a langauge at least shold extract the ps_tab_lang table while exporting and sump them back into the database when importing , but it isnt that simple because as the import does only extract files into your prestashop installation directory , it doesnt need to verify if the language you are importing is actually a language youu allready have on your prestashop

if you only have en fr and es, you can eazily import a hebrow or arabic or even chinees language pack and it wont effect your prestashop or make anything diffrent because it will be only adding ar.php files and ar directories, or hr or ch , whitch will never be refrenced of called during run tume unless you have a language installed in your site with the corresponding 2 leters name

Share this post

Link to post
Share on other sites
please for better understanding check here

Basically i'm qurious about 2 things
1.why this is not updated (the lang 3 records i mean)?
2.why is this so messy?i mean the records are added kind strange here.
e.g 3,4 3,5 3,6 3,7 and then it jumps to 3,29 . . .


the answer to Q#1 : because you imported a language pack files ( but have not installed the language ), installing the language has to be done manulally by adding a new language from the tools->> lang and tools->>translation

the answer for Q#2 : because this is the sequence that all the tabbs ware added initially , it isnt really missy , but in this table seqence doesnt really matter at all , it is only seqences according to the order the tabs ware entered ( remember during the initial phase of development there ware alot of trials and errors and modifications ) and adding new tab whenever the designer / developer needed, they didnt decide to put all the tools tab in order then all the prefrences tabs then all the category tabs , it evolved as an addhock thats why it apears to be out of logical order and jumps from tab id 26 to tab_id 68

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
  • Create New...

Important Information

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