Skip to content

Commit

Permalink
Remove language menu if less than two langugaes.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilFraser committed Nov 6, 2014
1 parent a6a31c7 commit 4943c53
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 38 deletions.
38 changes: 3 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ JS_READ_ONLY = appengine/js-read-only
SOY_COMPILER = java -jar closure-templates-read-only/build/SoyToJsSrcCompiler.jar --shouldProvideRequireSoyNamespaces
SOY_EXTRACTOR = java -jar closure-templates-read-only/build/SoyMsgExtractor.jar

ZIPDIR = $(TMPDIR)/blockly-games
BLOCKY_DIR = $(PWD)

##############################
# Rules
##############################

all: deps languages zip
all: deps languages

index-en:
mkdir -p appengine/generated/en/
Expand Down Expand Up @@ -108,39 +108,7 @@ deps:
svn checkout https://github.com/google/blockly/trunk/generators $(JS_READ_ONLY)/blockly/generators
svn checkout https://github.com/google/blockly/trunk/msg/js $(JS_READ_ONLY)/blockly/msg-js

zip: clean-zip
mkdir $(ZIPDIR)
cp -r appengine/* $(ZIPDIR)/
rm -rf $(ZIPDIR)/*.yaml
rm -rf $(ZIPDIR)/.[a-zA-Z]*
rm -rf $(ZIPDIR)/*/.[a-zA-Z]*
rm -rf $(ZIPDIR)/*/*/.[a-zA-Z]*
rm -rf $(ZIPDIR)/*/*/*/.[a-zA-Z]*
rm -rf $(ZIPDIR)/*/*/*/*/.[a-zA-Z]*
rm -rf $(ZIPDIR)/*/sources/
rm -rf $(ZIPDIR)/js/
rm -rf $(ZIPDIR)/*/js/
rm -rf $(ZIPDIR)/*/*/js/
rm -rf $(ZIPDIR)/js-read-only/blockly/
rm -rf $(ZIPDIR)/js-read-only/goog/
rm -rf $(ZIPDIR)/js-read-only/third_party_goog/
rm -rf $(ZIPDIR)/js-read-only/JS-Interpreter/[!c]*
rm -f $(ZIPDIR)/*.soy
rm -f $(ZIPDIR)/*/*.soy
rm -f $(ZIPDIR)/*/*/*.soy
rm -f $(ZIPDIR)/generated/*/uncompressed.js
rm -f $(ZIPDIR)/*/generated/*/uncompressed.js
rm -f $(ZIPDIR)/*/*/generated/*/uncompressed.js
mkdir -p appengine/generated/
echo "<html><head><meta http-equiv=refresh content='0; url=blockly-games/index.html' /></head></html>" > $(ZIPDIR)/../index.html
zip -rmq9 blockly-games.zip $(ZIPDIR)/ $(ZIPDIR)/../index.html

clean: clean-zip clean-languages clean-deps

clean-zip:
rm -rf $(ZIPDIR)/
rm -f $(ZIPDIR)/../index.html
rm -f blockly-games.zip
clean: clean-languages clean-deps

clean-languages:
rm -rf appengine/$(ALL_JSON)/generated
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](https://blockly-games.appspot.com/index/title.png)
![Blockly Games](https://raw.githubusercontent.com/wiki/google/blockly-games/title.png)

Google's Blockly Games is a series of educational games that teach programming.
It is based on the [Blockly](https://developers.google.com/blockly/) library.
Expand Down
6 changes: 5 additions & 1 deletion appengine/js/lib-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ BlocklyGames.LANGUAGE_NAME = {
'pms': 'Piemontèis',
'ps': 'پښتو',
'pt': 'Português',
'ro': 'Română',
'pt-br': 'Português Brasileiro',
'ro': 'Română',
'ru': 'Русский',
'sc': 'Sardu',
'sco': 'Scots',
Expand Down Expand Up @@ -219,6 +219,10 @@ BlocklyGames.init = function() {
}
languageMenu.options.add(option);
}
if (languageMenu.options.length <= 1) {
// No choices. Hide the language menu.
languageMenu.style.display = 'none';
}

// Highlight levels that have been completed.
for (var i = 1; i <= BlocklyGames.MAX_LEVEL; i++) {
Expand Down
Binary file removed blockly-games.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion json/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@metadata": {
"author": "Neil Fraser <fraser@google.com>",
"lastupdated": "2014-11-03 22:07:28.187031",
"lastupdated": "2014-11-05 23:44:57.445500",
"locale": "en",
"messagedocumentation" : "qqq"
},
Expand Down

0 comments on commit 4943c53

Please sign in to comment.