diff options
-rw-r--r-- | unrpyc/Makefile | 14 | ||||
-rw-r--r-- | www/index.html | 2 | ||||
-rw-r--r-- | www/js/html5ks.js | 2 | ||||
-rw-r--r-- | www/js/i18n.js | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/unrpyc/Makefile b/unrpyc/Makefile index a92a91d..4fb222d 100644 --- a/unrpyc/Makefile +++ b/unrpyc/Makefile @@ -1,6 +1,8 @@ GZIP := $(shell ./find-gzip.sh) -all: script.json script.json.gz imachine.json imachine.json.gz imachine_replay.json imachine_replay.json.gz ui-strings.json ui-strings.json.gz +TARGETS := script.json script.json.gz imachine.json imachine.json.gz imachine_replay.json imachine_replay.json.gz ui-strings.json ui-strings.json.gz ui-strings_FR.json ui-strings_FR.json.gz + +all: $(TARGETS) %.json.gz: %.json $(GZIP) -c $< > $@ @@ -13,9 +15,9 @@ script.json: $(patsubst %.rpyc,%.json,$(wildcard script-*.rpyc)) %.json: %.json.o node fix.js $< $@ -ui-strings.json.o: ui-strings.rpyc *.py +ui-strings.json.o ui-strings_FR.json.o: ui-strings%.json.o: ui-strings%.rpyc *.py python unrpyc.py --clobber $< $@ - sed -i -e 's/ \["init_language", "en", \],//;s/^\]}$$/}/' $@ + sed -i -e 's/ \["init_language", "[a-z]*", \],//;s/^\]}$$/}/' $@ %.json.o: %.rpyc *.py python unrpyc.py --clobber $< $@ @@ -25,16 +27,16 @@ script-%.json: script-%.json.o sed -i -e 's/^{//;s/}$$/,/' $@ clean: - rm -f *.json* + $(RM) *.json* test: all jshint --show-non-errors *.json install: all [ -d ../www/json ] || mkdir ../www/json - install -t ../www/json script.json script.json.gz imachine.json imachine.json.gz imachine_replay.json imachine_replay.json.gz ui-strings.json ui-strings.json.gz + install $(TARGETS) ../www/json uninstall: - rm -f ../www/json/* + $(RM) ../www/json/* .PHONY: all clean test install diff --git a/www/index.html b/www/index.html index f2f9dec..a623f50 100644 --- a/www/index.html +++ b/www/index.html @@ -89,7 +89,7 @@ </div> <div id="return" class="button" style="position: absolute; bottom: 15px; right: 20px;"> <img src="dump/ui/bt-return.png"> - Return + <span class="return_button_text"></span> </div> </div> <div id="context" style="display: none;"> diff --git a/www/js/html5ks.js b/www/js/html5ks.js index 82cdfa3..59bd940 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -188,7 +188,7 @@ window.html5ks = { xhr.open("GET", "json/" + name + ".json"); xhr.onload = function () { html5ks.data[name] = JSON.parse(xhr.responseText); - deferred.resolve(); + deferred.resolve(html5ks.data[name]); }; xhr.send(); } diff --git a/www/js/i18n.js b/www/js/i18n.js index 427d9b3..1d8f046 100644 --- a/www/js/i18n.js +++ b/www/js/i18n.js @@ -1,8 +1,8 @@ "use strict"; html5ks.i18n = { init: function () { - html5ks.fetch("json", "ui-strings").then(function () { - var uiStrings = html5ks.data["ui-strings"]; + html5ks.fetch("json", html5ks.persistent.language === "en" ? + "ui-strings" : "ui-strings_FR").then(function (uiStrings) { for (var k in uiStrings) { var e = document.getElementsByClassName(k); for (var i = e.length - 1; i >= 0; i--) { |