SlideShare ist ein Scribd-Unternehmen logo
1 von 32
By
Md. Sajedul Haque Romi
Email: romi@codebangla.com
‱ Understanding Internationalization
& localization
‱ Tools for localization
‱Implementation localization in WP
themes
‱Implementation localization in WP
plugins
Internationalization is the process of
designing a software application so that it
can be adapted to various languages and
regions without engineering changes.
Localization is the process of adapting
internationalized software for a specific
region or language by adding locale-
specific components and translating text.
WordPress uses the gettext libraries
and tools for i18n.
In WordPress, you should use the
__() wordpress-defined PHP gettext-
compliant translation function.
There are three types of files used in the
gettext translation framework.
‱POT (Portable Object Template) files
‱PO (Portable Object) files
‱MO (Machine Object) files
In your theme or plugin PHP files, write
codes in the following way.
__('message') passes the translation
to the PHP return statement.
_e('message') passes the translation
to the PHP echo statement.
Example:
<?php
$translated_text = __( 'text', 'domain' );
?>
Domain: Unique identifier for retrieving
translated strings
‱Load a text domain
‱Process text messages with WordPress
functions
‱Extract these messages with the appropriate
software
‱Provide a translation for each message
‱Create a language file for a particular locale
‱Instruct WordPress to enable localization and to
load the language file
For Theme:
In wp-content/themes/Test-Theme/functions.php
For Plugin:
In wp-content/plugins/Test-Plugin/index.php
echo "Hello user";
_e("Hello user","mytheme");
the_content( "Read more" );
the_content( __("Read more","mytheme")
);
Sometimes, a text message includes
dynamic data, such as a number from a
PHP variable. In this case, we use the
sprintf() function to produce the final
message string:
$results_found = 12;
$message = sprintf( __("%s results found"
, "mytheme") , $results_found );
WordPress provides a function for singular
and plural translation of the same text
message called _n():
_n( $single, $plural, $number, $domain );
Though the _n() is a built in WordPress function, using it is discouraged because
the translation software parses only the first parameter of a function, and so
these two text messages would not be fetched. Instead, we can use the PHP if
statement:
if($results_found == 1)
$message = __("1 result found" , "my-text-
domain");
else
$message = sprintf( __("%s results found" , "my-
text-domain") , $results_found );
WordPress provides date_i18n() to
translate dates.
Example:
<?php
echo date_i18n(get_option('date_format')
,strtotime("11/15-1976"));
?>
http://codex.wordpress.org/Function_Reference/date_i18n
Bangla date translation
http://tareq.wedevs.com/2010/09/translate-wordpress-date-time-comment-number-to-bangla-digit/
_x()
_ex()
_nx()
_n()
esc_html()
esc_attr()
esc_attr__()
esc_attr_e()
esc_js()
esc_textarea()
esc_url()
‱Poedit
‱GlotPress
‱GNU gettext
Among them, Poedit is widely used for
WordPress I18n & l10n. So we will be
focused on Poedit translation method.
Go to File>New Catalog

Click ok, if you add the path correctly, you
should see something like this
Save the file as .pot ( not default.po)
For theme ex: languages/test-theme.pot
For plugin ex: languages/test-plugin.pot
Then in Poedit, go to File>New catalog
from POT file
 you will see your template
for translation
Some thing like this
See the Source text box
Add your translated phrase in
Translation box
When you are done adding your translated phrases, save the file in
the WordPress
theme as en_US.po or your language code
.po file like bn_BD.po
For plugin
must save your-plugin-en_US.po
Ex: test-plugin-bn_BD.po
When you save the .po file a .mo file will be generated.
Open wp-config.php file search for
define('WPLANG’
Add your lanuage code and save it
Congratulation!
You have successfully finished your
WordPress Theme & Plugin Translations.
Reference:
http://codex.wordpress.org/Translating_WordPress
http://wp.smashingmagazine.com/2011/12/29/internationalizing-
localizing-wordpress-theme/
Md. Sajedul Haque Romi
Founder & CEO
CodeBANGLA
Email: romi@codebangla.com

Weitere Àhnliche Inhalte

Was ist angesagt?

What’s new in joomla 3.7
What’s new in joomla 3.7What’s new in joomla 3.7
What’s new in joomla 3.7Tim Plummer
 
Introduction to building joomla! components using FOF
Introduction to building joomla! components using FOFIntroduction to building joomla! components using FOF
Introduction to building joomla! components using FOFTim Plummer
 
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Eric Tiggeler
 
How to create a joomla component from scratch
How to create a joomla component from scratchHow to create a joomla component from scratch
How to create a joomla component from scratchTim Plummer
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme developmenthenri_makembe
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaTim Plummer
 
Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Gunjan Patel
 
Packaging DNN extensions
Packaging DNN extensionsPackaging DNN extensions
Packaging DNN extensionsEngage Software
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimizationhenri_makembe
 
Considerations with Writing JavaScript in your DotNetNuke site
Considerations with Writing JavaScript in your DotNetNuke siteConsiderations with Writing JavaScript in your DotNetNuke site
Considerations with Writing JavaScript in your DotNetNuke siteEngage Software
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migrationhenri_makembe
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Developmentphamvanvung
 
Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3Gunjan Patel
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themeshenri_makembe
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Peter Martin
 
WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014Arsham Mirshah
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetshenri_makembe
 
10 common mistakes WordPress developers make when building multilingual sites
10 common mistakes WordPress developers make when building multilingual sites10 common mistakes WordPress developers make when building multilingual sites
10 common mistakes WordPress developers make when building multilingual sitesAgnieszka Bury
 
Front End Development in Magento
Front End Development in MagentoFront End Development in Magento
Front End Development in MagentoEric Landmann
 

Was ist angesagt? (20)

What’s new in joomla 3.7
What’s new in joomla 3.7What’s new in joomla 3.7
What’s new in joomla 3.7
 
Introduction to building joomla! components using FOF
Introduction to building joomla! components using FOFIntroduction to building joomla! components using FOF
Introduction to building joomla! components using FOF
 
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
Creating a multilingual site in Joomla 3 (Joomla 3 Beginner's Guide)
 
How to create a joomla component from scratch
How to create a joomla component from scratchHow to create a joomla component from scratch
How to create a joomla component from scratch
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with Joomla
 
Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3
 
Packaging DNN extensions
Packaging DNN extensionsPackaging DNN extensions
Packaging DNN extensions
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimization
 
Considerations with Writing JavaScript in your DotNetNuke site
Considerations with Writing JavaScript in your DotNetNuke siteConsiderations with Writing JavaScript in your DotNetNuke site
Considerations with Writing JavaScript in your DotNetNuke site
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migration
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Development
 
Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3Develop Basic joomla! MVC component for version 3
Develop Basic joomla! MVC component for version 3
 
Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014
 
WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014WordPress SEO in 2014 - WordCamp Baltimore 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgets
 
10 common mistakes WordPress developers make when building multilingual sites
10 common mistakes WordPress developers make when building multilingual sites10 common mistakes WordPress developers make when building multilingual sites
10 common mistakes WordPress developers make when building multilingual sites
 
Front End Development in Magento
Front End Development in MagentoFront End Development in Magento
Front End Development in Magento
 

Andere mochten auch

All beauties shop
All beauties shopAll beauties shop
All beauties shopAndy Hartono
 
Doce musas pepe hierro
Doce musas pepe hierroDoce musas pepe hierro
Doce musas pepe hierroCRISMANZANARA58
 
Creating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPressCreating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPresscodebangla
 
PORTFOLIO Sevo Systemes
PORTFOLIO Sevo SystemesPORTFOLIO Sevo Systemes
PORTFOLIO Sevo SystemesDavid Sanchez
 
Metabolisme
MetabolismeMetabolisme
Metabolismedinafernata
 
Building Mobile App using WP REST API & AngularJS
Building Mobile App using WP REST API & AngularJSBuilding Mobile App using WP REST API & AngularJS
Building Mobile App using WP REST API & AngularJScodebangla
 
Prezentacja krasicki
Prezentacja krasickiPrezentacja krasicki
Prezentacja krasickiceltynka
 

Andere mochten auch (20)

All beauties shop
All beauties shopAll beauties shop
All beauties shop
 
Successroute.
Successroute.Successroute.
Successroute.
 
Doce musas pepe hierro
Doce musas pepe hierroDoce musas pepe hierro
Doce musas pepe hierro
 
Successroute.
Successroute.Successroute.
Successroute.
 
Fed ex MBA
Fed ex  MBAFed ex  MBA
Fed ex MBA
 
Kk day 2 am 1st speaker lambert ingenic - kakaokonec nov 2012
Kk day 2 am 1st speaker lambert   ingenic - kakaokonec nov 2012Kk day 2 am 1st speaker lambert   ingenic - kakaokonec nov 2012
Kk day 2 am 1st speaker lambert ingenic - kakaokonec nov 2012
 
Kk day 2 am 5th speaker AGUNG cocoa breedingprogressinindonesia
Kk day 2 am 5th speaker AGUNG cocoa breedingprogressinindonesiaKk day 2 am 5th speaker AGUNG cocoa breedingprogressinindonesia
Kk day 2 am 5th speaker AGUNG cocoa breedingprogressinindonesia
 
Creating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPressCreating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPress
 
PORTFOLIO Sevo Systemes
PORTFOLIO Sevo SystemesPORTFOLIO Sevo Systemes
PORTFOLIO Sevo Systemes
 
456
456456
456
 
Metabolisme
MetabolismeMetabolisme
Metabolisme
 
Building Mobile App using WP REST API & AngularJS
Building Mobile App using WP REST API & AngularJSBuilding Mobile App using WP REST API & AngularJS
Building Mobile App using WP REST API & AngularJS
 
Togel
TogelTogel
Togel
 
Prezentacja krasicki
Prezentacja krasickiPrezentacja krasicki
Prezentacja krasicki
 
Kk day 2 pm stream 1 3rd speaker amalin
Kk day 2 pm stream 1 3rd speaker  amalinKk day 2 pm stream 1 3rd speaker  amalin
Kk day 2 pm stream 1 3rd speaker amalin
 
Kk day 2 pm stream 2 1st speaker marlo mendoza ngp kakaokonek
Kk day 2 pm stream 2 1st speaker marlo mendoza ngp kakaokonekKk day 2 pm stream 2 1st speaker marlo mendoza ngp kakaokonek
Kk day 2 pm stream 2 1st speaker marlo mendoza ngp kakaokonek
 
Kk day 2 am 5th speaker agung cocoa breedingprogressinindonesia
Kk day 2 am 5th speaker agung cocoa breedingprogressinindonesiaKk day 2 am 5th speaker agung cocoa breedingprogressinindonesia
Kk day 2 am 5th speaker agung cocoa breedingprogressinindonesia
 
economict presentation
 economict presentation economict presentation
economict presentation
 
Fotografias
FotografiasFotografias
Fotografias
 
Kk day 2 am 2nd speaker DR ROMY CENA
Kk day 2 am 2nd speaker DR ROMY CENAKk day 2 am 2nd speaker DR ROMY CENA
Kk day 2 am 2nd speaker DR ROMY CENA
 

Ähnlich wie WordPress Theme & Plugin i18n & L10n

MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATION
MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATIONMAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATION
MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATIONMakarand Mane
 
WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...WordPress Trivandrum
 
WordPress Theme Workshop: Internationalization
WordPress Theme Workshop: InternationalizationWordPress Theme Workshop: Internationalization
WordPress Theme Workshop: InternationalizationDavid Bisset
 
WCRI 2015 I18N L10N
WCRI 2015 I18N L10NWCRI 2015 I18N L10N
WCRI 2015 I18N L10NDave McHale
 
PHPBootcamp - Zend Framework
PHPBootcamp - Zend FrameworkPHPBootcamp - Zend Framework
PHPBootcamp - Zend Frameworkthomasw
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017ylefebvre
 
Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016johnpbloch
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview QuestionsUmeshSingh159
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
PHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPPHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPLariya Minhaz
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsZend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsTricode (part of Dept)
 
PHP Basics
PHP BasicsPHP Basics
PHP BasicsRoohul Amin
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdfHASENSEID
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to phpTaha Malampatti
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answerssheibansari
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysqldurai arasan
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 

Ähnlich wie WordPress Theme & Plugin i18n & L10n (20)

MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATION
MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATIONMAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATION
MAKE YOUR THEMES AND PLUGINS READY FOR TRANSLATION
 
WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...WordPress Internationalization and Localization - WordPress Translation Day 3...
WordPress Internationalization and Localization - WordPress Translation Day 3...
 
WordPress Theme Workshop: Internationalization
WordPress Theme Workshop: InternationalizationWordPress Theme Workshop: Internationalization
WordPress Theme Workshop: Internationalization
 
WCRI 2015 I18N L10N
WCRI 2015 I18N L10NWCRI 2015 I18N L10N
WCRI 2015 I18N L10N
 
PHPBootcamp - Zend Framework
PHPBootcamp - Zend FrameworkPHPBootcamp - Zend Framework
PHPBootcamp - Zend Framework
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
PHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPPHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHP
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsZend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 

KĂŒrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

KĂŒrzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

WordPress Theme & Plugin i18n & L10n

  • 1. By Md. Sajedul Haque Romi Email: romi@codebangla.com
  • 2. ‱ Understanding Internationalization & localization ‱ Tools for localization ‱Implementation localization in WP themes ‱Implementation localization in WP plugins
  • 3. Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes.
  • 4. Localization is the process of adapting internationalized software for a specific region or language by adding locale- specific components and translating text.
  • 5. WordPress uses the gettext libraries and tools for i18n. In WordPress, you should use the __() wordpress-defined PHP gettext- compliant translation function.
  • 6. There are three types of files used in the gettext translation framework. ‱POT (Portable Object Template) files ‱PO (Portable Object) files ‱MO (Machine Object) files
  • 7. In your theme or plugin PHP files, write codes in the following way. __('message') passes the translation to the PHP return statement. _e('message') passes the translation to the PHP echo statement. Example: <?php $translated_text = __( 'text', 'domain' ); ?> Domain: Unique identifier for retrieving translated strings
  • 8. ‱Load a text domain ‱Process text messages with WordPress functions ‱Extract these messages with the appropriate software ‱Provide a translation for each message ‱Create a language file for a particular locale ‱Instruct WordPress to enable localization and to load the language file
  • 9. For Theme: In wp-content/themes/Test-Theme/functions.php For Plugin: In wp-content/plugins/Test-Plugin/index.php
  • 10. echo "Hello user"; _e("Hello user","mytheme"); the_content( "Read more" ); the_content( __("Read more","mytheme") );
  • 11. Sometimes, a text message includes dynamic data, such as a number from a PHP variable. In this case, we use the sprintf() function to produce the final message string: $results_found = 12; $message = sprintf( __("%s results found" , "mytheme") , $results_found );
  • 12. WordPress provides a function for singular and plural translation of the same text message called _n(): _n( $single, $plural, $number, $domain );
  • 13. Though the _n() is a built in WordPress function, using it is discouraged because the translation software parses only the first parameter of a function, and so these two text messages would not be fetched. Instead, we can use the PHP if statement: if($results_found == 1) $message = __("1 result found" , "my-text- domain"); else $message = sprintf( __("%s results found" , "my- text-domain") , $results_found );
  • 14. WordPress provides date_i18n() to translate dates. Example: <?php echo date_i18n(get_option('date_format') ,strtotime("11/15-1976")); ?> http://codex.wordpress.org/Function_Reference/date_i18n Bangla date translation http://tareq.wedevs.com/2010/09/translate-wordpress-date-time-comment-number-to-bangla-digit/
  • 16.
  • 17.
  • 18. ‱Poedit ‱GlotPress ‱GNU gettext Among them, Poedit is widely used for WordPress I18n & l10n. So we will be focused on Poedit translation method.
  • 19.
  • 20. Go to File>New Catalog

  • 21.
  • 22.
  • 23. Click ok, if you add the path correctly, you should see something like this
  • 24. Save the file as .pot ( not default.po) For theme ex: languages/test-theme.pot For plugin ex: languages/test-plugin.pot Then in Poedit, go to File>New catalog from POT file
 you will see your template for translation
  • 26. See the Source text box Add your translated phrase in Translation box
  • 27. When you are done adding your translated phrases, save the file in the WordPress theme as en_US.po or your language code .po file like bn_BD.po For plugin must save your-plugin-en_US.po Ex: test-plugin-bn_BD.po When you save the .po file a .mo file will be generated.
  • 28. Open wp-config.php file search for define('WPLANG’ Add your lanuage code and save it
  • 29.
  • 30. Congratulation! You have successfully finished your WordPress Theme & Plugin Translations.
  • 32. Md. Sajedul Haque Romi Founder & CEO CodeBANGLA Email: romi@codebangla.com