Răsfoiți Sursa

Move translation tools into the cli folder (#1673)

Translation tools must be used on cli. It is better to have them in the cli folder.
Alexis Degrugillier 8 ani în urmă
părinte
comite
05b1901fcd

+ 1 - 1
.travis.yml

@@ -20,7 +20,7 @@ script:
     fi
   - |
     if [[ $CHECK_TRANSLATION == yes ]]; then
-      php tools/check.translation.php -r
+      php cli/check.translation.php -r
     fi
 
 env:

+ 6 - 6
tools/check.translation.php → cli/check.translation.php

@@ -1,8 +1,8 @@
 <?php
 
-require_once __DIR__ . '/I18nFile.php';
-require_once __DIR__ . '/I18nCompletionValidator.php';
-require_once __DIR__ . '/I18nUsageValidator.php';
+require_once __DIR__ . '/i18n/I18nFile.php';
+require_once __DIR__ . '/i18n/I18nCompletionValidator.php';
+require_once __DIR__ . '/i18n/I18nUsageValidator.php';
 
 $i18nFile = new I18nFile();
 $i18nData = $i18nFile->load();
@@ -27,11 +27,11 @@ $report = array();
 foreach ($languages as $language) {
 	if ($language === $i18nData::REFERENCE_LANGUAGE) {
 		$i18nValidator = new I18nUsageValidator($i18nData->getReferenceLanguage(), findUsedTranslations());
-		$isValidated = $i18nValidator->validate(include __DIR__ . '/ignore/' . $language . '.php') && $isValidated;
+		$isValidated = $i18nValidator->validate(include __DIR__ . '/i18n/ignore/' . $language . '.php') && $isValidated;
 	} else {
 		$i18nValidator = new I18nCompletionValidator($i18nData->getReferenceLanguage(), $i18nData->getLanguage($language));
-		if (file_exists(__DIR__ . '/ignore/' . $language . '.php')) {
-			$isValidated = $i18nValidator->validate(include __DIR__ . '/ignore/' . $language . '.php') && $isValidated;
+		if (file_exists(__DIR__ . '/i18n/ignore/' . $language . '.php')) {
+			$isValidated = $i18nValidator->validate(include __DIR__ . '/i18n/ignore/' . $language . '.php') && $isValidated;
 		} else {
 			$isValidated = $i18nValidator->validate(null) && $isValidated;
 		}

+ 0 - 0
tools/I18nCompletionValidator.php → cli/i18n/I18nCompletionValidator.php


+ 0 - 0
tools/I18nData.php → cli/i18n/I18nData.php


+ 1 - 1
tools/I18nFile.php → cli/i18n/I18nFile.php

@@ -7,7 +7,7 @@ class i18nFile {
 	private $i18nPath;
 
 	public function __construct() {
-		$this->i18nPath = __DIR__ . '/../app/i18n';
+		$this->i18nPath = __DIR__ . '/../../app/i18n';
 	}
 
 	public function load() {

+ 0 - 0
tools/I18nUsageValidator.php → cli/i18n/I18nUsageValidator.php


+ 0 - 0
tools/I18nValidatorInterface.php → cli/i18n/I18nValidatorInterface.php


+ 0 - 0
tools/ignore/en.php → cli/i18n/ignore/en.php


+ 0 - 0
tools/ignore/fr.php → cli/i18n/ignore/fr.php


+ 1 - 1
tools/manipulate.translation.php → cli/manipulate.translation.php

@@ -10,7 +10,7 @@ if (1 === $argc || 4 < $argc) {
 	help();
 }
 
-require_once __DIR__ . '/I18nFile.php';
+require_once __DIR__ . '/i18n/I18nFile.php';
 
 $i18nFile = new I18nFile();
 $i18nData = $i18nFile->load();