summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-10-23 10:54:24 +0800
committerPeng Wu <alexepico@gmail.com>2018-10-23 10:54:24 +0800
commita2733d3e357fdfeae8866270a05700613fd25118 (patch)
tree2d2db4e8c692755dca5fb343370fb1e84d72a1d3
parent4d768fd5f8cb47eca8ad03f45bde9b4acba7da4c (diff)
downloadibus-libzhuyin-a2733d3e357fdfeae8866270a05700613fd25118.zip
ibus-libzhuyin-a2733d3e357fdfeae8866270a05700613fd25118.tar.gz
ibus-libzhuyin-a2733d3e357fdfeae8866270a05700613fd25118.tar.xz
import php_2_py.php
-rw-r--r--scripts/php_2_py.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/php_2_py.php b/scripts/php_2_py.php
new file mode 100644
index 0000000..aa3316e
--- /dev/null
+++ b/scripts/php_2_py.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace MediaWiki\Languages\Data;
+
+include("ZhConversion.php");
+
+echo "# -*- coding: utf-8 -*- \n";
+
+function printDict($name, $dict) {
+ echo "$name = {\n";
+ foreach($dict as $key => $val) {
+ echo " u\"", $key, "\": u\"", $val, "\",\n";
+ }
+ echo "}\n";
+ echo "\n";
+}
+
+printDict("zh2Hant", ZhConversion::$zh2Hant);
+printDict("zh2Hans", ZhConversion::$zh2Hans);
+printDict("zh2TW", ZhConversion::$zh2TW);
+printDict("zh2HK", ZhConversion::$zh2HK);
+printDict("zh2CN", ZhConversion::$zh2CN);
+# printDict("zh2SG", ZhConversion::$zh2SG);
+?>