[pLog-svn] r4895 - plog/branches/lifetype-1.2/tools
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Mar 1 04:45:20 EST 2007
Author: oscar
Date: 2007-03-01 04:45:19 -0500 (Thu, 01 Mar 2007)
New Revision: 4895
Added:
plog/branches/lifetype-1.2/tools/comparelocale.php
Log:
Added a little script to compare two locales, to make sure that they've both got the same trings. Usage:
php comparelocale.php locale_en_UK.php locale_es_ES.php
This would return the keys that are in locale_en_UK.php that are not available in locale_es_ES.php.
The script must be run from the command line, btw.
Added: plog/branches/lifetype-1.2/tools/comparelocale.php
===================================================================
--- plog/branches/lifetype-1.2/tools/comparelocale.php (rev 0)
+++ plog/branches/lifetype-1.2/tools/comparelocale.php 2007-03-01 09:45:19 UTC (rev 4895)
@@ -0,0 +1,25 @@
+<?php
+
+if( count( $argv ) == 1 ) {
+ print("You must provide parameters: comparelocale.php sourcelocale destlocale\n" );
+ die();
+}
+
+// load the source locale
+include( $argv[1] );
+$srcLocale = $messages;
+$srcLocaleKeys = array_keys( $srcLocale );
+
+// load the dest locale
+unset( $messages );
+include( $argv[2] );
+$destLocale = $messages;
+
+
+// process the keys and see which ones are missing in the destination locale
+foreach( $srcLocaleKeys as $key ) {
+ if( !isset( $destLocale["$key"] ))
+ print( "$key is missing from $destLocale!\n" );
+
+}
+?>
\ No newline at end of file
More information about the pLog-svn
mailing list