Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default 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.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default Re: configuration menu detail item in the admin panel

    Name:  Snap 2020-07-09 at 18.45.32.png
Views: 571
Size:  53.4 KB

    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?.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default 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.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: configuration menu detail item in the admin panel

    Well I never knew that!

    Is this documented?
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  7. #7
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default 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...
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  8. #8
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default Re: configuration menu detail item in the admin panel

    Quote Originally Posted by torvista View Post
    Well I never knew that!

    Is this documented?
    I'm afraid it hasn't been documented yet

  9. #9
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default Re: configuration menu detail item in the admin panel

    Quote Originally Posted by torvista View Post
    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

  10. #10
    Join Date
    Mar 2012
    Location
    yogyakarta, indonesia
    Posts
    16
    Plugin Contributions
    2

    Default 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');

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 Add Admin configuration menu item (again)
    By reetp in forum Contribution-Writing Guidelines
    Replies: 13
    Last Post: 7 Mar 2017, 10:45 PM
  2. v154 missing configuration menu options in admin panel, in dutch
    By annedien in forum Upgrading to 1.5.x
    Replies: 4
    Last Post: 23 Sep 2015, 08:38 AM
  3. v154 Configuration tab doesnt work in the admin panel
    By Awalji in forum Basic Configuration
    Replies: 1
    Last Post: 23 Jun 2015, 08:15 PM
  4. Replies: 13
    Last Post: 3 Jul 2013, 03:51 PM
  5. Replies: 9
    Last Post: 9 Mar 2009, 08:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR