GlotPress aka
translate.WordPress.org
WordCamp Praha 2015
Marko Heijnen
• Lead developer of GlotPress

• Core contributor for WordPress

• Working for 1&1 as their
WordPress specialist
To start with, what is
GlotPress
• GlotPress is a collaborative, web-based software
translation tool
• GlotPress will let you, or an entire team, to translate their
favourite software
• It is as open-source like WordPress is
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
Default theme
Custom theme
Translations overview
Translations flow
The history behind it
The history
• Started in April 2008 by Nikolay Bachiyski.
• Uses BackPress as a framework.
• And it’s OOP developed.
• March 2013 I started managing GlotPress.
• In 2014 we had our first GSoC project.
How it is structured
OOP
• Uses BackPress which has a lot of useful classes (and
functions).
• And we build on top of that our features like routers,
formats and things.
• Those three type of objects always need to extend the
generic class.
• The generic classes have shared functionality or abstract
methods the derived class needs.
GP_Thing
• Because of the generic classes we can make our code
more readable.
• You can define in a thing which fields are required to
create a new item.
• A thing is a project, user, translations etc.
• GP_Glossary file has only 42 lines of code and has all
validations in place.
The use of functions
• We still use them a lot like WordPress does for in themes.
• A lot of them are copied over from WordPress.
• This is a great thing cause if you are using GlotPress
yourself you can “easily” add a feature to GlotPress
because the hook system is in place.
• And so many other great features you use when building
for WordPress
CLI
• GlotPress has a lot of scripts that you can or must use.
• Like adding a new admin is a must due missing user
management. Will have an add user script soon.
• Or things like import/export originals or translations.
• It creates possibilities to build automatic tasks
WordPress core & translate.WordPress.org
translate.WordPress.org instalation
Current Status

downloadable packages
• 141 locales with a wp_locale
• 41 locales are up to date
• 15 locales are still on 4.1
• 8 locales are one major version behind
• 16 locales are behind by two or more major version
• 61 locales don’t have a package
• 40 locales have a language pack
• Oldest version is 2.8.5.
For Czech
For future
• More integrated in the WordPress environment
• Soon it will include all plugins and themes
• Currently ~10.000 plugins are translatable
Some of the new features
Glossary
Proles
Upcoming features
• Decline with feedback
• User dashboard
• Notifications
• Improved workflow
• New theme

https://github.com/GlotPress/New-Default-Theme
What can you do with it as a developer?
Use it yourself
• Using it for your own themes, plugins or projects
• Almost as easy to extend as WordPress
• It has a grunt plugin to download translations easily
Grunt
THE JAVASCRIPT TASK RUNNER 

http://gruntjs.com
• Running tasks by using CLI
• Easy to use, harder to configure
• Extendable with your own plugins
• Uses npm for plugin management
The GlotPress grunt task
grunt.initConfig({

	 glotpress_download: {

	 	 core: {

	 	 	 options: {

	 	 	 	 domainPath: 'languages',

	 	 	 	 url: 'http://wp-translate.org',

	 	 	 	 slug: 'tabify-edit-screen',

	 	 	 	 textdomain: 'tabify-edit-screen',

	 	 	 }

	 	 },

	 },

});
GP_Plugin
• Has a set of useful methods based on your defined id.
• get_option, update_option
• add_action, add_filter
• remove_action, remove_filter
The base of your plugin
<?php
class My_First_Plugin extends GP_Plugin {
	 public $id = 'my-rst-plugin';
	 public function __construct() {
	 }
}
GP::$plugins->my_rst_plugin = new My_First_Plugin;
Plugins out there
• https://github.com/Yoast/glotpress-seo
• https://github.com/Yoast/i18n-module
• https://github.com/markoheijnen/GlotPress-APCu-Cache
• https://github.com/markoheijnen/GlotPress-Analytics
• https://github.com/markoheijnen/GlotPress-child-theme
• Private project: GlotPress Updater
WP-Translate.org
Updater
The tools we use
Tools we use
• We do have a certain amount of Unit tests Travis to run
our unit tests
• https://scrutinizer-ci.com/g/GlotPress/GlotPress/ for
Code quality scans
• https://coveralls.io/ for code coverage history and stats
Thank you for listening
Questions?
@markoheijnen

markoheijnen.com

