Internationalizing a ClassicPress plugin: How does internationalization work?

ClassicPress PluginsThis post is part of the sub-series on Translating a ClassicPress plugin which is part of the Translating a ClassicPress plugin series.

ClassicPress uses the gettext libraries and tools for internationalization; gettext is an old and respectable piece of software which is widely used in the world of open-source.

The basics of how it works are:

  • Developers wrap translatable strings in special gettext functions.
  • Special tools parse the source code files and extract the translatable strings into POT (Portable Objects Template) files.
  • Translators translate the strings in the POT file and save the translations into a PO file.
  • PO files are compiled to binary MO files, which give faster access to the strings at run-time.

Over the next few posts, I’ll be stepping through what you have to do while developing an internationalized plugin to allow a POT file to be created.

Translating a ClassicPress plugin

Internationalizing a ClassicPress plugin
How does internationalization work?
What is a Text Domain and how is it specified?
Localization functions
Which localization functions to use?
Localizing a string
Don't paramaterize your text domain
Localizing a string containing a parameter
Localizing a string including plurals
Localizing a string including notes for the translator
Don't include HTML markup in localization
Don't localize URLs

Internationalizing a ClassicPress plugin: Series Index

ClassicPress PluginsThis series is part of a wider series on Internationalizing a ClassicPress plugin.

In the first posts on the parent series, I explained what internationalization and localization are and, in this sub-series, I am going to explain the process of internationalizing a plugin developed for ClassicPress.

Continue reading “Internationalizing a ClassicPress plugin: Series Index”

Translating a ClassicPress plugin: When should a plugin be internationalized?

ClassicPress PluginsThis series if a is part of the Translating a ClassicPress plugin series.

In the last post I discussed why internationalization was important, but the follow on from this is when should a plugin be internationalized.

When developing a plugin, it is tempting to work on the functionality first and then go back to internationize the strings afterwards. When I started developing plugins, none of them were interationalized. When I started doing so, I had to go back and find all the strings and then wrap them in the relevant functions.

New plugins, I have internationalized from the beginning and this is much less work and also means there is much less opportunity to miss a string which going back afterwards makes quite likely.

My recommendation, is to internationalize your plugin from the beginning and thereby save yourself time and errors.

Click to show/hide the Translating a ClassicPress plugin Series Index

Translating a ClassicPress plugin: Why is Internationalization and Localization important?

ClassicPress PluginsThis post is part of the sub-series on Translating a ClassicPress plugin which is part of the Translating a ClassicPress plugin series.

ClassicPress is already used in many different countries where English is not the main language; and even where it is, there can be variations in the spelling of words. ClassicPress itself is internationalized and can be localized.

Plugins and themes developed for ClassicPress should also be internationalized so that they can then be localized. The developer who authors the plugin doesn’t have to do the localization (translations), but by internationalizing the plugin it means that others can easily translate the plugin without needing to modify any code.

By making translations easy to do, you increase the audience for your plugin as site admins can easily translate it into their sites language.

Click to show/hide the Translating a ClassicPress plugin Series Index

Translating a ClassicPress plugin: What is Internationalization and Localization?

ClassicPress PluginsThis post is part of the sub-series on Translating a ClassicPress plugin which is part of the Translating a ClassicPress plugin series.

Internationalization (often abbreviated as i18n as there are 18 letters between the letters i and n) is the process of developing a plugin so it can easily be translated into other languages.

Localization (often abbreviated as l10n as there are 10 letters between the letters l and n) is the process of translating an internationalized plugin.

If you are a theme or plugin author, you should regard internationalization (i18n) and localization (l10n) as a requirement for your ClassicPress projects.

Click to show/hide the Translating a ClassicPress plugin Series Index

Translating a ClassicPress plugin: Series Index

ClassicPress PluginsI started using WordPress when I launched this blog back in 2011 and a couple of years later started writing plugins to add missing functionality. At the end of last year I switched over to ClassicPress, a hard-fork of WordPress.

