Languages

From Zen Cart(tm) Wiki
Jump to: navigation, search

Contents

Introduction

Translations are done on a volunteer basis, so the quality and even installation instructions may vary.


You are always welcome to help improve a translation, by either making your suggestions known to the author of the translation or by making your wanted changes yourself.


Installing a language pack

  1. Download the language pack.
  2. If the language pack was written for an older version of Zen Cart™, you'll need to update the language pack before proceeding.
  3. Upload the files and directories to your server.
  4. Go to Admin > Localization > Languages and click the new language button. Fill in the details and make sure you put the correct directory in Directory with proper case - English is not the same as english.


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>/


Troubleshooting

MISSING LANGUAGE FILES OR DIRECTORIES ...

Some language packs may not include the Admin files, which will result in errors when you enter the Admin area. To solve this issue, simply copy the english language files for the Admin area into a directory for your language.


In other words, copy

admin/includes/languages/english.php
admin/includes/languages/english/

to

admin/includes/languages/<your language>.php
admin/includes/languages/<your language>/


Note to translators: If you haven't translated the Admin area, please include the english language files for the Admin in your language pack so users don't have to experience this.


Customizing

You should avoid to edit the original files from the language pack you downloaded: if it is updated (to complete it or to follow new releases of Zen Cart), either you loose your changes if you just overwrite older files, or it would be more work to update your modified files (can be done with diff utils as explained below).

For minor edits, use the override system: copy the language files from the above directories to

includes/templates/<current template>/buttons/<your language>/
includes/languages/<current template>/<your language>.php
includes/languages/<your language>/<current template>/
includes/languages/<your language>/<other sub-directories>/<current template>/

and edit the new files. It seems the admin section has no such override.

Idea.png Tips!
  1. Watch out the "classic" folders (in 1.3.7 at least) to see where you can put your template folders.
  2. If you see an all capital string in place of a message, the corresponding language definition is missing from your language file. Look it up in the English language file and add it to your translation.


Creating a new translation

Read about editing in PHP to learn how to properly edit text definitions.


The following files and directories with subdirectories should all be included in the language pack, whether they're translated or not

  • 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>/


All paths should be included in the package as shown above in order to make it easy to extract onto a server without the need to move files or directories around.


Additionally but not required, there's the SQL file

install/mysql_zencart.sql

which contains text that will appear on certain Admin pages. This means that the Admin area isn't 100% multi-lingual, but this will most likely be dealt with in a future version of Zen Cart™.


You should also include a file named README.txt where you say something about what has been translated and what has not, along with any other information you feel is appropriate.


{{infoBox|setlocale()|As the minimum required version for PHP now is 4.3, we can specify multiple locales for setlocale():
setlocale(LC_TIME,
	'english',
	'en_US',
	'en_US.iso_8859-1',
	'en_US.ISO_8859-1',
	'en_US.utf-8',
	'en_US.UTF-8'
);

It makes it easier for users if they don't have to know the correct locale themselves, and we can guess it for them by editing the call to setlocale() in the following files to use the above code:

  • includes/languages/<your language>.php
  • admin/includes/languages/<your language>.php


Updating an older translation

If a language pack is out of date, you can easily make it up to date by comparing the English language files from the Zen Cart™ version that the language pack you wish to update was made for against the English language files of the new Zen Cart™ version you wish to update to.


Here's how to do that:

  1. Download the Zen Cart™ version that matches the original language pack and the Zen Cart™ version you wish to update the language pack for.
  2. Unpack the two packages into two separate directories.
  3. Open a comparison program like WinMerge(for Windows™) or FileMerge (for MacOSX™ - free utility with Xcode developer tools from Apple™.)
  4. Compare the two versions of the directories includes/languages and admin/includes/languages, and be sure to include subfolders.
    • If a file exists only in the older release, delete it from your language pack.
    • If a file exists only in the newer release, copy that English language file into your language pack and translate it.
    • If a file has changed between the two versions, compare those English files to see what exact changes has been made, and update your language pack accordingly.
  5. Compare the two versions of the directory includes/templates/template_default/buttons/english/ and see if there are any new files. You may also consider updating the images if anyone have changed, but that's probably not strictly necessary.


Please share your updated translation with the community. Thank you!

List of known language packs

Language packs

The download area is working now, so there shouldn't be any further need of this list.


If you're looking for older versions of Zen Cart™ or the default English language files, they can be found at the project's section at sourceforge.net.


If you have access to a language pack not listed in the download area, please upload it.


Wanted translations

Feel free to add any languages you would like to see for Zen Cart™ here. This could be used to connect people who wants to translate into a certain language, so you might want to leave a way of contacting you if you're willing to participate in translating.


  • Arabic
  • British-English/Hiberno-English
  • Korean
  • Vietnamese

International support sites

Personal tools