milescellar / phpbb-translation-validator
This console application allows you to validate phpBB language packages.
Installs: 1 217
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
- symfony/console: 3.4.*
- symfony/finder: 3.4.*
- symfony/yaml: 3.4.*
Requires (Dev)
- phpunit/phpunit: 5.7.*
This package is auto-updated.
Last update: 2020-05-22 18:44:26 UTC
README
This console application allows you to validate phpBB language packages.
Informations
This validator is compatible with phpBB 3.2.x and is released under the GNU General Public License 2.0. Please see the license terms.
Installation
- Download the British English language package.
- Run
git clone https://github.com/milescellar/phpbb-translation-validator.git
to clone this repository. - Run
php src/Phpbb/TranslationValidator/PhpbbTranslationValidator.php
to download the dependencies.
For the easiest results, create a directory called 3.2 in the root of the validator. Upload the en language page into this directory, along with the languages you wish to test.
The simplest way to validate is to run the command php translation.php validate fr
. Please note that the final argument is the language you wish to test and that has already been uploaded to the 3.2 directory, for example fr for French.
There are more arguments that can be supplied. For example, suppose you wanted to have your 3.2 directory in a different location, you wanted to explicitly specify phpBB version 3.2, you wanted to run in safe mode and you wanted to see all notices displayed. In that case, you would run the following command:
php translation.php validate fr
--package-dir=/path/to/your/3.2
--phpbb-version=3.2
--safe-mode
--display-notices
The --safe-mode
flag indicates that you want to parse files instead of directly including them. This is useful if you want to run validations on a web server.
Tests
Firstly, add the validator as a dependency to your composer.json file:
{
"require-dev": {
"milescellar/phpbb-translation-validator": "2.1.*"
}
}
Then add the php translation.php
command in the script section to your .travis.yml file.
We use Travis CI as a continous integration server and PHPUnit for our unit testing.
Finally, you can run the command php vendor/phpunit/phpunit/phpunit tests/
if you want to run the unit tests locally.