Language Translation

This section contains information about how to translate the site. Language Resource Files or Resx Files, Email Templates, Categories and Regions and the Time Picker each need to be handled separately.

Language Resource Files (Resx Files)

Translating Resx files to Multiple Languages

Copy the default language .resx files located in the App_GlobalResources folder and rename them to include the language code in their name as follows:

{Name}.{language code}.resx

Example: For Turkish, "AdminStrings.resx" should be copied to "AdminStrings.tr.resx"

Once those files are copied, their contents must be modified such that each "<value>" is translated from its English default to its language specific text.

Example: The English word "Home" can be translated to the Turkish "Ev" by changing the "<value>Home</value>" line to "<value>Ev</value>".

 

Below is a list of the .NET language codes:

Language Culture Name

Display Name

Culture Code

ISO 639x Value

af-ZA

Afrikaans - South Africa

0x0436

AFK

sq-AL

Albanian - Albania

0x041C

SQI

ar-DZ

Arabic - Algeria

0x1401

ARG

ar-BH

Arabic - Bahrain

0x3C01

ARH

ar-EG

Arabic - Egypt

0x0C01

ARE

ar-IQ

Arabic - Iraq

0x0801

ARI

ar-JO

Arabic - Jordan

0x2C01

ARJ

ar-KW

Arabic - Kuwait

0x3401

ARK

ar-LB

Arabic - Lebanon

0x3001

ARB

ar-LY

Arabic - Libya

0x1001

ARL

ar-MA

Arabic - Morocco

0x1801

ARM

ar-OM

Arabic - Oman

0x2001

ARO

ar-QA

Arabic - Qatar

0x4001

ARQ

ar-SA

Arabic - Saudi Arabia

0x0401

ARA

ar-SY

Arabic - Syria

0x2801

ARS

ar-TN

Arabic - Tunisia

0x1C01

ART

ar-AE

Arabic - United Arab Emirates

0x3801

ARU

ar-YE

Arabic - Yemen

0x2401

ARY

hy-AM

Armenian - Armenia

0x042B

Cy-az-AZ

Azeri (Cyrillic) - Azerbaijan

0x082C

Lt-az-AZ

Azeri (Latin) - Azerbaijan

0x042C

eu-ES

Basque - Basque

0x042D

EUQ

be-BY

Belarusian - Belarus

0x0423

BEL

bg-BG

Bulgarian - Bulgaria

0x0402

BGR

es-SV

Spanish - El Salvador

0x440A

ESE

es-GT

Spanish - Guatemala

0x100A

ESG

es-HN

Spanish - Honduras

0x480A

ESH

es-MX

Spanish - Mexico

0x080A

ESM

es-NI

Spanish - Nicaragua

0x4C0A

ESI

es-PA

Spanish - Panama

0x180A

ESA

es-PY

Spanish - Paraguay

0x3C0A

ESZ

es-PE

Spanish - Peru

0x280A

ESR

es-PR

Spanish - Puerto Rico

0x500A

ES

es-ES

Spanish - Spain

0x0C0A

es-UY

Spanish - Uruguay

0x380A

ESY

es-VE

Spanish - Venezuela

0x200A

ESV

sw-KE

Swahili - Kenya

0x0441

sv-FI

Swedish - Finland

0x081D

SVF

sv-SE

Swedish - Sweden

0x041D

syr-SY

Syriac - Syria

0x045A

ta-IN

Tamil - India

0x0449

tt-RU

Tatar - Russia

0x0444

te-IN

Telugu - India

0x044A

th-TH

Thai - Thailand

0x041E

THA

tr-TR

Turkish - Turkey

0x041F

TRK

uk-UA

Ukrainian - Ukraine

0x0422

UKR

ur-PK

Urdu - Pakistan

0x0420

URD

Cy-uz-UZ

Uzbek (Cyrillic) - Uzbekistan

0x0843

Lt-uz-UZ

Uzbek (Latin) - Uzbekistan

0x0443

vi-VN

Vietnamese - Vietnam

0x042A

VIT

 

Multiple Languages Walk Through

These instructions are for changing the site's language when multiple languages are desired. In this example, French (language code fr) will be added in addition to the default English option, allowing users to choose which language static text throughout the website will be displayed in.

  1. Open [FTP Root]/[Application Root]/App_GlobalResources in a file explorer.
  2. Copy the contents to a new temporary folder C:\Temp.
  3. Open a command line (windows only) and execute the following command:
    • Cd c:\temp
    • rename *.resx *.fr.resx
  4. Copy the contents of C:/temp back into [FTP Root]/[Application Root]/App_GlobalResources. They should look like this:
  5. To test the new resx files, open the Resx Editor and open the file [FTP Root]/[Application Root]/App_GlobalResources/GlobalStrings.fr.resx

  6. You will see a list of various phrases that are used throughout the site. Scroll down to the phrase (value) “Home” and change it to “Maison”.

  7. Go to the site and navigate to Admin Control Panel > International > General and turn on the Enable Multiple Cultures, then click Save.

  8. Now go to Admin Control Panel > International > Languages and turn on French / français (fr), then click Save.

    Finally, go to Admin Control Panel > International > Cultures and select French / français (fr) as the default culture, then click Save.

