If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / translate configuration menu detail item in the admin panel

translate configuration menu detail item in the admin panel

Started by ihangat2000 on 8 Jul 2020, 6:46 PM · Views: 4,456

Results 1 to 12 of 12
8 Jul 2020, 6:46 PM
#1
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

translate configuration menu detail item in the admin panel

Is there an easy way to change the language of the configuration menu detail item in the admin panel when selecting language through the select language dropdown?

Currently it can be done via SQL Update in the Admin menu > Tools > Install SQL Patces.

9 Jul 2020, 1:40 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

Language files that have defines associated with the language to be displayed is the way to go to display items in the admin menu in the language selected in the admin screen.

There should be plenty of information on this in the docs site... click the button above and search perhaps on admin language.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Jul 2020, 11:58 AM
#3
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

Attachment 19080

Thank you for the response.
When changing languages via the Choose Language dropdown, the Title under the Configuration menu cannot be changed through the language file.
Currently this can be done via the menu: Tools> Install SQL Patches.

Emmm ...
How to run SQL commands automatically when the change dropdown choose language event?.

9 Jul 2020, 12:32 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

There should be a define in YOUR_ADMIN/includes/languages/YOUR_LANGUAGE.php
For such headings. As pictured above it would be:

define('BOX_CONFIGURATION_MY_STORE', 'My Store');

Note that using the database to store that value would result in it always being in that language because there is no "language" switch in an associated database field to know/detect which language is to be displayed...

If it has been hard coded somehow in the database to be just that english value, then the store has been modified to support that instead of using the flexibility of the language system.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Jul 2020, 3:22 PM
#5
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

Ok, thanks, it seems like I've found a way without updating the SQL Patch, and this is explained in the file:
admin/configuration.php

line number: 153-163
(zen cart v.157)

                  // multilanguage support:
                  // For example, in admin/includes/languages/spanish/configuration.php
                  // define('CFGTITLE_STORE_NAME', 'Nombre de la Tienda');
                  // define('CFGDESC_STORE_NAME', 'El nombre de mi tienda');
                  if (defined('CFGTITLE_' . $item['configuration_key'])) {
                    $item['configuration_title'] = constant('CFGTITLE_' . $item['configuration_key']);
                  }
                  if (defined('CFGDESC_' . $item['configuration_key'])) {
                    $item['configuration_description'] = constant('CFGDESC_' . $item['configuration_key']);
                  }
                  ?>

and I have tried, it works.

10 Jul 2020, 6:31 AM
#6
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: translate configuration menu detail item in the admin panel

Well I never knew that!

Is this documented?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Jul 2020, 8:02 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: translate configuration menu detail item in the admin panel

If I had the time/need, I would expand this

https://github.com/torvista/zen-cart_list-configuration-constants

to create a list of those new constants to paste into that file.

You also could do something clever with the output as texts to get them in/out of Google translate as a first pass attempt, maybe...

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Jul 2020, 11:42 AM
#8
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

torvista:

Well I never knew that!

Is this documented?

I'm afraid it hasn't been documented yet

10 Jul 2020, 11:59 AM
#9
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

torvista:

If I had the time/need, I would expand this

https://github.com/torvista/zen-cart_list-configuration-constants

to create a list of those new constants to paste into that file.

You also could do something clever with the output as texts to get them in/out of Google translate as a first pass attempt, maybe...

Wow its auto create constant file like this:

<?php //2020-07-10 13:54:29
//$show_configuration_values = false
define('STORE_NAME', '');			//configuration_id=1 - Nama Toko
define('STORE_OWNER', '');			//configuration_id=2 - Pemilik toko
define('STORE_TELEPHONE_CUSTSERVICE', '');			//configuration_id=3 - Telepon - Layanan Pelanggan
define('STORE_COUNTRY', '');			//configuration_id=4 - Negara
define('STORE_ZONE', '');			//configuration_id=5 - Daerah
define('EXPECTED_PRODUCTS_SORT', '');			//configuration_id=6 - Urutan Sortir yang Diharapkan
define('EXPECTED_PRODUCTS_FIELD', '');			//configuration_id=7 - Bidang Sortir yang Diharapkan
...
...

cool

10 Jul 2020, 12:49 PM
#10
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

