-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* l10n support en+fr * l10n support en+fr * added few translations thanks @SzyZuu for German and Polish translations * l10n'd AboutPanel * added l10n check * added AboutPanel translation for French * added about translation & logo image update * fix language key --------- Co-authored-by: serifpersia <ramiserifpersia@gmail.com>
- Loading branch information
1 parent
d2bc317
commit 76d1dde
Showing
20 changed files
with
275 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
|
||
|
||
|
||
if( !isset($argv) || count($argv)<=1 ) { | ||
phpDie("Usage: php ".__FILE__." /path/to/resources/l10n"); | ||
exit(1); | ||
} | ||
|
||
$resourceDir = $argv[1]; | ||
|
||
if( !is_dir($resourceDir) ) { | ||
phpDie( $resourceDir." is not a dir" ); | ||
} | ||
|
||
if( !file_exists( $resourceDir."/labels.properties")) { | ||
phpDie( $resourceDir." is missing default labels.properties file" ); | ||
} | ||
|
||
$defaultLang = parse_ini_file($resourceDir."/labels.properties", false, INI_SCANNER_RAW); | ||
|
||
//print_r($defaultLang); | ||
|
||
if( empty($defaultLang)) { | ||
phpDie( "labels.properties is invalid or empty" ); | ||
} | ||
|
||
$langFiles = glob($resourceDir."/labels_*"); | ||
|
||
$errors = 0; | ||
|
||
foreach( $langFiles as $langfile ) { | ||
$checkLang = parse_ini_file($langfile, false, INI_SCANNER_RAW); | ||
if( empty($checkLang)) { | ||
echo $langfile." is invalid or empty".PHP_EOL; | ||
$errors++; | ||
|
||
} | ||
foreach( $defaultLang as $l10nKey => $l10nval ) { | ||
if( !isset($checkLang[$l10nKey]) || empty($checkLang[$l10nKey]) ) { | ||
echo basename($langfile)." is missing translation for key ".$l10nKey.PHP_EOL; | ||
$errors++; | ||
} | ||
} | ||
} | ||
|
||
if( $errors > 0 ) { | ||
phpDie("l10n check failed with ".$errors." errors"); | ||
} | ||
|
||
|
||
function phpDie($msg) { | ||
echo $msg.PHP_EOL; | ||
exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.