Do you know how themes and plugins become translation-ready? Or are you still unfamiliar with the term translation ready?
We do have our own indigenous language and targeted group of people. Globally there are various languages spoken like English, German, Chinese, Spanish, Japanese, Hindi, Nepali, Arabic, Russian, French, and many more. However, English reigns supreme, with over 1.1 billion total speakers—or roughly 15% of the global population. Native and non-native speakers both speak English as it is the world /international language. English is the default and common language in international business, tourism, technology, and much more.
As a default language, you might use English everywhere as 372.9 million use English as a first language. Contrary to this, indigenous communities of particular nations don’t speak and understand English. That is why you need multilingual websites to reach the targeted people of targeted countries and places.
Basically, You need plugins or themes to create websites so the plugins and themes you use to create your website must be translatable in your own particular chosen language. It helps deliver services to the people of particular places and areas. In this blog post, we will discuss what is translation-ready, how you can make your WordPress plugin translation-ready, how you can create a translation-ready website, and reach a global audience.
What is Translation Ready?
In simple terms, translation means a process of rendering from one language to another language. Whereas translation ready means the state of a piece of software or content that has been designed in a way that makes it easy to translate into multiple languages without significant modification or reprogramming.
A translation-ready theme/plugin can be translated into any preferred language. But any theme, plugin, addon, or software automatically doesn’t become translation-ready. One needs to use a standard set of practices in its code to make user-viewable strings translatable into other languages and locales.
WordPress developers also use ‘gettext’ to create translation-ready WordPress themes and plugins so that you can make a multilingual WordPress website.
How to make themes or plugins translation-ready?
To make themes and plugins translation ready you have to go through some steps to ensure that users can easily translate and localize themes or plugins into different languages.
1. Use International functions
In your theme’s PHP files, replace all hard-coded strings with internationalization functions provided by WordPress, such as __()
and _e()
.These functions are used for translating strings in PHP code. The __() function returns the translated string, and the _e() function echoes the translated string directly. This _x() function is used for translating strings with context.
2. Choose a text domain
A text domain is a unique identifier for translations. It helps WordPress identify which translations to load for your plugin and theme. You can assign a unique text domain to your theme or plugin which is used to identify your plugins/theme’s strings for translation. You can replace 'your-text-domain'
it with your chosen text-domain.
3. Create translation files
Translation files contain the translated strings for your plugin/themes. They are usually stored in a separate folder within your themes/plugin’s directory, commonly named ‘languages’. Translation files are compiled from source files with the ‘.po’ extension, which stands for Portable Object. You can create ‘.po’ files using a translation editor, such as Poedit, which allows you to define the original strings and their translations. Once you have created the ‘.po’ files, you need to compile them into ‘.mo’ files, which stand for Machine Object, using a Plugin like Automatic Translate Addon For Loco Translate. This file contains all the translatable strings from your theme and plugin.
4. Generate language files
After creating the .pot
file, generate language files (.po
and .mo
) for each target language using a translation tool or plugin. These files store translations for your theme or plugin. Basically, a POT file is a template of translatable strings in a program. Using a POT file, you then generate a .po
(Portable Object) file for your target language. The name of the file refers to the language it is for.
5. Provide translatable string
Ensure that all strings in your theme, including those in template files, theme options, and customizer settings, are translatable using internationalization functions. In plugins, you should make sure all strings within your plugin, including settings, labels, and user interface elements, are wrapped in internationalization functions.
6. Include translation files
After creating the translation files, you need to include them in your theme/plugin so that WordPress can load them when needed. You can do this by placing the ‘.mo’ files in the ‘languages’ folder of your plugin or theme and using the load_plugin/plugin_textdomain() function to specify the path to the folder. Place the generated .mo
files in a directory named /languages/
within your theme/plugin folder.
7. Load the text domain
In your theme’s functions.php
file, load the text domain, and specify the path to the language files. Similar to a theme, in your plugin’s main PHP file or initialization file, load the text domain and specify the path to the language files.
8. Update template files
Make sure your plugin/theme’s template files include translatable strings using the internationalization functions.
9. Test translations
Test your plugins or theme translations by changing your WordPress site’s language settings to the target language.
10. Provide documentation
Include documentation or instructions for translators, specifying how to use internationalization functions and how to generate language files.
With these practices, you can make your themes and plugins translation-ready. That allows users to easily translate them into different languages, thus expanding their reach and usability to a broader audience.
How to create a multilingual or translation-ready website?
A multilingual or translation-ready website is a website with content in more than one language. It’s useful for businesses or anyone who wants to attract a global customer base. That is why a multilingual website is the most popular in countries where international language is not applied. Besides, support for more languages means a better chance of capturing customer interest worldwide. Isn’t it?
On the Other hand, a website should be translatable if your community or country has its own specific indigenous communities who have their own specific language to communicate. In fact, the website should communicate language-specific content to reflect the local culture of the visitor. Basically, It’s not enough to just translate the words on your site, you also need to localize your content and get it to rank on search engines. While translating a website into multiple languages we should value or respect cultural differences, create dedicated URLs, and go all-in on the most common languages without losing the value of slang words.
When it comes to building your WordPress multilingual site, the right plugin can streamline the job. There are several plugins available that make our website multilingual if we install them. In addition, choosing the best translation-ready theme is the perfect solution for a multilingual website that we want to create.
Warm Up!
Creating WordPress plugins and themes translation-ready is an essential step to ensure that the plugins/themes you make can be easily translated into different languages to cater to a global audience. Though It’s critical to respect cultural differences, create dedicated URLs, and go all-in on the most common languages in your target market, it is indispensable to have multilingual functionalities in our products. Thus, we can reach wider audiences, foster business and grow organic traffic.
If you are a WordPress developer, the steps outlined in the article above will definitely work which include internationalization functions, defining a text domain, creating translation files, including them, loading the text domain, testing translations, and so on to make translation ready. Or if you are just creating a website for your business adding plugins, or ready-made translation-ready themes will work.
Providing translations for your plugins/themes/addons/software allows you to reach a wider audience and make it more user-friendly for non-English speakers. It shows that you value inclusivity and accessibility, which can contribute to the success and popularity of your created products.
Don’t miss the opportunity to elevate your site towards success. Invest the effort to make your themes and plugins translation-ready.
Keep Reading Us! We will see you soon with other useful articles.
To create a multilingual website, we can go for translation-ready themes, and install multilingual plugins that work perfectly with WordPress websites.