diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index ce28ca5de63..f2263b1d18b 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -250,11 +250,11 @@ foreach($filesToProcess as $fileToProcess) { if ( ! $oh = fopen($output, 'w') ) { - print "ERROR in writing to file $output\n"; + print "ERROR in writing to file ".$output."\n"; exit; } - print "Read Primary File $lPrimaryFile and write ".$output.":\n"; + print "Read Primary File ".$lPrimaryFile." and write ".$output.":\n"; fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n"); diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index f4a14373ebe..7802bc57659 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -181,6 +181,20 @@ class LangTest extends PHPUnit\Framework\TestCase $this->assertRegExp('/^[dMy\/\-\.]+$/', $result, 'FormatDateShortJavaInput KO for lang code '.$code); unset($tmplangs); + + $filesarray2 = scandir(DOL_DOCUMENT_ROOT.'/langs/'.$code); + foreach($filesarray2 as $key => $file) { + if (! preg_match('/\.lang$/', $file)) { + continue; + } + + print 'Check lang file '.$file."\n"; + $filecontent=file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file); + + $result=strpos($filecontent, '%'); + print __METHOD__." Result for checking we don't have bad percent char = ".$result."\n"; + $this->assertTrue($result===false, 'Found a bad percent char % instead of % into file '.$code.'/'.$file); + } } return;