Main goal of my session is an introduction to GlotPress, it’s usages and tools related to it. In addition I will share some good practices for translating WordPress themes and Plugins.
5. What is GlotPress
GlotPress is the open-source engine that
powers the translation of WordPress and
related projects
6.
7.
8. Features
• Different roles: Translators, Validators and Admins
• Translate strings
• Validate strings
• Manage strings by reject/approve them
• Having a glossary with common words
• Import/Export different formats
9. GlotPress History
• Started in April 2008 by Nikolay Bachiyski
• Uses BackPress as a framework
• And it’s OOP developed
• In 2013 Marko Heijnen started managing GlotPress
• In 2014 they have started first GSoC project
10. How it will work
• Uses BackPress which has a lot of classes
• A lot of the functionalities are copied over from
WordPress
• GlotPress has a lot of scripts
• Import/export originals or translations
24. Core Functions
• Always use only static strings
• Don’t use I18N functions on variables
• Always provide text domains like
_e( ‘string’,'textdomain')
25. Providing More Information
• Context
_x('Sachin Tendulkar', 'A Cricketer', 'plugin-slug');
_x('Sachin Tendulkar', 'Best batsman ever', 'plugin-slug');
_x('Sachin Tendulkar', 'God of cricket', 'plugin-slug');
• Translator comment
/* translators: description for a picture of Sachin */
_e( ‘Sachin', 'plugin-slug' );
26. Creating Language Files
• Translation consists, mostly, of creating POMO
files
• POT file – Portable Object Template
• PO file – Portable Object
• MO file – Machine Object