#Wordpress translations as composer packages
Breaking changes in 2016
If you were using: http://languages.koodimonni.fi please change to https://wp-languages.github.io instead.
I fell so much in love with using composer on wordpress that I just hated how there was no good solution to install languages with composer.
Well until I made this custom repository: https://wp-languages.github.io
It uses my composer dropin installer which solves the problems with composer overwriting everything in the same folder.
So now you can extract multiple packages into same folder: web/app/languages
Site is hosted in github pages and uses translation zip-archives from api.wordpress.org. So big thanks for them.
##How to use
There’s 4 types of packages. These examples are for French (fr_FR):
koodimonni-language/fr_FR => All latest language files for French. This includes wordpress-importer,akismet, woocommerce and all twenty-themes (if available for that language). So use this shortcut to automatically include all packages mentioned below.
If you want to be picky you can choose which packages to include by using these examples:
koodimonni-language/core-fr_FR => Just core language packages
koodimonni-plugin-language/akismet-fr_FR => akismet plugin translations
koodimonni-theme-language/twentyfifteen-fr_FR => twentyfifteen translations
You can search packages for your language from https://wp-languages.github.io-frontpage.
Just remember add this into composer.json
:
"extra": {
"dropin-paths": {
"web/app/languages/": ["vendor:koodimonni-language"],
"web/app/languages/plugins/": ["vendor:koodimonni-plugin-language"],
"web/app/languages/themes/": ["vendor:koodimonni-theme-language"]
}
}
You can find complete working composer.json
example over here: composer.json for latest Wordpress using johnpbloch/wordpress and languages.koodimonni.fi. This file has also an example of how to handle wordpress dropin-files (e.g. object-cache.php, sunrise.php, ...) using composer.json · GitHub
Notices:
- Composer isn’t case sensitive so it doesn’t care if you require
koodimoni-language/fr_FR
orkoodimonni-language/fr_fr
. The files inside packages will still use correct naming (eg. fr_FR.po). - composer dropin installer understands install/update operations but can’t handle composer delete operations (yet).
- Packages are updated into gh-pages every 30-minutes.
Source and issue tracking available in Github.
Big thanks for @haroldangenent for good feedback.
I hope you find it useful!