--- /dev/null
+<?php\r
+// THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files\r
+\r
+// DEFINE YOUR ICU TOOLS PATH HERE\r
+define("ICU_DIR", "C:/PROJECTS/ICU40/BIN/");\r
+\r
+$here = dirname(__FILE__);\r
+\r
+$dir = new GlobIterator("$here/_files/*.txt", FilesystemIterator::KEY_AS_FILENAME);\r
+\r
+foreach($dir as $file) {\r
+ passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle ".$file->getFileName());\r
+}\r
+\r
+$dir = new GlobIterator("$here/_files/resourcebundle/*.res", FilesystemIterator::KEY_AS_FILENAME);\r
+foreach($dir as $file) {\r
+ if($file->getFileName() == "res_index.res") continue;\r
+ $list[] = str_replace(".res", "", $file->getFileName());\r
+}\r
+\r
+$filelist = join(" {\"\"}\n", $list);\r
+$res_index = <<<END\r
+res_index:table(nofallback) {\r
+ InstalledLocales {\r
+$filelist {""}\r
+ }\r
+}\r
+END;\r
+file_put_contents("$here/_files/res_index.txt", $res_index);\r
+\r
+passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle res_index.txt");\r
+\r
+// passthru(ICU_DIR."icupkg -tl -a $here/rb.txt -s $here/_files -d $here/_files new $here/_files/resourcebundle.dat");
\ No newline at end of file