Wednesday , September 19 2018
Home >> All tutorial >> Magento Certification Exam Tutorials (Part 8)

Magento Certification Exam Tutorials (Part 8)

Magento Tutorials – Part 8:  

Internationalization

In the e-commerce, it is avoidable that websites are accessed by a large number of people from different countries at the same time. So it is very necessary to develop multi-language for a website. And Magento supports you conduct this function on your web-store.
I. How to create a Magento multi-language site?
Definition: websitestore and store view will be illustrated as below:

Magento exam
– Customers can see Store views which are representatives of stores. The differences between store views are wording, images, and/or design and language (store view is always equivalent to language).

– Behind a store view is a store; products which have a same root category. Stores on a website have same points including customer information, shopping cart, inventory, billing methods and shipping methods.

Steps to create multi-language:
– Download the language package > Copy to the folder app/locale or use magento connector to download.
– Create store (store view) that has store_code
 System > Config > General Locale Options > Locale: Select store and then choose the language which has been downloaded. As in Magento default, the link to go to the store is http://site.com/index.php?___store=store_code
– If in the System > Config > Web > Url Options > Add Store Code to Urls. Afterwards select Default config and then choose Yes. The link to go to the store is: http://site.com/index.php/store_code
For Magento site can run in website mode, we need to take the following steps:
– Link domain to the root category.
– Edit the file index.php: Add the code below:
switch($_SERVER['HTTP_HOST']) { case 'shoes.com':
case 'www.shoes.com':
$mageRunCode = 'shoes';
$mageRunType = 'website';
break;
case 'hats.com':
case 'www.hats.com':
$mageRunCode = 'hats';
$mageRunType = 'website';
break;
}
Mage::run($mageRunCode, $mageRunType);

Add subdomain, subdirectories:
– For example: themes.magestore.com or magestore.com/themes
– Create a directory: themes directory
– Copy the file index.php and .htaccess from the root directory into themes directory and edit the file index.php:
– Change the line:

$mageFilename = 'app/Mage.php';

into

$mageFilename = '../public_html/app/Mage.php';

– Add before the line below:

Mage::run($mageRunCode, $mageRunType);

Two following lines:

$mageRunCode = themes'; $mageRunType = 'website';

II.How to use Magento translate classes and translate files
The translation function is Mage::helper(‘core’)->__()
This function call to the object Mage::getSingleton(‘core/translate’);
The process to conduct in this class:
– The corresponding CSV file will be loaded (in which locale the store is and which module the store is being called).
– String corresponds with input string which is returned.
III – Compare subdomains and subdirectories with SEO (the details are as the table below):
tutorial for beginners

IV – Questions

Question: What is the load order of the multi-language files?

Answer: The order for the multi-language files to load is:

–  CSV in /app/locale

–  CSV in /app/design/<area>/<package>/<theme>/locale (theme folder translate)

–   Database (table core_translate)

Because the next load will overwrite the last load parts so the priority order is opposite to the load sequence above.

Thanks for your following.

Related posts:
1. Magento Certification Exam Tutorials (Part 7)

2. Magento Certification Exam Tutorials (Part 6)

Here is the library of Magento Download for FREE (all versions)

Your Magento website needs a powerful Magento ERP for stock control.

DON'T MISS THE CHANCE!

magento erp

About Champ

Leave a Reply

Your email address will not be published. Required fields are marked *

Heap | Mobile and Web Analytics