Jump to content

BUG FIX - Editing Language Phrases


bsmither

Recommended Posts

In admin, Languages, one can change the phrases that are used throughout the store.

 

I just tried to change "No products found." (a phrase that appears on the View Category page when there are no products assigned to that category) to nothing (called a 'zero-length string'). When the list of phrases was redisplayed, the edited phrase was still as it was originally. So, I think it's a bug.

 

All this works fine in CC515 (actually, last I checked in CC514).

 

From my experiments, attempting to edit any phrase in CC52X should have not worked as expected.

 

In the file /admin/sources/settings.language.inc.php, near line 22, find:

if (isset($_POST['save']) && isset($_POST['string']) && Admin::getInstance()->permissions('settings', CC_PERM_EDIT)) {
    ## Load all existing language strings
    $GLOBALS['language']->loadDefinitions($_GET['language']);
    $base_strings = $GLOBALS['language']->loadLanguageXML($_GET['language']);

Change it to:

if (isset($_POST['save']) && isset($_POST['string']) && Admin::getInstance()->permissions('settings', CC_PERM_EDIT)) {
    ## Load all existing language strings
    ## $GLOBALS['language']->loadDefinitions($_GET['language']); // Probably not needed at all.
    $base_strings = $GLOBALS['language']->getLanguageStrings(); // does not fetch what we need: loadLanguageXML($_GET['language']);

Please watch for any anomalies, such as a UK admin in a US store editing a UK language set. (That was a bug fixed at about CC508.)

Link to comment
Share on other sites

I tried it and it worked perfectly. It's been so long since I changed any wording I didn't realize it wasn't working anymore.

 

I put the content.category.php no category found code back to normal, and as long as the no_products line in the Language phrase section of Admin is blank, it works as it should - not showing anything if the category has subcategories, but no items in the parent category only.

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

By now, I think the problem of the language being edited has been fixed.

 

So, in admin, Languages, click on the Edit icon for the language you want to change, choose Category from the selector, and empty the field for 'no_products'. Click Save. Test.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...