As part of my transition to ClassicPress I created new versions of my plugins which added new functionality and improved security. I had already done some work to internationalize my plugins, but took the opportunity to improve this aspect as well.

Having done so, I thought that a series on how to internationalize and localize plugins might be a useful thing to write; while the series is targeted at plugins, as I am a plugin author, the principles are the same for themes.

This series will include a couple of sub-series as well as the core series; the index for all are below and will automatically grow as the posts go live.

Continue reading “Translating a ClassicPress plugin: Series Index”

Could You Contribute To ClassicPress?

ClassicPressWhen Gutenberg for WordPress was released I did try to use it, but found it was unusable. Instead I started taking a look at ClassicPress and liked what I saw. I eventually started planning to migrate my sites from WordPress to ClassicPress and outlined my reasons for doing so.

I have also invested some time in creating new versions of my plugins for ClassicPress; these plugins are either entirely rewritten to bring them up to a certain level of coding standard, including massive improvements to the security aspect, or they are entirely new plugins (such as the Add Twitter Cards and URL Shortener).

I’ve also been involved in translating ClassicPress and writing some documentation, both areas I intend to continue helping with, and am considering looking at some of the simpler issues on GitHub.

I am only a contributor on a very small scale; many others are making much, much larger contributions. Which is the point. Behind every successful open source project is a vibrant community who is involved in both developing for and supporting the project.

Open source projects like ClassicPress need contributions from all sorts of people with all sorts of skills. All large projects like ClassicPress have a lot of work to do, especially in areas such as new infrastructure, defining roles, procedures, tools and organizing tasks.

ClassicPress Needs You

Could you contribute to ClassicPress? Check out this post on the ClassicPress blog and see how you could help out.

ClassicPress needs help from people who are developers, designers, marketers, people who are multi-lingual and can help with translations. It needs all sorts of people. Why not get involved?

If you don’t have the time to actively contribute, you can also help the project by voting on the future direction of development on the petitions site. The petitions site allows you to vote on what changes or new functionality should be introduced in future versions of ClassicPress.

This is one of the areas which separates ClassicPress from WordPress; ClassicPress lets you have a say in the future course of the project.

Check Out ClassicPress On Product Hunt

ClassicPressClassicPress v1 was released on 5th March 2019 and has now been shared onto Product Hunt, which is a website that lets users share and discover new products.

Check it out and cast your vote!

I’ve decided to go all in on ClassicPress; I moved all my sites across to it a little while ago and have also created new versions of my plugins specially for it.

If you want to use ClassicPress I also have you covered with series on installing it and migrating to it.

For those who don’t know, ClassicPress is a hard fork of WordPress 4.9; the last version before the horrendous Gutenberg block editor was forced out by Automattic (WordPress.org is ostensibly a community-led open source project, but Gutenberg was decided upon and forced by Automattic without engaging with the community).

ClassicPress has a petitions site where the community can vote on what features are added to or changes made to ClassicPress. ClassicPress is intended to be a community-led project where no-one person can dictate changes; to this end additional directors have recently been added to the board.

azurecurve ClassicPress Plugins: Translating Plugins

ClassicPress PluginsThis is part of the azurecurve ClassicPress Plugins which introduces the plugins I have available for ClassicPress.

All of the plugins I have created for ClassicPress have been created to support translations. I only speak English so the plugins currently only ship with English vailable; pot files are included in the plugins /languages folder which can be used to translate the plugin using software such as PO Edit.

In addition, I have a translation website which can be used to translate plugins without needing to install any software. To request a language be added for translation, visit my community site and ask for the language to be added.

azurecurve ClassicPress Plugins: Support for Plugins

ClassicPress PluginsThis is part of the azurecurve ClassicPress Plugins which introduces the plugins I have available for ClassicPress.

Over the course of this series, I have announced all of the plugins I have created for ClassicPress. I have created a Community site where I will provide support.

Whether you have a bug report, feature request, question or want to translate the plugin, this site is the place to go.