How to translate a theme WooThemes Language Turkish German Arabic Russian Chienese Translation


simple solution create new .po and .mo file put in your theme folder thats it

Background info

WordPress uses a standard localization framework called GNU gettext. This framework provides the programmer the ability to mark text inside code as being suitable for localization. The role of the translator is to take these marked pieces of text and produce a language-specific localization. No code needs to change and you do not need to understand how the program works.

Text is marked by wrapping it with special PHP functions. It is not important to know how these functions work, but it will be helpful to recognize them:

  • __($text) – Looks for a translated version of $text and returns the result
  • _e($text) – Looks for a translated version of $text and echo the result to the screen (i.e. effectively it is echo __($text))
  • __ngettext($single,$plural,$number) – If $number is 1 then looks for a translated version of $single. If number is more than 1 then looks for a translated version of $plural.

(Source: Urban Giraffe)

Translating WooThemes
Putting this into context, it means that all our text in our template files (.php files) have been wrapped in gettext functions. This enables us to create a Portable Object File (or .po file) which contains all the text for the theme. This has already been done by us at WooThemes.

The user (that’s you) then has the ability to use a program (we’ll get back to this later) to translate this .po file into another language, add it to the theme directory, and have a translated theme!

Before we start

Before you can start to translate the theme, you need to make sure that the theme has been made ready for translation. All our new themes will support localization and include a language file (.po file) which contains all the English texts, and soon all our old themes will be upgraded as well.

If you are not certain if your theme has been made ready for translation/localization, you can simply check if there is a “/lang/themename.po” file in your theme folder. If there isn’t one, you will need to download the latest version of the theme and check if the .po file existst there. If it does include a translation file, you will need to upgrade your theme to be able to translate it.

How to translate

To translate your theme, you will need to use Poedit to translate the included Portable Object file (.po file), which will then create a Machine Object file (.mo file) which we will upload to our theme folder for WordPress to read.

Follow these steps to translate your .po file into another language and make a .mo file:

  1. Download and install Poedit, the program we will use to translate our .po file.
  2. Open the themename.po file found in your /lang/ folder with poedit.
  3. Now go through and translate all the text one line at a time in the bottom box.
  4. Save the file after you’re done. This will output a .po and .mo file.

Translating the .po file with Poedit

Setup WordPress
Before we can upload our new .mo file, we need to make sure we named it correctly, as it has to match your desired language locale. See the complete list of language codes and country codes to find your exact locale.

We’ll use Norwegian as the example here, so first we find the language code (nb – Norsk Bokmål) and the country code (NO). We than rename our .mo file to nb_NO.mo and upload to the root of our theme folder e.g.

wp-content/themes/themename/nb_NO.mo

The last step is to make sure your WordPress config file, wp-config.php, is setup with your locale, which in this case is Norwegian. So open wp-config.php and check that what you have in your define() function. For Norwegian it will look like this:

define ('WPLANG', 'nb_NO');

Once you have matched the wp-config.php setting to our .mo filename, you should have successfully translated your WooTheme into another language.

Share your language

We want to make it easier for users to get the theme in their language, so if you have translated your theme into your language, we hope you can share the .mo file with us, so new users don’t have to translate the theme themselves.

Please send us your translated files (.po and .mo) files to support@woothemes.com and we will put your file up in our repository.

