SlideShare a Scribd company logo
1 of 24
Download to read offline
INTERNATIONALIZING AND
LOCALIZING WORDPRESS THEME

              SANJIP SHAH
         Follow: @sanjipshah
   Contact: sanjiv.saha31@gmail.com
Overview
• Definition and Importance

• Overview of the Process
  – Load a text domain
  – WordPress functions
  – Poedit Software
  – Create a language file
  – Instruct WordPress to load the language file
WHAT?
• Internationalization(i18n)
    Process of making WordPress theme/plugin
    translation ready.


• Localization(l10n)
    Process of adapting internationalized WordPress
    theme/plugin for a specific language by translating
    text.
Why ?
• For Developers
   – Cover More Users



• For Users
   – Get other language




                           Figure: WordPress Sites in Different Languages
                              Source: http://en.wordpress.com/stats/
LOAD A TEXT DOMAIN



• First parameter:
  – Unique identifier
    (good practice to use theme’s name)

• Second parameter:
  – Folder of the language files.
PROCESSING TEXT MESSAGES
1. __() Function
   • Makes your text ready for translation and returning it for use
         in PHP.




2. _e() Function
   • Works similarly to echo in PHP by displaying text on the screen.
PROCESSING TEXT MESSAGES
3. esc_attr__() Function
    •   esc_attr__() is the internationalization equivalent of the esc_attr().
    •   esc_attr__() returns the translation for use in PHP.




4. esc_attr_e() Function
    •   Displays the translation on the screen.
PROCESSING TEXT MESSAGES
5. _x() Function
    •    Sometimes, you need to provide context for translations.




6. _ex() Function
    •    Works same as above except it displays the translation on the screen.
PROCESSING TEXT MESSAGES
7. _n() Function
  •   Differentiate between the singular and plural forms of text.




  •   We could also do as below for easiness.


  •   But does not work for all languages.

  •   For an example: In French. Using“journal(s)” wouldn ’t apply
      because the plural form of journal is journaux.
PROCESSING TEXT MESSAGES
• Other functions
  •   esc_html__()
  •   esc_html_e()
  •   esc_attr_x()
  •   esc_html_x()
  •   _nx()

  Resource: http://devotepress.com/community/part-i-
      internationalizing-and-localizing-wordpress-theme/
TRANSLATION FILES
•    There are 3 kind of files:
    1.   POT file
         – Contains a list of all translatable messages in our theme.

    2.   The .po file
         – Created when we translate a POT file to a particular language.
         – Contains Human Readable text.
         – Actually not necessary to run the translation.


    3.   The .mo file
         – The .mo is a binary file that is created automatically by
             translation software.
         – Not Human Readable.
CREATING POT FILE
Supported translation tools for WordPress, Some are listed below.
    1. Poedit: http://poedit.net

    2.   GlotPress: http://glotpress.org

    3.   Launchpad: https://translations.launchpad.net

    4.   Pootle: http://pootle.locamotion.org

    5.   Kbabel: http://i18n.kde.org

    6.   GNU Gettext: http://gnu.org/software/gettext
CREATING POT FILE
•   Open Poedit, and create a new catalog.
•   Fill in the project’s information in the “Project info” tab:




                    Fig 1. Poedit Project Info Tab
CREATING POT FILE
•   In “Paths” tab:




                      Fig 1. Poedit Paths Tab
CREATING POT FILE
•   In “Keywords” tab:




                   Fig 1. Poedit Keywords Tab

•   Click OK. Save the file and your pot file will be created.
CREATION OF .POT FILE




     Figure: POT file created.
THE POT FILE




Fig 1. The POT file
TRANSLATING THE POT FILE




 Figure: Translating a POT file anc creating .po and .mo file
CREATION OF .po and .mo FILE




     Figure: POT file, .po file and .mo file all created.
UPDATING THE CONFIGURATION FILE
  •   Open wp-config.php file.

  •   Replace



  •   With




Sources: http://svn.automattic.com/wordpress-i18n/
         http://codex.wordpress.org/Installing_WordPress_in_Your_Language
SO WHAT ABOUT PLUGINS?
• Loading Text Domain




• Rest is pretty much same.
SOME RESOURCES
•   http://wp.smashingmagazine.com/2011/12/29/internationalizing-
    localizing-wordpress-theme/Replace

•   http://devotepress.com/community/part-i-internationalizing-and-
    localizing-wordpress-theme/

•   http://codex.wordpress.org/I18n_for_WordPress_Developers

•   http://codex.wordpress.org/L10n:Localization_Teams

•   http://en.wikipedia.org/wiki/Internationalization_and_localization

•   http://devotepress.com/coding/data-validation-sanitization-
    wordpress-2/
Thank You!

Questions?

More Related Content

What's hot

Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Think Media Inc.
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHPSteve Fort
 
Making Your Own URL Shortening Service
Making Your Own URL Shortening ServiceMaking Your Own URL Shortening Service
Making Your Own URL Shortening ServiceBob Hazlett
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Dave Wallace
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019Anam Ahmed
 
Debugging WordPress Performance using EasyEngine
Debugging WordPress Performance using EasyEngineDebugging WordPress Performance using EasyEngine
Debugging WordPress Performance using EasyEnginertCamp
 
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress TrivandrumWordPress Trivandrum
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress PerformanceRF Studio
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010Barry Abrahamson
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depthSanjay Willie
 
All about word press
All about word pressAll about word press
All about word pressDan Beil
 
Wp3 refresh pgh
Wp3 refresh pghWp3 refresh pgh
Wp3 refresh pghMrDirby
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPRupesh Kumar
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1Wataru OKAMOTO
 
Pragmatic plone projects
Pragmatic plone projectsPragmatic plone projects
Pragmatic plone projectsAndreas Jung
 
Intro to advanced web development
Intro to advanced web developmentIntro to advanced web development
Intro to advanced web developmentStevie T
 

What's hot (20)

Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
 
Making Your Own URL Shortening Service
Making Your Own URL Shortening ServiceMaking Your Own URL Shortening Service
Making Your Own URL Shortening Service
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Debugging WordPress Performance using EasyEngine
Debugging WordPress Performance using EasyEngineDebugging WordPress Performance using EasyEngine
Debugging WordPress Performance using EasyEngine
 
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s  | WordPress TrivandrumWordPress Hosting Best Practices - Do's and Don't s  | WordPress Trivandrum
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
 
3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance3 Hacks to Improve WordPress Performance
3 Hacks to Improve WordPress Performance
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
 
All about word press
All about word pressAll about word press
All about word press
 
Optimizing wp
Optimizing wpOptimizing wp
Optimizing wp
 
Wp3 refresh pgh
Wp3 refresh pghWp3 refresh pgh
Wp3 refresh pgh
 
Drupal
DrupalDrupal
Drupal
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHP
 
Introduction to Web Designing
Introduction to Web DesigningIntroduction to Web Designing
Introduction to Web Designing
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
 
Pragmatic plone projects
Pragmatic plone projectsPragmatic plone projects
Pragmatic plone projects
 
Intro to advanced web development
Intro to advanced web developmentIntro to advanced web development
Intro to advanced web development
 

Viewers also liked

Mahadev Subedi: WordPress Security & Defense Mechanism
Mahadev Subedi: WordPress Security & Defense MechanismMahadev Subedi: WordPress Security & Defense Mechanism
Mahadev Subedi: WordPress Security & Defense Mechanismwpnepal
 
Pankaj Agrawal: eLearning on WordPress
Pankaj Agrawal: eLearning on WordPressPankaj Agrawal: eLearning on WordPress
Pankaj Agrawal: eLearning on WordPresswpnepal
 
Ujwal Thapa: WordPress as a Blogging Platform
Ujwal Thapa: WordPress as a Blogging PlatformUjwal Thapa: WordPress as a Blogging Platform
Ujwal Thapa: WordPress as a Blogging Platformwpnepal
 
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...wpnepal
 
