If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Language Packs / Hello from newcomer and help

Hello from newcomer and help

Locked

Started by athens_collectibles on 7 Jul 2010, 7:50 PM · Views: 2,371

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
7 Jul 2010, 7:50 PM
#1
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Post #1 by athens_collectibles

Here is my story and my troubles in setting up a store in Greek (I already have another similar store in english).

I started with nopCommerce which I installed on my site http://athenscollectibles.info hosted by GoDaddy. I struggled for weeks and weeks trying to install and configure a Greek Language Pack written for the previous version and I finally managed to get around the problems. I also managed to solve a number of other issues but I decided to migrate to Zen Cart because:

a) I am not an ASP programmer/developer, just an individual who wants to set up a site for own use. I regret to say that their forums were not helpful at all and user questions were left without a reply for weeks or months or received a reply of the sort "change this to that and compile" or "create a task to perform that". No explanation of where this and that could be found or how to compile or how to create a task. The forum was a "private club" of developers who wouldn't bother to deal with simple people like me. Their forum signature usually called users to PM them for developments, so I assumed that they were not there to help but to gain customers.

b) I purchased the user manual which didn't offer me any knowledge that I couldn't get by hovering the mouse over the various administration options and reading the tooltip.

To cut a long story short, I decided to go for Zen Cart and looked at the forums and Wiki to get an initial impression of how things are there. I found thousands of posts, most of them replied quickly by experts and tons of information in the Wiki, FAQs etc. Although I hadn't faced any problems with GoDaddy's hosting, the comments in the Zen Cart forums made me to decide for a change of host before installing Zen Cart. I selected BlueHost, one of the recommended hosts because of its features, reasonable cost, the numerous good reviews I found about them on the web and my experience with their immediate response to questions I asked before signing up for an account. I'm very happy with the change which was done smoothly and soon had Zen Cart installed by their Simple Scripts application (what puzzles me is that I selected to install with Fantastico but was automatically redirected to Simple Scripts).

End of part 1.

My Zen Cart installation was for the latest 1.3.9d version but couldn't find a Greek Language Pack except for v1.3.8 which I downloaded on the understanding that I would have to do some extra work. I don't know about other language packs but this one didn't have any instructions on how to install it and I had to guess.

Before installing the language pack, I changed the "admin" folder's name as instructed when I first signed on as administrator. I then unzipped the language pack in a folder on my desktop. A couple of unsuccessful attempts to install the language pack left me unable to sign on as administrator and I had to uninstall and reinstall Zen Cart!

I still haven't managed to understand what I need to do to install the language pack. The directory structure of the pack is as follows:

admin

|----- includes

|----- languages

|----- greek

|----- extra definitions

|----- images

|----- buttons

|----- modules

|----- newsletters

includes

|----- languages

|----- greek

|----- classic

|----- extra_definitions

|----- classic

|----- html_includes

|----- classic

|----- images

|----- modules

|----- order_total

|----- classic

|----- payment

|----- classic

|----- shipping

|----- templates

   
|----- template_default
|----- buttons
|----- greek


Of the above files, I copied the red folders only into the /includes/languages folder of my site. The greek.php file starts as below (I have deleted the comment lines) and it looks fine in that it has the locale set to Greek, the correct d/m/y date format etc. I have also left the first few lines showing the Greek definitions:

<?php
/**
 * @package languageDefines
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] GNU Public License V2.0
 * @version $Id: english.php 7440 2007-11-17 21:51:35Z drbyte $
 */

  define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');

  @setlocale(LC_TIME,
	'greek',
	'el_GR',
	'el_GR.iso_8859-7',
	'el_GR.ISO_8859-7',
	'el_GR.utf-8',
	'el_GR.UTF-8'
  );
  define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
  define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
  define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
  define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

  if (!function_exists('zen_date_raw')) {
    function zen_date_raw($date, $reverse = false) {
      if ($reverse) {
        return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
      } else {
        return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
      }
    }
  }

  define('LANGUAGE_CURRENCY', 'Euro');

  define('HTML_PARAMS','dir="ltr" lang="el"');

  define('CHARSET', 'ISO-8859-7');

  define('FOOTER_TEXT_REQUESTS_SINCE', 'αιτήσεις από');

  define('TEXT_GV_NAME','Κουπόνι δώρου');
  define('TEXT_GV_NAMES','Κουπόνια δώρου');

  define('TEXT_GV_REDEEM','Κωδικό κουπονιού');

When I log in as administrator, I see a yellow warning bar on top with the message: "MISSING LANGUAGE FILES OR DIRECTORIES ... Greek Greek". I suppose that this is because I haven't transferred all the folders in the language pack, but I hesitate to do so until I know exactly which folders to transfer and where. I have to point out that the greek.php file in the folder has the locale set to en_US.ISO_8859-1, the date format to m/d/y and all definitions are in English, not in Greek. It starts like this:

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: english.php 7440 2007-11-17 21:51:35Z drbyte $
 */

