Skip to content

gwsn/wp-languages.github.io

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wp-languages.github.io

Build Status License

Features

  • Supports https by using github.io ssl. Composer default configuration only accepts https by default starting from 2016.
  • Automatically creates composer packages for WordPress translations from api.wordpress.org.
  • This repo provides custom satis repository for WordPress languages. See more in wp-languages.github.io.
  • If you would like to add more language files please submit a pull request.
  • Repos are updated daily with Travis CI.

Example configuration with composer

This example adds all translations from finnish and french packages.

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://wp-languages.github.io"
        }
    ],
    "require": {
      "koodimonni-language/fi": "*",
      "koodimonni-language/fr_FR": "*"
    },
    "extra": {
      "dropin-paths": {
        "htdocs/wp-content/languages/": ["vendor:koodimonni-language"],
        "htdocs/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"],
        "htdocs/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"]
      }
    }
}

Request packages

If package what you're looking for can't be found look first the response from api:

https://api.wordpress.org/translations/core/1.0/

If your language is not listed in the response we can't help you. You'll need to ask from wp-core translators instead.

This is pretty static repository and we can't add all possible plugins here.

Manually adding any language zip to your composer.json

There's also manual method of including any translation in wordpress.org. This is useful because we can't include all plugins in this repository. Let's look how to add french (fr_FR) jetpack translations. First search the api for jetpack translations:

$ curl -s 'https://api.wordpress.org/translations/plugins/1.0/?slug=jetpack' | python -m json.tool

Choose your language zip from json output for example for us it was: https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip

Then add it to your composer like this example. You just need to update the version number everytime the package updates.

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "koodimonni-plugin-language/jetpack-fr_FR",
                "type": "wordpress-language",
                "version": "3.9.2",
                "dist": {
                    "type": "zip",
                    "url": "https://downloads.wordpress.org/translation/plugin/jetpack/3.9.2/fr_FR.zip",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "koodimonni/composer-dropin-installer": "*",
        "koodimonni-plugin-language/jetpack-fr_FR": ">=3.9.2"
    },
    "extra": {
      "dropin-paths": {
        "htdocs/wp-content/languages/": ["vendor:koodimonni-language"],
        "htdocs/wp-content/languages/plugins/": ["vendor:koodimonni-plugin-language"],
        "htdocs/wp-content/languages/themes/": ["vendor:koodimonni-theme-language"]
      }
    }
}

How to use this project as self-hosted version:

# Clone the project to your own server
$ git clone https://github.com/wp-languages/wp-languages.github.io /to/your/htdocs
$ cd /to/your/htdocs
$ composer install

# Set new cronjob
$ crontab -e
# Add following line to your cron
*/30 * * * * cd /to/your/htdocs && php bin/wp-org-api && php bin/satis satis.json .

License

MIT License

About

Composer repository for WordPress translation files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 79.8%
  • HTML 18.2%
  • Shell 2.0%