This tool tries to make it easier for translators to reuse translations from one local variation of a language to another and also between languages.
It is designed (and was initially developed for this purpose) for those cases of bilingual people who want to take advantage of the fact that one of the two languages they master has a much higher percentage of translations. For example, in the case of Galicia (Spain), its inhabitants are bilingual in Galician and Spanish, so that the Galician translation community can take advantage of the translation of the Spanish team (from Spain), using files pre-translated into Spanish of the translation strings that are missing in Galician, so the translation effort is much less, since in this case the translation is from Spanish to Galician and not from English to Galician. Similar cases are those of Catalan, Basque, Aragonese, Asturian, Balearic ...
It is also designed for those cases in which there is a variation in the language, such as the case of Spanish, which has variations such as Spanish from: Spain, Peru, Venezuela ... in which the translations that have a lower percentage can use the work of the group that has done more work, as is the case of Spanish from Spain. This is also valid for other languages such as English, which has variations in Canada, UK, Australia ...
The resulting file is a ".po" file of the missing strings to be translated into the target language with the pre-translated strings in the source language.
-
Translation type. You can select to translate:
- A plugin.
- A theme.
- Patterns.
- The WordPress Development.
- The WordPress Continents & Cities.
- The WordPress Administration.
- The WordPress Network Administration.
- Meta - WordCamp.org.
- Meta - WordPress.org.
- Meta - WordPress Plugin Directory.
- Meta - WordPress Theme Directory.
- Meta - Pattern Directory.
- Meta - Forums.
- Meta - o2.
- Meta - Rosetta.
- Meta - Breathe.
- Meta - Browser Happy.
- Meta - Get involved.
- Meta - Learn WordPress.
- Meta - Openverse.
- The Android app.
- The iOS app.
-
Translation from. You can select a plugin to translate from Development (trunk) or from Stable (latest release).
-
Slug. The slug of the plugin or theme. You can find it in the URL. For example, "wp-super-cache" is the slug for the plugin "WP Super Cache" and its URL is https://translate.wordpress.org/locale/gl/default/wp-plugins/wp-super-cache/
-
Download the readme. If you select this option, the app doesn't download the code translation, only the readme translation (only available for the plugins).
-
Source language. The language from which the translation strings will be copied.
-
Destination language. The language into which the translation strings will be copied from the source language.
-
Number of strings. The number of translation strings that will contain the output file.
-
Translate using internal database. This option uses an internal database to automatically translates well know words or small strings between to languages. It only works for Spanish (Spain) to Galician. Limited to 50 strings due the CPU consumption.
The resulting file is a "po" file of the missing strings to be translated into the target language with the pre-translated strings in the source language.
- This process may take a few seconds. Be patient.
- Do not click "Download .po" more than once.
- PHP 8.4 or higher
- Laravel 12.x
- MySQL 5.7+ / MariaDB 10.3+ / PostgreSQL 10+ / SQLite 3.35+
- Composer 2.x
- Web server (Apache, Nginx, etc.)
git clone https://github.com/amieiro/wp-polyglots-facilitator.git
cd wp-polyglots-facilitatorcomposer installCreate your .env file from the example:
cp .env.example .envGenerate the application key:
php artisan key:generateUpdate the database connection parameters in your .env file:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_passwordFor production environments, update these variables in .env:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.comRun migrations and seed the database:
php artisan migrate:fresh --seedCreate the symbolic link for public storage:
php artisan storage:linkFor local development with PHP 8.4:
# Using PHP 8.4 specifically
php artisan serve
The application will be available at `http://localhost:8000`.This tool is tested with Laravel Dusk.
composer require --dev laravel/dusk
php artisan dusk:install# Run all Dusk tests
php artisan dusk
# Run specific test file
php artisan dusk tests/Browser/ExampleTest.phpThis application includes several custom Artisan commands for scraping WordPress translation data.
Download and store all available languages from translate.wordpress.org:
php artisan wp-translation:scrap-languagesScrape translation statistics for all languages:
php artisan wp-translation:scrap-language-statisticsDownload translation files (.po) for WordPress themes and store them in the database.
Basic usage:
php artisan wp-translation:scrap-translationsAvailable options:
php artisan wp-translation:scrap-translations --helpOptions include:
--type=themes- Download type (currently only themes supported)--locale=es- Target language code--minWait=0- Minimum wait time between requests (seconds)--maxWait=0- Maximum wait time between requests (seconds)--downloadAll- Download all themes, including already processed--deletePo- Delete .po files after processing--showStats- Show translation statistics instead of downloading
Example:
php artisan wp-translation:scrap-translations --type=themes --locale=gl --minWait=15 --maxWait=25This tool uses:
- Laravel 12.x as web framework. MIT license.
- PHP 8.4 programming language.
- MySQL 5.7+ as database. GPL v2 license.
- Bootstrap 4.3.1 as base template. MIT license.
- Goutte 4.x for web scraping.
- Laravel Excel 3.x for importing/exporting Excel files.
- Carbon 3.x for date/time manipulation.
This software is released under the AGPL license 3.0.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues, questions, or contributions, please use the GitHub issue tracker.