GlotPress aka translate.wordpress.org

  • 1.
  • 2.
    Marko Heijnen • Leaddeveloper of GlotPress • Core contributor for WordPress • Working for 1&1 as their WordPress specialist
  • 3.
  • 4.
    GlotPress • GlotPress isa collaborative, web-based software translation tool • GlotPress will let you, or an entire team, to translate their favourite software • It is as open-source like WordPress is
  • 5.
    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
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
    The history • Startedin April 2008 by Nikolay Bachiyski. • Uses BackPress as a framework. • And it’s OOP developed. • March 2013 I started managing GlotPress. • In 2014 we had our first GSoC project.
  • 12.
    How it isstructured
  • 13.
    OOP • Uses BackPresswhich has a lot of useful classes (and functions). • And we build on top of that our features like routers, formats and things. • Those three type of objects always need to extend the generic class. • The generic classes have shared functionality or abstract methods the derived class needs.
  • 14.
    GP_Thing • Because ofthe generic classes we can make our code more readable. • You can define in a thing which fields are required to create a new item. • A thing is a project, user, translations etc. • GP_Glossary file has only 42 lines of code and has all validations in place.
  • 15.
    The use offunctions • We still use them a lot like WordPress does for in themes. • A lot of them are copied over from WordPress. • This is a great thing cause if you are using GlotPress yourself you can “easily” add a feature to GlotPress because the hook system is in place. • And so many other great features you use when building for WordPress
  • 16.
    CLI • GlotPress hasa lot of scripts that you can or must use. • Like adding a new admin is a must due missing user management. Will have an add user script soon. • Or things like import/export originals or translations. • It creates possibilities to build automatic tasks
  • 17.
    WordPress core &translate.WordPress.org
  • 18.
  • 19.
    Current Status
 downloadable packages •141 locales with a wp_locale • 41 locales are up to date • 15 locales are still on 4.1 • 8 locales are one major version behind • 16 locales are behind by two or more major version • 61 locales don’t have a package • 40 locales have a language pack • Oldest version is 2.8.5.
  • 20.
  • 21.
    For future • Moreintegrated in the WordPress environment • Soon it will include all plugins and themes • Currently ~10.000 plugins are translatable
  • 22.
    Some of thenew features
  • 23.
  • 24.
  • 25.
    Upcoming features • Declinewith feedback • User dashboard • Notifications • Improved workflow • New theme
 https://github.com/GlotPress/New-Default-Theme
  • 26.
    What can youdo with it as a developer?
  • 27.
    Use it yourself •Using it for your own themes, plugins or projects • Almost as easy to extend as WordPress • It has a grunt plugin to download translations easily
  • 28.
    Grunt THE JAVASCRIPT TASKRUNNER 
 http://gruntjs.com • Running tasks by using CLI • Easy to use, harder to configure • Extendable with your own plugins • Uses npm for plugin management
  • 29.
    The GlotPress grunttask grunt.initConfig({
 glotpress_download: {
 core: {
 options: {
 domainPath: 'languages',
 url: 'http://wp-translate.org',
 slug: 'tabify-edit-screen',
 textdomain: 'tabify-edit-screen',
 }
 },
 },
 });
  • 30.
    GP_Plugin • Has aset of useful methods based on your defined id. • get_option, update_option • add_action, add_filter • remove_action, remove_filter
  • 31.
    The base ofyour plugin <?php class My_First_Plugin extends GP_Plugin { public $id = 'my-rst-plugin'; public function __construct() { } } GP::$plugins->my_rst_plugin = new My_First_Plugin;
  • 32.
    Plugins out there •https://github.com/Yoast/glotpress-seo • https://github.com/Yoast/i18n-module • https://github.com/markoheijnen/GlotPress-APCu-Cache • https://github.com/markoheijnen/GlotPress-Analytics • https://github.com/markoheijnen/GlotPress-child-theme • Private project: GlotPress Updater
  • 33.
  • 34.
  • 35.
  • 36.
    Tools we use •We do have a certain amount of Unit tests Travis to run our unit tests • https://scrutinizer-ci.com/g/GlotPress/GlotPress/ for Code quality scans • https://coveralls.io/ for code coverage history and stats
  • 37.
    Thank you forlistening Questions? @markoheijnen markoheijnen.com