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.
Re: 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.
1 Attachment(s)
Re: 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?.
Re: 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:
Code:
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.
Re: 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)
Code:
// 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.
Re: configuration menu detail item in the admin panel
Well I never knew that!
Is this documented?
Re: configuration menu detail item in the admin panel
If I had the time/need, I would expand this
https://github.com/torvista/zen-cart...tion-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...
Re: configuration menu detail item in the admin panel
Quote:
Originally Posted by
torvista
Well I never knew that!
Is this documented?
I'm afraid it hasn't been documented yet
Re: configuration menu detail item in the admin panel
Quote:
Originally Posted by
torvista
If I had the time/need, I would expand this
https://github.com/torvista/zen-cart...tion-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:
Code:
<?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
Re: 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:
Code:
/** Konfigurasi Dalam Bahasa Indonesia **/
define('CFGTITLE_STORE_NAME','Nama Toko');
define('CFGTITLE_STORE_OWNER','Pemilik toko');
...
...
and
Code:
define('CFGDESC_STORE_NAME','Nama toko saya');
define('CFGDESC_STORE_OWNER','Nama pemilik toko saya');
Re: configuration menu detail item in the admin panel
Quote:
Originally Posted by
torvista
If I had the time/need, I would expand this
https://github.com/torvista/zen-cart...tion-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
Code:
// 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');
Re: configuration menu detail item in the admin panel
Quote:
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.