15 thoughts on “How to translate a theme WooThemes Language Turkish German Arabic Russian Chienese Translation

  1. LAST NIGHT### AMAZING PRICE — $44 !!!!!!

    BUY IT NOW AT ——- ROSETTACHEAP.COM —–

    ROSETTA STONE V.3.3.7 LV.1+2+3+AUDIO COMPANION VERSION]

    CHOOSE ANY LANGUAGE FROM THIS LIST!!!!

    – SPANISH LATIN AMERICA
    – SPANISH SPAIN
    – GERMAN
    – ITALIAN
    – CHINESE MANDARIN
    – ENGLISH US
    – ENGLISH UK
    – FRENCH
    – JAPANESE
    – RUSSIAN
    – PORTUGUESE (BRAZIL)
    – ARABIC

    !!!!!!! BUY IT NOW !!!!!!!!

    GOTO ——- ROSETTACHEAP.COM —–
    WELCOME TO ——- ROSETTACHEAP.COM —–
    GOTO ——- ROSETTACHEAP.COM —–
    BUY IT NOW AT ——- ROSETTACHEAP.COM —–
    GOTO ——- ROSETTACHEAP.COM —–

    Level 1, 2 & 3 — Connect With the World
    Connect with the world around you. Build a foundation of fundamental vocabulary and essential language structure. Quickly gain the confidence to enjoy social interactions such as greetings and introductions, travel, dining out, giving and getting directions, shopping and other recreational activities. Learn to share your ideas and opinions, express your feelings and talk about everyday life, your work, your interests, current events, and much more.
    Features & Benefits
    It’s faster and more effective!

    Rosetta Stone will teach you as fast as you can learn! Leveraging your natural language-learning ability, Version 3 immerses you immediately in the new language, providing just the right context to prompt you to speak, pronounce, read and write in the very first lesson! Intuitive, sequential learning builds progressively and makes every lesson count.

    Our Dynamic Immersion^(TM) method is so fast and so effective, it’s used by the Fortune 500, the U.S. State Department, and over 10,000 schools.

    It’s Convenient!

    You pick the time, the place and the pace! We are ready when you are because there are no class schedules or missed lessons to make up. From your desk or your dining room, your valuable time can be turned into productive language learning that fits your lifestyle.

    It’s Enjoyable.

    When something is fun, it captures your attention…and holds it! The interactivity in Version 3 instantly engages you. Rich, vivid imagery, real-life context and voices of native speakers make Rosetta Stone different from any other product out there — never tedious or boring. Rosetta Stone provides a captivating, game-like experience.

    Milestones

    Learn and apply! Our MILESTONE feature lets you try out your new language knowledge in real-life situations.

    Track Your Progress

    New ADAPTIVE RECALL^(TM) feature tracks your progress, reinforcing your strengths and revisiting your development areas.

    New Speech Recognition Technology

    State-of-the-art new speech recognition technology helps you learn to speak your new language even faster. And our new Speech Analysis Tool compares your voice to that of native speakers, helping you perfect your pronunciation.

    Life-like Context

    Our New CONTEXTUAL FORMATION^(TM) feature uses real-life simulations and vivid imagery to give you exactly the context you need to produce new language — all on your own!
    Is this level for me?
    Rosetta Stone Online Subscription offers you access to our learning equivalent to our Level 1, 2 & 3 Set.

    Rosetta Stone Online includes

    – The Basics
    – Friends and Family
    – Work and School
    – Shopping
    – Travel
    – Past & Future
    – Friends and Social Life
    – Dining and Vacation
    Requirements for Rosetta Stone User Workstations
    – Windows 2000, XP, VISTA
    – 512 MB RAM
    – 1 GHz or faster processor speed
    – 600 MB free hard-drive space (per level)
    – 16-bit sound card
    – 800 x 600 display resolution (1024 x 768 recommended)
    – Internet or phone connection required for product activation
    – Speech recognition feature requires a headset microphone (USB recommended)

    Note for Microsoft? Windows Vista^(TM) users:

    Current Rosetta Stone? products have been engineered to install and run on the Windows Vista operating system. Some 3rd party components used in Rosetta Stone products have not been certified by Microsoft as ‘Vista Compliant’. Accordingly, you may encounter some Vista -related operating issues. Rosetta Stone technical support may or may not be able to resolve these Vista-related issues. Rosetta Stone hereby disclaims any representations, warranties, guaranties and conditions with respect to the compatibility of the Rosetta Stone products with the Windows Vista operating systems.
    GOTO — ROSETTACHEAP.COM
    GOTO — ROSETTACHEAP.COM
    GOTO — ROSETTACHEAP.COM
    GOTO — ROSETTACHEAP.COM

    http://rosettastonespanishlatinamerica.wordpress.com

  2. Thanky you for information:

    “We than rename our .mo file to nb_NO.mo and upload to the root of our theme folder e.g.

    wp-content/themes/themename/nb_NO.mo”

    I didnt know that it should be in root of theme… i was searching everywhere on the internet and found a solution here…

    Thanks!

  3. does not work.

    I put language .mo file in the theme root, but it does not show on website, the language is still the same. Mabey wordpress has a cache or wtf..,

  4. Çevirdim dil dosyasını ;
    isimlerini tr_TR ve irresistible-tr_TR olarak yapıp “lang” klasöründe tutsamda olmadı. Nasıl yapabilirim?

    1. open “lang” folder, and open .po files, save as your lang code (it_IT, tr_TR etc.), Save with a different name.
      *. mo file is automatically created, you will see

  5. For me this worked well, except that the po and mo files are not in the root folder of the themes directory. They are in a lang folder inside the theme.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s