Simple Contact Us Plugin Development
Simple Contact Us Plugin DevelopmentSimple Contact Us Plugin Development
Simple Contact Us Plugin Developmentwpnepal
 
Yalamber Subba: WordPress Jobs & Freelance Marketplaces
Yalamber Subba: WordPress Jobs & Freelance MarketplacesYalamber Subba: WordPress Jobs & Freelance Marketplaces
Yalamber Subba: WordPress Jobs & Freelance Marketplaceswpnepal
 
Parallax scrolling evaluation
Parallax scrolling evaluationParallax scrolling evaluation
Parallax scrolling evaluationdannatdip
 

Viewers also liked (7)

Mahadev Subedi: WordPress Security & Defense Mechanism
Mahadev Subedi: WordPress Security & Defense MechanismMahadev Subedi: WordPress Security & Defense Mechanism
Mahadev Subedi: WordPress Security & Defense Mechanism
 
Pankaj Agrawal: eLearning on WordPress
Pankaj Agrawal: eLearning on WordPressPankaj Agrawal: eLearning on WordPress
Pankaj Agrawal: eLearning on WordPress
 
Ujwal Thapa: WordPress as a Blogging Platform
Ujwal Thapa: WordPress as a Blogging PlatformUjwal Thapa: WordPress as a Blogging Platform
Ujwal Thapa: WordPress as a Blogging Platform
 
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...
Jimba Tamang: 5 reasons why “Parallax Websites” are awesome and how to create...
 
Simple Contact Us Plugin Development
Simple Contact Us Plugin DevelopmentSimple Contact Us Plugin Development
Simple Contact Us Plugin Development
 
Yalamber Subba: WordPress Jobs & Freelance Marketplaces
Yalamber Subba: WordPress Jobs & Freelance MarketplacesYalamber Subba: WordPress Jobs & Freelance Marketplaces
Yalamber Subba: WordPress Jobs & Freelance Marketplaces
 
Parallax scrolling evaluation
Parallax scrolling evaluationParallax scrolling evaluation
Parallax scrolling evaluation
 

Similar to Internationalizing and Localizing WordPress

Let's create a multilingual site in WordPress
Let's create a multilingual site in WordPressLet's create a multilingual site in WordPress
Let's create a multilingual site in WordPressMarko Heijnen
 
Desktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumDesktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumBen Ramsey
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Preparing an Open Source Documentation Repository for Translations
Preparing an Open Source Documentation Repository for TranslationsPreparing an Open Source Documentation Repository for Translations
Preparing an Open Source Documentation Repository for TranslationsHPCC Systems
 