The result should be, the "Home" link in the top navigation now says "Maison", visible from the Homepage.

Translating Resx Files to a Single Language

Resx files without country codes will be used by default. If only one language is necessary, making copies of the resx files with different file name endings is not needed. Just edit the existing files. Other than that, follow all of the same steps.

 

Email Template Localization

Translating Email Templates to a Single Language

The Email Templates can be edited as is without enabling the Multiple Cultures. On the CMS > Email Templates page, instead of Language buttons, when Enable Multiple Languages is not enabled, you will be presented with Edit buttons.

Translating Email Templates to Multiple Languages

Adding a language
  1. Go to Admin Control Panel > International > Preferences and enable the setting Enable Multiple Cultures.
  2. Go to Admin Control Panel > International > Languages and enable any languages needed.

Once these settings are in place, a button for each language will be visible next to each email template on the Admin Control Panel > CMS > Email Templates page.

Adding Regional Language Options
  1. Go to Admin Control Panel > International > Preferences and enable the setting Show Regional Language Options.
  2. Go to Admin Control Panel > CMS > Email Templates. At the bottom of the list of email templates, select a Regional Language from the Add dropdown.

Once the Regional Language has been added, a button for each Regional Language will be visible next to each email template. The Remove dropdown will allow for removal of any Regional Language.

Note: For more information on email templates see: Email Templates

Editing the Email Templates
  1. Navigate to Admin Control Panel > CMS > Email Templates
  2. Then click the Francais button next to the Listing Posted Confirmation (to Seller) template.
  3. Add "Bonjour" before the [Receiver.UserName], and click Save.
  4. To test this, create a listing of any listing type and fill in all of the required fields.

The result should be visible from your email with a french greeting. Voila.

Note: Make sure that the Email Notifications are turned on. Go to Admin Control Panel > Site Preferences > Setup and turn on the Email Notifications Enabled setting.

 

Categories and Regions

Important: Add the Categories and Regions through the Admin Control Panel using Resx safe characters prior to doing any Language Translation. Resx safe characters means only using English characters with no spaces, commas or special characters. Adding Categories and Regions first will save time. Adding Categories and Regions after the translation should be done by adding the Categories or Regions in Resx safe characters through the Admin Control Panel first, then editing the CategoriesRegions.resx file.

When category and/or region names are translated, the RESX key will be the category name with all non-alphanumeric characters replaced with underscores. For example the category name "Business & Industrial" can be translated by adding an entry to each CategoriesRegions.(language code).resx file with the key "Business_Industrial", and an appropriate translation value for the applicable language. In English it would be "Business & Industrial".

 

Custom Fields

Custom Listing Fields and Custom User Fields are both translated using the CustomFields.resx file. The custom fields are added to the database by default and the translation from the resx file will only take precedent if the Name (Not the Localized Name) is a valid string. Resx names can only use underscores and alphanumeric characters.

Example: a Custom Listing field that is called "Vin #" would not be recognized by the resx system. The field would first need to be renamed from the Listings > Custom Fields page to "Vin_Number" and then a new string can be added to the CustomFields.resx file with a name of "Vin_Number" and a value of "Vin #".

Once the name follows the formatting rules that resx files require and the name exists as a string in the CustomFields.resx file, the file can be copied and renamed to match the languages that the site is being localized for. (E.g. CustomFields.en.resx)

Option lists follow the same logic and need to be named with only the basic characters that resx files are compatible with. (alphanumeric and underscores) Then translating the option list values from the resx file is straight forward. Add the string with a "safe_name" and enter the desired value.

 

Time Picker Localization

Many cultures are already supported in the standard date picker, as listed in “\Scripts\jquery-ui-i18n.min.js”. If your culture is not already included, support can be added by editing the file “\Scripts\jquery-ui-i18n.rainworx.js”.

First, copy one of the existing functions. Then, edit the copied function for the new language you wish to add. The following code is an example of the localization for Canadian English (“en-CA”):

jQuery(function (a) {
a.datepicker.regional["en-CA"] =
{
closeText: "Done",
prevText: "Prev",
nextText: "Next",
currentText: "Today",
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], 
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
weekHeader: "Wk",
dateFormat: "dd/mm/yy",
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
a.datepicker.setDefaults(a.datepicker.regional["en-CA"])
});

More information on localization can be found at:
http://api.jqueryui.com/datepicker/