define('HEADER_ALT_TEXT', 'Admin Powered by Zen Cart :: The Art of E-Commerce');
define('HEADER_LOGO_WIDTH', '200px');
define('HEADER_LOGO_HEIGHT', '70px');
define('HEADER_LOGO_IMAGE', 'logo.gif');

setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', 'MM/dd/yyyy');  //Use only 'dd', 'MM' and 'yyyy' here in any order

function zen_date_raw($date, $reverse = false) {
  if ($reverse) {
    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
  } else {
    return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
  }
}

  if (file_exists(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/meta_tags.php')) {
    $template_dir_select = $template_dir . '/';
  } else {
    $template_dir_select = '';
  }
  require(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . 'meta_tags.php');
//die(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . 'meta_tags.php');

define('ICON_METATAGS_ON', 'Meta Tags Defined');
define('ICON_METATAGS_OFF', 'Meta Tags Undefined');
define('TEXT_LEGEND_META_TAGS', 'Meta Tags Defined:');
define('TEXT_INFO_META_TAGS_USAGE', '<strong>NOTE:</strong> The Site/Tagline is your defined definition for your site in the meta_tags.php file.');

define('HTML_PARAMS','dir="ltr" lang="en"');

define('CHARSET', 'iso-8859-1');

define('HEADER_TITLE_TOP', 'Admin Home');
define('HEADER_TITLE_SUPPORT_SITE', 'Support Site');
define('HEADER_TITLE_ONLINE_CATALOG', 'Online Catalog');
define('HEADER_TITLE_VERSION', 'Version');
define('HEADER_TITLE_LOGOFF', 'Logoff');

  define('TEXT_GV_NAME','Gift Certificate');
  define('TEXT_GV_NAMES','Gift Certificates');
  define('TEXT_DISCOUNT_COUPON', 'Discount Coupon');
  define('TEXT_GV_REDEEM','Redemption Code');

I'm not sure why it's called greek.php when it is in English. If the logic behind the package is that the administration is in English and the front end in Greek, that's fine, because I prefer it this way. However, the contradicting locale settings might be responsible for the next issue (or not):

When I enter a category name or a product in Greek, the editor accepts input in Greek. When the category or product is saved and I enter to edit it again, all Greek characters have been replaced with their codes in the form, for example, & # 9 4 7 ; & # 9 4 8 ; & # 9 6 6 ; & # 9 4 7 ; & # 9 4 8 ; & # 9 6 6 ; & # 9 4 7 ; etc (sorry, I had to enter spaces because they were showing as Greek characters in preview). I suppose that the title and description fields have a maximum length limit. As a result, a category named "Βιβλία" appears as "Βιβλί&#" because the browser converts the codes of the first 5 characters to Greek and then lists &# (which are the string's last characters) as literal characters because it can't convert them. The same happens with the product name "Όνομα προϊόντος" which is rendered as "Όνομα προϊό" because the string exceeds the maximum length and is truncated. The product description seems correct but I'm sure that the same will happen if it's quite long.

All these indicate to me that the category and product editor work in ISO-8859-1 instead of utf-8 and this is where I need some help from expert users or developers in the forum. I know that it's a question of proper configuration of encoding because there are stores set up with Zen Cart which display perfectly.

I attach a few screenshots to show the wrong display and hope that someone will be able to provide a simple to understand magic solution. Until then, I shall remain despaired :wacko:

Thanks in advance for any assistance which will be much appreciated and greetings from Athens together with my apologies for this very long post.

7 Jul 2010, 8:35 PM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Post #2 by frank18

Your very first step is to upload all files from the pack leaving the file and folder structure as is. Make sure that the name of the admin folder in the pack matches the name of your admin folder.

Next, log into your admin and go to Localization > Languages. Click the 'new language' button and enter your parameters (Name: Greek, Code: gr, Image: icon.gif, Directory: greek, Sort Order: (your choice), click insert.

You should now see a drop-down menu in the header bar of your admin.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Jul 2010, 10:26 AM
#3
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Post #3 by athens_collectibles

Good evening Frank (just found out that you are 7 hours ahead of me) and thanks for your prompt reply.

Apologies for not responding earlier but your reply was received near midnight and I had gone to bed like a good boy old man of 63 should. Yesterday was also lost because of my grandchildren's visit.

I believe that the install issue of my previous post has now been solved. I did NOT change the name of the admin folder in the language pack, just uploaded folders as per instructions in the http://www.zen-cart.com/wiki/index.php/Languages#Updating_an_older_translation page of the Zen Cart Wiki.

Make sure that the files and directories are uploaded to the appropriate places, which are:

includes/languages/<your language>.php
includes/languages/<your language>/*
admin/includes/languages/<your language>.php
admin/includes/languages/<your language>/*
includes/templates/template_default/buttons/<your language>/

When I posted on Wednesday, I had already set up the Greek language as you describe and the drop-down language menu was there but had "English" as the only selection because I had not uploaded the admin folders. When I uploaded everything today and logged off and on again, the drop-down menu has the dual selection as it should and the yellow bar warning about missing files has disappeared. I think I can safely assume that all files of the language pack have been installed correctly. :unsure:

What remains though, and this is the most important issue, is the conversion of Greek characters to their corresponding codes which indicate that the locale is not correctly set somewhere (but where?). I have seen other posts in the forums about the same issue with Russian, Greek or other languages not using the latin character set but could never find out a reply about a satisfactory solution following suggestions by other forum members. I will do another extensive search in case I discover something. In the meantime, anyone having solved this problem, please reply what exactly needs to be amended and where in the hundreds of files and folders. I will really appreciate it. :hug:

I am confident that a solution will be found eventually, it's only a question of time and probably some trial and error.

Thanks to everyone in advance and wish me luck!

9 Jul 2010, 11:29 AM
#4
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Post #4 by frank18

Athens Collectibles:

Good evening Frank (just found out that you are 7 hours ahead of me) and thanks for your prompt reply.

Apologies for not responding earlier but your reply was received near midnight and I had gone to bed like a good boy old man of 63 should. Yesterday was also lost because of my grandchildren's visit.

My pleasure (yes I am 7 hours ahead of you and 7 years behind you :laugh:)

Athens Collectibles:

I believe that the install issue of my previous post has now been solved. I did NOT change the name of the admin folder in the language pack, just uploaded folders as per instructions in the http://www.zen-cart.com/wiki/index.php/Languages#Updating_an_older_translation page of the Zen Cart Wiki.

When I posted on Wednesday, I had already set up the Greek language as you describe and the drop-down language menu was there but had "English" as the only selection because I had not uploaded the admin folders. When I uploaded everything today and logged off and on again, the drop-down menu has the dual selection as it should and the yellow bar warning about missing files has disappeared. I think I can safely assume that all files of the language pack have been installed correctly. :unsure:

Glad you got this sorted :smile:

Athens Collectibles:

What remains though, and this is the most important issue, is the conversion of Greek characters to their corresponding codes which indicate that the locale is not correctly set somewhere (but where?).

I am not au fait with the locale configuration that applies to the Greek language. But if you look into your includes/languages/greek.php file you should find around line 23 something like this what I have in my corresponding german.php file:

@setlocale(LC_TIME, 'de_DE.UTF-8', 'de_AT.UTF-8', 'de_CH.UTF-8', 'de_DE.ISO_8859-1','de_DE@euro', 'de_DE', 'de', 'ge', 'deu.deu'); 

You will need to get the Greek equivalent and insert that in the corresponding line in your greek.php file

Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Jul 2010, 12:00 PM
#5
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Post #5 by athens_collectibles

Thank you again Frank,

The point is that the includes/languages/greek.php file seems to have the correct settings (see the first code in my initial post). The admin/includes/languages/greek.php file though doesn't (see the second code in my initial post).

I don't know if it's safe to change the second greek.php file (in the admin folder) or whether there is a master file with locales applying to the whole site. On the other hand, your German language is based on the latin character set which is not the case with the Greek language. I tend to believe that the categories and products editor is not working in utf-8 because the links in the "Information" box on the left side column show correctly in Greek. :cry:

(yes I am 7 hours ahead of you and 7 years behind you )Can we switch time zones and ages? It will still be 7 and 7! :yes:

9 Jul 2010, 6:01 PM
#6
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Post #6 by athens_collectibles

I think I solved the problem of Greek (and probably other non-latin alphabets) appearing as codes reported in my initial post. I won't get too enthusiastic yet but it seems to work fine. What I did:

I copied the contents of the includes/languages/greek.php in a Notepad file and the contents of admin/includes/languages/greek.php in another Notepad file and placed them side by side. As I said earlier, the greek.php in the admin folder was configured for ISO_8859-1. I copied the corresponding locale settings (including date formats) from the includes/languages/greek.php file and pasted them into the admin/includes/languages/greek.php file. I saved the file, logged off from Administration and back on and I was able to enter category and product names and descriptions in Greek! They now display correctly when Greek language is selected in the shop. Before doing that, I kept a back up copy of the admin/includes/languages/greek.php file under the name of admin/includes/languages/original_greek.php file just in case.

Having read various suggestions in the forums, I had previously changed the MySQL connection collation to greek_general_ci in an unorthodox way, i.e. after I had installed Zen Cart. I don't know if this helped or not but I decided not to make any other change for fear of destroying something that seems to work.

I attach the amended file in case someone else wants to use it but I can't guarantee that it will work for everyone. There are many experts in this forum and, if one of them could verify that my actions were correct, it would help others who face similar problems. It would also help me to sleep easily at night!

9 Jul 2010, 11:07 PM
#7
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Post #7 by frank18

@setlocale(LC_TIME,
'greek',
'el_GR',
'el_GR.iso_8859-7',
'el_GR.ISO_8859-7',
'el_GR.utf-8',
'el_GR.UTF-8'
);

Makes perfect sense to me.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

25 Jul 2010, 9:08 AM
#8
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Post #8 by athens_collectibles

Although I'm quite late, I want to close this thread by thanking you for all your help. Everything works fine with Greek now :D