It would be better if the code directly makes a prefix:
CFGTITLE_
and
CFGDESC_
like the code below:

/** Konfigurasi Dalam Bahasa Indonesia **/
define('CFGTITLE_STORE_NAME','Nama Toko');
define('CFGTITLE_STORE_OWNER','Pemilik toko');

...
...

and

define('CFGDESC_STORE_NAME','Nama toko saya');
define('CFGDESC_STORE_OWNER','Nama pemilik toko saya');
10 Jul 2020, 7:28 PM
#11
ihangat2000 avatar

ihangat2000

New Zenner

Join Date:
Mar 2012
Location:
yogyakarta, indonesia
Posts:
16
Plugin Contributions:
2

Re: translate configuration menu detail item in the admin panel

torvista:

If I had the time/need, I would expand this

https://github.com/torvista/zen-cart_list-configuration-constants

to create a list of those new constants to paste into that file.

You also could do something clever with the output as texts to get them in/out of Google translate as a first pass attempt, maybe...

Hi Zen Cart Team,

I am looking for ways to change the language in the admin panel for, for all configuration items I have managed to change (through the language file),
it's just that the title and description of each configuration is still unsuccessful. Data title and description of the configuration
stored in the configuration_group database table.

For the configuration title I found the constants defined in the language file (english.php) line: 93-119,
it's just that I didn't find the code that uses that definition in all .php files in the admin folder.

As for the Constants Description configuration I did not find it.

Please give instructions on how to change the language in this configuration via the select language dropdown control.

Fill in the English.php file line: 93-119

// configuration box text
define('BOX_HEADING_CONFIGURATION', 'Configuration');
define('BOX_CONFIGURATION_MY_STORE', 'My Store');
define('BOX_CONFIGURATION_MINIMUM_VALUES', 'Minimum Values');
define('BOX_CONFIGURATION_MAXIMUM_VALUES', 'Maximum Values');
define('BOX_CONFIGURATION_IMAGES', 'Images');
define('BOX_CONFIGURATION_CUSTOMER_DETAILS', 'Customer Details');
define('BOX_CONFIGURATION_SHIPPING_PACKAGING', 'Shipping/Packaging');
define('BOX_CONFIGURATION_PRODUCT_LISTING', 'Product Listing');
define('BOX_CONFIGURATION_STOCK', 'Stock');
define('BOX_CONFIGURATION_LOGGING', 'Logging');
define('BOX_CONFIGURATION_EMAIL_OPTIONS', 'E-Mail Options');
define('BOX_CONFIGURATION_ATTRIBUTE_OPTIONS', 'Attribute Settings');
define('BOX_CONFIGURATION_GZIP_COMPRESSION', 'GZip Compression');
define('BOX_CONFIGURATION_SESSIONS', 'Sessions');
define('BOX_CONFIGURATION_REGULATIONS', 'Regulations');
define('BOX_CONFIGURATION_GV_COUPONS', 'GV Coupons');
define('BOX_CONFIGURATION_CREDIT_CARDS', 'Credit Cards');
define('BOX_CONFIGURATION_PRODUCT_INFO', 'Product Info');
define('BOX_CONFIGURATION_LAYOUT_SETTINGS', 'Layout Settings');
define('BOX_CONFIGURATION_WEBSITE_MAINTENANCE', 'Website Maintenance');
define('BOX_CONFIGURATION_NEW_LISTING', 'New Listing');
define('BOX_CONFIGURATION_FEATURED_LISTING', 'Featured Listing');
define('BOX_CONFIGURATION_ALL_LISTING', 'All Listing');
define('BOX_CONFIGURATION_INDEX_LISTING', 'Index Listing');
define('BOX_CONFIGURATION_DEFINE_PAGE_STATUS', 'Define Page Status');
define('BOX_CONFIGURATION_EZPAGES_SETTINGS', 'EZ-Pages Settings');
11 Jul 2020, 6:55 AM
#12
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: translate configuration menu detail item in the admin panel

It would be better if the code directly makes a prefix:
CFGTITLE_
and
CFGDESC_
like the code below:

It would be better for your requirements if it could also, optionally,produce the output in that format.

That's why it's on Github: feel free to make it better.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...