Skip to content

Commit

Permalink
Merge pull request #58 from phpbb/develop
Browse files Browse the repository at this point in the history
v1.5.0 Release
  • Loading branch information
Crizz0 authored Apr 16, 2019
2 parents dc7bf18 + e3e8bcf commit 8b63f9e
Show file tree
Hide file tree
Showing 159 changed files with 789 additions and 492 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/bin/
/3.0/
/3.1/
/3.2/
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ php:
- 7.1

install:
- php composer.phar install --dev --no-interaction --prefer-source
- composer install --dev --no-interaction --prefer-source

script:
- bin/phpunit
- vendor/phpunit/phpunit/phpunit

matrix:
allow_failures:
Expand Down
53 changes: 37 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
# phpBB Translation Validator Extension
# phpBB Translation Validator

Allows to validate **phpBB** language packages.
This console application allows you to validate [phpBB](https://www.phpbb.com) language packages.

## Requirement
## Requirements

This extension requires PHP 5.6 to 7.1 to be set up.
This extension requires PHP 5.5.9 or above.

## Installation for validating a language package locally
### Installation

*Note:* the validator only works when you have the source language pack in your directory (default source language is `en`).
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:

1. [Download](https://github.com/nickvergessen/phpbb-translation-validator/archive/master.zip) the package.
2. Run `php composer.phar install` to download the dependencies
3. Run `php src/Phpbb/TranslationValidator/PhpbbTranslationValidator.php` to get information how to run the validator
git clone https://github.com/phpbb/phpbb-translation-validator.git
composer.phar install

## Installation for validating a language package on TravisCI
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:

1. Add the TranslationValidator as a dependecy:
phpbb-translation-validator/3.2/en/
phpbb-translation-validator/3.2/fr/
phpbb-translation-validator/translation.php

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):

php translation.php validate fr

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:

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

[![Build Status](https://travis-ci.org/phpbb/phpbb-translation-validator.png?branch=master)](https://travis-ci.org/phpbb/phpbb-translation-validator)

Add the TranslationValidator as a dependency:

{
"require-dev": {
"phpbb/translation-validator": "1.4.*"
"phpbb/translation-validator": "1.5.*"
}
}

2. Add the `php vendor/bin/PhpbbTranslationValidator.php` call you run locally to your `.travis.yml`
Then add the `php translation.php` call you run locally to your `.travis.yml` file.

## Tests and Continuous Intergration
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).

[![Build Status](https://travis-ci.org/phpbb/phpbb-translation-validator.png?branch=master)](https://travis-ci.org/phpbb/phpbb-translation-validator)
To run the unit tests locally, use this command:

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).
php vendor/phpunit/phpunit/phpunit tests/

## License

Expand Down
28 changes: 15 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@
"name": "phpbb/translation-validator",
"description": "A language package validator for phpBB language packs. Language packs are required to pass the validator when submitted to the language pack database.",
"homepage": "https://github.com/phpbb/phpbb-translation-validator",
"version": "1.4.1",
"license": "GPL-2.0",
"version": "1.5.0",
"license": "GPL-2.0-only",
"authors": [
{
"name": "Joas Schilling",
"email": "[email protected]",
"homepage": "http://www.phpbb.com/",
"role": "Developer"
},
{
"name": "Battye",
"email": "[email protected]",
"homepage": "https://www.phpbb.com",
"role": "Developer"
}
],
"minimum-stability": "stable",
"require": {
"php": ">=5.6",
"symfony/yaml": "2.6.*",
"symfony/console": "2.6.*",
"symfony/finder": "2.6.*"
"php": ">=5.5.9",
"symfony/yaml": "~3.0",
"symfony/console": "~3.0",
"symfony/finder": "~3.0",
"battye/php-array-parser": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~5.7"
},
"bin": [
"src/Phpbb/TranslationValidator/PhpbbTranslationValidator.php"
],
"config": {
"bin-dir": "bin"
},
"autoload": {
"classmap": [
"src/"
"src/",
"tests/"
]
}
}
Loading

0 comments on commit 8b63f9e

Please sign in to comment.