[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic EditorMickael Istria
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()Blue Elephant Consulting
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptxdipen55
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
Managing Drupal interface translation
Managing Drupal interface translationManaging Drupal interface translation
Managing Drupal interface translationLimoenGroen
 
Multi language for php with gettext
Multi language for php with gettextMulti language for php with gettext
Multi language for php with gettextBinh Quan Duc
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 
Week 5
Week 5Week 5
Week 5A VD
 
Week 5
Week 5Week 5
Week 5A VD
 

Similar to Internationalizing and Localizing WordPress (20)

Let's create a multilingual site in WordPress
Let's create a multilingual site in WordPressLet's create a multilingual site in WordPress
Let's create a multilingual site in WordPress
 
Desktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumDesktop Apps with PHP and Titanium
Desktop Apps with PHP and Titanium
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Preparing an Open Source Documentation Repository for Translations
Preparing an Open Source Documentation Repository for TranslationsPreparing an Open Source Documentation Repository for Translations
Preparing an Open Source Documentation Repository for Translations
 
WEB TECHNOLOGIES- PHP Programming
WEB TECHNOLOGIES-  PHP ProgrammingWEB TECHNOLOGIES-  PHP Programming
WEB TECHNOLOGIES- PHP Programming
 
[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor
 
Php intro
Php introPhp intro
Php intro
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
Managing Drupal interface translation
Managing Drupal interface translationManaging Drupal interface translation
Managing Drupal interface translation
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Multi language for php with gettext
Multi language for php with gettextMulti language for php with gettext
Multi language for php with gettext
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Week 5
Week 5Week 5
Week 5
 
Week 5
Week 5Week 5
Week 5
 

More from wpnepal

Utsav Singh Rathour: How, Why and Where to use WordPress multisite
Utsav Singh Rathour: How, Why and Where to use WordPress multisiteUtsav Singh Rathour: How, Why and Where to use WordPress multisite
Utsav Singh Rathour: How, Why and Where to use WordPress multisitewpnepal
 
Rabin Shrestha: Data Validation and Sanitization in WordPress
Rabin Shrestha: Data Validation and Sanitization in WordPressRabin Shrestha: Data Validation and Sanitization in WordPress
Rabin Shrestha: Data Validation and Sanitization in WordPresswpnepal
 
Roshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sitesRoshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic siteswpnepal
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minswpnepal
 
Jimba Tamang: Responsive and Retina Design
Jimba Tamang: Responsive and Retina DesignJimba Tamang: Responsive and Retina Design
Jimba Tamang: Responsive and Retina Designwpnepal
 
Bigyan Ghimire: GovtPress
Bigyan Ghimire: GovtPressBigyan Ghimire: GovtPress
Bigyan Ghimire: GovtPresswpnepal
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPresswpnepal
 
Kris Thapa: WP Ambulance
Kris Thapa: WP AmbulanceKris Thapa: WP Ambulance
Kris Thapa: WP Ambulancewpnepal
 
Chandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPressChandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPresswpnepal
 
WP Ambulance
WP AmbulanceWP Ambulance
WP Ambulancewpnepal
 
How to earn and maximize your earnings from your Blog - Pawan Agrawal
How to earn and maximize your earnings from your Blog - Pawan AgrawalHow to earn and maximize your earnings from your Blog - Pawan Agrawal
How to earn and maximize your earnings from your Blog - Pawan Agrawalwpnepal
 

More from wpnepal (11)

Utsav Singh Rathour: How, Why and Where to use WordPress multisite
Utsav Singh Rathour: How, Why and Where to use WordPress multisiteUtsav Singh Rathour: How, Why and Where to use WordPress multisite
Utsav Singh Rathour: How, Why and Where to use WordPress multisite
 
Rabin Shrestha: Data Validation and Sanitization in WordPress
Rabin Shrestha: Data Validation and Sanitization in WordPressRabin Shrestha: Data Validation and Sanitization in WordPress
Rabin Shrestha: Data Validation and Sanitization in WordPress
 
Roshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sitesRoshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sites
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
 
Jimba Tamang: Responsive and Retina Design
Jimba Tamang: Responsive and Retina DesignJimba Tamang: Responsive and Retina Design
Jimba Tamang: Responsive and Retina Design
 
Bigyan Ghimire: GovtPress
Bigyan Ghimire: GovtPressBigyan Ghimire: GovtPress
Bigyan Ghimire: GovtPress
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
Kris Thapa: WP Ambulance
Kris Thapa: WP AmbulanceKris Thapa: WP Ambulance
Kris Thapa: WP Ambulance
 
Chandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPressChandra Maharzan: Making a successful career out of WordPress
Chandra Maharzan: Making a successful career out of WordPress
 
WP Ambulance
WP AmbulanceWP Ambulance
WP Ambulance
 
How to earn and maximize your earnings from your Blog - Pawan Agrawal
How to earn and maximize your earnings from your Blog - Pawan AgrawalHow to earn and maximize your earnings from your Blog - Pawan Agrawal
How to earn and maximize your earnings from your Blog - Pawan Agrawal
 

Recently uploaded

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Recently uploaded (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

Internationalizing and Localizing WordPress

  • 1.
  • 2. INTERNATIONALIZING AND LOCALIZING WORDPRESS THEME SANJIP SHAH Follow: @sanjipshah Contact: sanjiv.saha31@gmail.com
  • 3. Overview • Definition and Importance • Overview of the Process – Load a text domain – WordPress functions – Poedit Software – Create a language file – Instruct WordPress to load the language file
  • 4. WHAT? • Internationalization(i18n) Process of making WordPress theme/plugin translation ready. • Localization(l10n) Process of adapting internationalized WordPress theme/plugin for a specific language by translating text.
  • 5. Why ? • For Developers – Cover More Users • For Users – Get other language Figure: WordPress Sites in Different Languages Source: http://en.wordpress.com/stats/
  • 6. LOAD A TEXT DOMAIN • First parameter: – Unique identifier (good practice to use theme’s name) • Second parameter: – Folder of the language files.
  • 7. PROCESSING TEXT MESSAGES 1. __() Function • Makes your text ready for translation and returning it for use in PHP. 2. _e() Function • Works similarly to echo in PHP by displaying text on the screen.
  • 8. PROCESSING TEXT MESSAGES 3. esc_attr__() Function • esc_attr__() is the internationalization equivalent of the esc_attr(). • esc_attr__() returns the translation for use in PHP. 4. esc_attr_e() Function • Displays the translation on the screen.
  • 9. PROCESSING TEXT MESSAGES 5. _x() Function • Sometimes, you need to provide context for translations. 6. _ex() Function • Works same as above except it displays the translation on the screen.
  • 10. PROCESSING TEXT MESSAGES 7. _n() Function • Differentiate between the singular and plural forms of text. • We could also do as below for easiness. • But does not work for all languages. • For an example: In French. Using“journal(s)” wouldn ’t apply because the plural form of journal is journaux.
  • 11. PROCESSING TEXT MESSAGES • Other functions • esc_html__() • esc_html_e() • esc_attr_x() • esc_html_x() • _nx() Resource: http://devotepress.com/community/part-i- internationalizing-and-localizing-wordpress-theme/
  • 12. TRANSLATION FILES • There are 3 kind of files: 1. POT file – Contains a list of all translatable messages in our theme. 2. The .po file – Created when we translate a POT file to a particular language. – Contains Human Readable text. – Actually not necessary to run the translation. 3. The .mo file – The .mo is a binary file that is created automatically by translation software. – Not Human Readable.
  • 13. CREATING POT FILE Supported translation tools for WordPress, Some are listed below. 1. Poedit: http://poedit.net 2. GlotPress: http://glotpress.org 3. Launchpad: https://translations.launchpad.net 4. Pootle: http://pootle.locamotion.org 5. Kbabel: http://i18n.kde.org 6. GNU Gettext: http://gnu.org/software/gettext
  • 14. CREATING POT FILE • Open Poedit, and create a new catalog. • Fill in the project’s information in the “Project info” tab: Fig 1. Poedit Project Info Tab
  • 15. CREATING POT FILE • In “Paths” tab: Fig 1. Poedit Paths Tab
  • 16. CREATING POT FILE • In “Keywords” tab: Fig 1. Poedit Keywords Tab • Click OK. Save the file and your pot file will be created.
  • 17. CREATION OF .POT FILE Figure: POT file created.
  • 18. THE POT FILE Fig 1. The POT file
  • 19. TRANSLATING THE POT FILE Figure: Translating a POT file anc creating .po and .mo file
  • 20. CREATION OF .po and .mo FILE Figure: POT file, .po file and .mo file all created.
  • 21. UPDATING THE CONFIGURATION FILE • Open wp-config.php file. • Replace • With Sources: http://svn.automattic.com/wordpress-i18n/ http://codex.wordpress.org/Installing_WordPress_in_Your_Language
  • 22. SO WHAT ABOUT PLUGINS? • Loading Text Domain • Rest is pretty much same.
  • 23. SOME RESOURCES • http://wp.smashingmagazine.com/2011/12/29/internationalizing- localizing-wordpress-theme/Replace • http://devotepress.com/community/part-i-internationalizing-and- localizing-wordpress-theme/ • http://codex.wordpress.org/I18n_for_WordPress_Developers • http://codex.wordpress.org/L10n:Localization_Teams • http://en.wikipedia.org/wiki/Internationalization_and_localization • http://devotepress.com/coding/data-validation-sanitization- wordpress-2/