benjAeby Posted August 30 Share Posted August 30 (edited) Hello, I use cubecart since 2017 for an artisanal bio soap company (https://www.savonnerie-neptune.ch/) with 2 languages : french and german. I now have issue with language : only the english common sentences are displayed, regardless to the selected language. Document and product details are ok in the selected language. I already tried: - clear caches - changed default language for cubecart - reinstall languages packs + add english US for tests - checked the config (b64 encoded) : all seems ok, english, french and german are in the json string, active. - changed the skin (foundation -> basix -> foundation -> tweaked basix...) - Cubecart is up to date : 6.5.1. Could someone help me to debug this? Regards Edited August 30 by benjAeby Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 30 Share Posted August 30 You said, "english, french and german are in the json string". I do not see the list of enabled languages as part of the general configuration setting string. In admin, Languages, confirm the Status setting of all installed languages. Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Hi, In the admin/languages: - French and German are enabled. - English UK and English are disabled. On front-end, flags and language is OK and documents are displayed in the selected language. The issue is about all common sentences ("Shop by category"...) in English only. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 CubeCart should load the language strings from definitions.xml (which are UK-based), then overload that array with strings found in the chosen language pack. (Note that the "en-US.xml" file has only five strings for common US terms.) The language packs are not kept up to par as new strings are added to definitions.xml (for new features). But more than 99% of the language strings are common all the way back to CC5 - so, very nearly all of present-version CubeCart should show the correct language strings. One would need to do a deep dive into the CubeCart code to see if/where the problem lies. I see that your skin (savonnerieNeptune) is derived from Basix. Please post the contents of the skin's template "box.search.php" (use a code window - the <> tool on this editor will show a code editing box). Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Here is the content of box.search.php (unmodified from Basix): {* * Basix CubeCart Template * ======================================== * Basix is a template developed by NiteFox * also known as NiteTower Design. * ======================================== * Web: https://www.facebook.com/CubeCartThemes * Email: nitetowerdesign@gmail.com * License: http://nitefox.x10host.com/license.html * Disclaimer: http://nitefox.x10host.com/disclaimer.html *} <form action="{$STORE_URL}/search{$CONFIG.seo_ext}" class="search_form" method="get"> <div class="input-group search_container"> <input name="search[keywords]" data-image="true" data-amount="15" type="text" class="form-control search_input{if $CONFIG.elasticsearch=='1'} es{/if}" placeholder="{$LANG.search.input_default}" autocomplete="off" required> <div class="input-group-btn"> <button class="btn btn-default" type="submit" value="{$LANG.common.search}"><i class="fas fa-search"></i></button> </div> </div> <input type="hidden" name="_a" value="category"> </form> Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 (edited) So, this is from the skin "savonnerieNeptune" - which is based on Basix, and has had no customizations made to it. Then, we need to find why the Smarty variable $LANG has arrays that are not correct. Please use an external database utility to directly view the table CubeCart_lang_strings. (Your hosted account's control panel should have phpMyAdmin to do this.) How many rows of data are there, and if there are any, do the phrases in the 'value' column not match the language code in the 'language' column? Please examine the file in /language/ folder named 'de-DE.xml'. Please post the first 40 lines into a code window. Is there any other file in the /language/ folder that has de-DE in the filename? Edited August 31 by bsmither Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 The table "CubeCart_lang_strings" has only one row. This row is the german value for "Add to basket" -> "Hinzufügen", which is displayed correctly when german language is selected. Here are the 40 first lines of "de-DE.xml": <?xml version="1.0" encoding="UTF-8"?> <!-- * CubeCart v6 * ======================================== * CubeCart is a registered trade mark of CubeCart Limited * Copyright CubeCart Limited 2014. All rights reserved. * UK Private Limited Company No. 5323904 * ======================================== * Web: http://www.cubecart.com * Email: [email protected] * License: GPL-2.0 http://opensource.org/licenses/GPL-2.0 --> <language version="2.0"> <info> <title><![CDATA[Deutsch]]></title> <code>de-DE</code> <character_set>utf-8</character_set> <version>2.0.0</version> <minVersion>5.0.0</minVersion> <maxVersion>6.*.*</maxVersion> <default_currency>EUR</default_currency> <text-direction>ltr</text-direction> <override/> </info> <translation> <group name="account"> <string name="already_registered"><![CDATA[Bereits registriert?]]></string> <string name="contact_details"><![CDATA[Kontaktinformationen]]></string> <string name="create_account"><![CDATA[Ich möchte ein Benutzerkonto anlegen]]></string> <string name="download_count"><![CDATA[Downloads]]></string> <string name="download_deleted"><![CDATA[Dieser Download ist nicht mehr verfügbar.]]></string> <string name="download_expired"><![CDATA[Abgelaufen]]></string> <string name="download_expires"><![CDATA[Läuft ab]]></string> <string name="enter_validation_key"><![CDATA[Bitte geben Sie nachfolgend Ihre E-Mail-Adresse und den Verifizierungscode ein und wählen Sie dann ein neues Passwort]]></string> <string name="error_address_added"><![CDATA[Adresse konnte nicht gespeichert werden.]]></string> <string name="error_address_billing"><![CDATA[Bevor Sie fortfahren können, müssen Sie eine Rechnungsadresse eingeben.]]></string> <string name="error_address_delete"><![CDATA[Adresse konnte nicht gelöscht werden.]]></string> <string name="error_address_not_found"><![CDATA[Adresse konnte nicht gefunden werden.]]></string> <string name="error_address_updated"><![CDATA[Adresse konnte nicht aktualisiert werden.]]></string> <string name="error_details_updated"><![CDATA[Ihre Informationen wurden nicht aktualisiert.]]></string> There is one other file with de-DE in the filename : "email_de-DE.xml". Here are the first lines: <?xml version="1.0" encoding="UTF-8"?> <!-- * CubeCart v6 * ======================================== * CubeCart is a registered trade mark of CubeCart Limited * Copyright CubeCart Limited 2014. All rights reserved. * UK Private Limited Company No. 5323904 * ======================================== * Web: http://www.cubecart.com * Email: [email protected] * License: GPL-2.0 http://opensource.org/licenses/GPL-2.0 --> <emails version="2.0" language="de-DE"> <email name="admin.password_recovery"> <subject><![CDATA[Admin-Passwortwiederherstellung]]></subject> <content type="html"><![CDATA[<p>Sehr geehrte/r {$DATA.name},</p> <p>um wieder Zugriff auf die Administrationsbedienkonsole des Shops zu bekommen, folgen Sie bitte dem nachfolgenden Link:</p> <p><a href="{$DATA.link}">{$DATA.link}</a></p> <p>Wenn der obige Link nicht funktioniert, kopieren Sie Ihn bitte in die Adressleiste Ihres Browsers.</p>]]></content> <content type="text"><![CDATA[Sehr geehrte/r {$DATA.name}, um wieder Zugriff auf die Administrationsbedienkonsole des Shops zu bekommen, folgen Sie bitte dem nachfolgenden Link: {$DATA.link} Wenn der obige Link nicht funktioniert, kopieren Sie ihn bitte in die Adressleiste Ihres Browsers.]]></content> </email> <email name="cart.order_complete"> <subject><![CDATA[Bestellung fertiggestellt]]></subject> <content type="html"><![CDATA[<p>Hallo {$DATA.first_name},</p> <p>wir freuen uns, Ihnen mitteilen zu können, dass Bestellung Nummer {$DATA.cart_order_id} fertiggestellt wurde. Wenn Sie materielle Waren bestellt haben, sollten sie in Kürze ankommen.</p>]]></content> <content type="text"><![CDATA[Hallo {$DATA.first_name}, wir freuen uns, Ihnen mitteilen zu können, dass Bestellung Nummer {$DATA.cart_order_id} fertiggestellt wurde. Wenn Sie materielle Waren bestellt haben, sollten sie in Kürze ankommen.]]></content> </email> <email name="cart.order_cancelled"> <subject><![CDATA[Bestellung storniert]]></subject> <content type="html"><![CDATA[<p>Hallo {$DATA.first_name},</p> <p>Bestellung Nummer {$DATA.cart_order_id} wurde storniert.</p>]]></content> <content type="text"><![CDATA[Hallo {$DATA.first_name}, Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 "the database table" ==> Good, seems to be no problem here. "the language file" ==> I have version 1.0.0 - will need to check version 2.0.0. "other files" ==> Good. I expect to see the email file. But no sub-file for that language. When CubeCart sends an email, does the content of that email appear in either de-DE or fr-FR, or do they, as well, appear in English? Does the admin section appear in English as well? Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Emails sent by Cubecart are in french (just checked with last "new order" email). Admin section is in french, which is the default language (Store settings/locale settings/default language) Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 "emails are in french" ==> Good. "admin is in french" ==> Ok, good. In admin, Store Settings, Advanced tab, enable the Debug mode. Enter your local IP address (www.showmyip.com) in the next text entry field. Debug mode will have CubeCart create code that the browser will want to show in a popup-window. Allow the popup. (You may need to close that popup and reload the page to get the correct data to show.) The debug data will show any errors that PHP encountered, and will show some data from SESSION:. In the '__client' sub-array, what is the value for the 'language' key when viewing the storefront. (If using the Firefox browser, you may need to close the popup window before requesting the next page.) Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Here is the beginning of SESSION : SESSION: '__client' => 'ip_address' => ***.***.***.*** 'useragent' => Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 'session_start' => 1693519342 'session_last' => 1693519347 'language' => de-DE 'currency' => CHF 'admin_id' => 2 The language variable is defined I have some php warnings: Quote .../classes/autoloader.class.php:93 - file_exists() [function.file-exists.php]: open_basedir restriction in effect. File(/usr/share/pear/smarty_autoloader.class.php) is not within the allowed path(s): ... Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 "Archive" column? Does it actually say "Archive" or is "Archive" a valid translation of a French word that might also translate to "Records"? Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 I switched to english, Archive is used here as the header for the column "Records". Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 So, the 'language' key says you (admin #2) want to use de-DE, but the admin is actually showing fr-FR? In admin, PHP Info, scroll to the Core table, and find include_path. If /usr/share/pear/ appears in the Local Value or Master Value, the hosting provider support will need to help you resolve the 'open_basedir' conflict. However, I think is not the cause of this issue. Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Core, include_path local and master value are both: .:/usr/share/php I could set 'open_basedir' to none and it has no effect on the language issue Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 In a previous post, I saw a mention of the data shown in the admin, Maintenance, Database tab, CubeCart_lang_strings row. I saw that it said there were 84 records. I do not now see that data. Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Sorry I deleted it. 84 was an obsolete value: using the maintenance tool to "analyse" this table. Number of records has been updated to 1, like in phpmyadmin. Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 Please review the table shown in admin, Error Log, System Error Log tab. Anything of interest here? Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 The errors reported in the log are about open_basedir: [<strong>Warning</strong>] /home/httpd/vhosts/asaeby.ch/savonnerie-neptune.ch/classes/autoloader.class.php:96 - file_exists() [<a href='http://docs.php.net/manual/en/function.file-exists.php'>function.file-exists.php</a>]: open_basedir restriction in effect. File(/usr/share/php/Smarty_Autoloader.php) is not within the allowed path(s): (/home/httpd/vhosts/asaeby.ch/savonnerie-neptune.ch/:/tmp/) Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 31 Share Posted August 31 Ok. I will have instructions later to add some diagnostic data to the core code to find out why the default language is not getting used. Quote Link to comment Share on other sites More sharing options...
benjAeby Posted August 31 Author Share Posted August 31 Thank you very much for your help and time! Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 1 Share Posted September 1 Please list all enabled plugins (admin, Manage Extensions). Please indicate if there are any Code Snippets installed (admin, Manage Hooks, Code Snippets tab). Quote Link to comment Share on other sites More sharing options...
benjAeby Posted September 2 Author Share Posted September 2 (edited) Enabled plugins are: -All in one shipping [1.0.26] - Google analytics [1.1.1] - Paypal commerce platform [1.8.7] - Print order form [1.3.0] No snippets. I have no more open_basedir errors in debug since I set open_basedir to none in hosting settings. All sentences are listed in the admin language edition menu. Modified sentences (records in table Cubecart_lang_strings) are displayed in the selected language. All unmodified sentences are displayed as in definitions.xml Edited September 2 by benjAeby Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 4 Share Posted September 4 Using a programmer's text editor, make the following change to the file /classes/language.class.php: Near lines 234-237, find: public function assignLang() { $GLOBALS['smarty']->assign('LANG', $this->_language_strings); } Change to: public function assignLang() { $GLOBALS['smarty']->assign('LANG', $this->_language_strings); $GLOBALS['debug']->debugMessage('Assigning language strings to Smarty LANG. Example ('.$this->_language.'): '.$this->_language_strings['account']['already_registered'].'<br><pre>'.print_r(debug_backtrace(0),true).'</pre>'); } Be sure to have CubeCart's debug mode enabled. View the Homepage. Near the bottom of the debug window, there will be a section showing Debug Messages:. Copy that section to a reply. (You can reply in a PM if you wish.) Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 6 Share Posted September 6 Hm. We can see that right away CubeCart is told to use fr-FR, but the phrases are not coming from that language pack. (See Debug Messages[0]) Please examine the following and try the suggested action: In admin, Languages, take note of any actual entries in the Domain column (not the slightly greyed-out suggested examples). If there are actual entries, blank them out and Save. Have CubeCart clear its internal cache. Did anything change? 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.