Skip to main content
  1. All Posts/

i18n

Tools Open Source PHP WordPress

i18n

i18n WordPress tools

Goal

  • Improve makepot.php so that are no error reports.
  • Allow add-textdomain.php to add text domain to multiple files
  • To create a WordPress plugin out of this.

Features

  • create POT with strings and translator texts
  • add text domain to strings

Documentation

Installation

To get it running you need to download the files, clone or fork the repo.

Create a pot file for themes

Change the directory in command line to where the POT file should be created.
Paste this code in the command line.

php C:pathtoi18nmakepot.php wp-theme C:pathtotheme-folder

Create a pot file for plugins

Change the directory in command line to where the POT file should be created
Paste this code in the command line.

php C:pathtoi18nmakepot.php wp-plugin C:pathtoplugin-folder

Add a text domain

Change the directory in command line to where the text domain should be added to the strings in the file.
Paste this code in the command line.

php C:pathtoi18nadd-textdomain.php -i text-domain file.php

or

php C:pathtoi18nadd-textdomain.php -i text-domain file.php > new-file.php

Files

The pomo folder is part of WordPress core. As it is a important part of this project I have inlcuded it here so that it can be edited as needed.

Contribute

Contributions

WooCommerce has been great help. I was able to use some of the fixes from there.

Support

If you are having issues, please let us know.
You can report them in the issues tracker.

License

The project is licensed under the GPL-2.0+ license.