|
1 | | -# phpBB Translation Validator Extension |
| 1 | +# phpBB Translation Validator |
2 | 2 |
|
3 | | -Allows to validate **phpBB** language packages. |
| 3 | +This console application allows you to validate [phpBB](https://www.phpbb.com) language packages. |
4 | 4 |
|
5 | | -## Requirement |
| 5 | +## Requirements |
6 | 6 |
|
7 | | -This extension requires PHP 5.6 to 7.1 to be set up. |
| 7 | +This extension requires PHP 5.5.9 or above. |
8 | 8 |
|
9 | | -## Installation for validating a language package locally |
| 9 | +### Installation |
10 | 10 |
|
11 | | -*Note:* the validator only works when you have the source language pack in your directory (default source language is `en`). |
| 11 | +Firstly, download the latest British English (`en`) [language pack from phpBB.com](http://www.phpbb.com/customise/db/translation/british_english/) as this is the default source language. Then clone this repository and download the dependencies: |
12 | 12 |
|
13 | | -1. [Download](https://github.com/nickvergessen/phpbb-translation-validator/archive/master.zip) the package. |
14 | | -2. Run `php composer.phar install` to download the dependencies |
15 | | -3. Run `php src/Phpbb/TranslationValidator/PhpbbTranslationValidator.php` to get information how to run the validator |
| 13 | + git clone https://github.com/phpbb/phpbb-translation-validator.git |
| 14 | + composer.phar install |
16 | 15 |
|
17 | | -## Installation for validating a language package on TravisCI |
| 16 | +For the easiest results, create a directory called `3.2` in the root of the Translation Validator. Upload the `en` language page into this directory, along with the languages you wish to test. Which leads e.g. to: |
18 | 17 |
|
19 | | -1. Add the TranslationValidator as a dependecy: |
| 18 | + phpbb-translation-validator/3.2/en/ |
| 19 | + phpbb-translation-validator/3.2/fr/ |
| 20 | + phpbb-translation-validator/translation.php |
| 21 | + |
| 22 | +The simplest way to validate is to then run this command (the final argument is the language you wish to test and that has already been uploaded to the `3.2` directory; eg. `fr` for French): |
| 23 | + |
| 24 | + php translation.php validate fr |
| 25 | + |
| 26 | +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 - you would run this command: |
| 27 | + |
| 28 | + php translation.php validate fr |
| 29 | + --package-dir=/path/to/your/3.2 |
| 30 | + --phpbb-version=3.2 |
| 31 | + --safe-mode |
| 32 | + --display-notices |
| 33 | + |
| 34 | +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. |
| 35 | + |
| 36 | +## Tests |
| 37 | + |
| 38 | +[](https://travis-ci.org/phpbb/phpbb-translation-validator) |
| 39 | + |
| 40 | +Add the TranslationValidator as a dependency: |
20 | 41 |
|
21 | 42 | { |
22 | 43 | "require-dev": { |
23 | | - "phpbb/translation-validator": "1.4.*" |
| 44 | + "phpbb/translation-validator": "1.5.*" |
24 | 45 | } |
25 | 46 | } |
26 | 47 |
|
27 | | -2. Add the `php vendor/bin/PhpbbTranslationValidator.php` call you run locally to your `.travis.yml` |
| 48 | +Then add the `php translation.php` call you run locally to your `.travis.yml` file. |
28 | 49 |
|
29 | | -## Tests and Continuous Intergration |
| 50 | +We use Travis-CI as a continous intergtation server and phpunit for our unit testing. See more information on the [phpBB development wiki](https://wiki.phpbb.com/Unit_Tests). |
30 | 51 |
|
31 | | -[](https://travis-ci.org/phpbb/phpbb-translation-validator) |
| 52 | +To run the unit tests locally, use this command: |
32 | 53 |
|
33 | | -We use Travis-CI as a continous intergtation server and phpunit for our unit testing. See more information on the [phpBB development wiki](https://wiki.phpbb.com/Unit_Tests). |
| 54 | + php vendor/phpunit/phpunit/phpunit tests/ |
34 | 55 |
|
35 | 56 | ## License |
36 | 57 |
|
|
0 commit comments