This repository contains Textpacks for Textpattern CMS. Textpacks are the translation file format Textpattern will eventually use in a future version.
To make corrections to existing translations, or to add new ones, fork the repository. Once you are done, send in a pull request. To boost workflow the repository contains synchronisation scripts and automated tests.
GitHub’s web based editing features allow you to easily do smaller edits to existing translations without you needing to delve into git. Changing files through the web interface isn’t really recommended, but its an option for those that do not use git, or are away from their computer.
To contribute to a translation directly from GitHub.com website:
- Navigate to a Textpack file you would want to alter, e.g. textpacks/en-gb.textpack.
- Hit the Edit button above the presented file contents.
- Do some alterations to existing strings. Please, don’t remove or add any string.
- After you’ve done, fill in the short commit message describing the change, e.g. “Fixed typo in the name string”.
- Hit the Save button.
Now to submit in a new pull request with your changes:
- Hit the Click to create a pull request for this comparison link on the page presented to you after saving, or you can use the Compare and pull request button on your fork’s repository page.
- Fill in the comment field; explain what your changes do. Be precise and clear.
- Hit the Send pull request button.
Once your pull request is processed and marked closed (merged or denied), go back to your GitHub profile page and delete your clone of the Textpacks repository:
- Find the textpacks repository on your profile page; it should be listed on your repository list.
- Open it.
- On the repository’s page, hit the Settings link.
- Scroll down until you see Delete repository button.
- Hit it and confirm the action.
Adding and removing strings happens through the main translation file, en-gb.textpack
. Open up the file and add or remove strings as needed (remember to place new strings where they belong). Once you are done, run the sync tool:
$ ./textpack
The Textpack tool will sync your alterations to all other Textpack files. It creates new empty strings and removes anything that is no longer present in the root translation.
When creating entirely new translations, always use the en-gb.textpack
as your template and reference point – this file is always up to date.
Start by creating a new empty Textpack file:
$ touch textpacks/xx-xx.textpack
Then run the Textpack sync tool:
$ ./textpack
This will populate your empty xx-xx.textpack
file with an empty Textpack template.
The project uses PHPunit for running its unit tests. Before running the tests, make sure you have installed dev-requirements using Composer:
$ composer install --dev
To run a test:
$ ./vendor/bin/phpunit