Merge pull request #84 from lilj/master

hope more translation will coming soon!
This commit is contained in:
Michael Townsend
2014-05-30 10:24:03 -04:00
5 changed files with 25 additions and 13 deletions
+3
View File
@@ -6,3 +6,6 @@ A Minimalist Text Adventure Game
[Chinese translation](https://github.com/Tedko/CHN-Ver-of-ADarkRoom)
[Click to play](http://adarkroom.doublespeakgames.com/)
[Another Chinese Dark Room](http://dreamz.cn/a-dark-room/index.html?lang=cn)
+3 -1
View File
@@ -28,6 +28,8 @@
<script src="lib/base64.js"></script>
<script src="lib/translate.js"></script>
<script src="lang/langs.js"></script>
<script>
// try to read "lang" param's from url
var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
@@ -105,4 +107,4 @@
</div>
</div>
</body>
</html>
</html>
+4
View File
@@ -0,0 +1,4 @@
var langs = {
'en':'english',
'fr':'français'
}
+12 -9
View File
@@ -115,13 +115,16 @@
var selectWrap = $('<span>')
.addClass('select-wrap')
.appendTo(menu);
$('<select>')
var select = $('<select>')
.addClass('menuBtn')
.append($('<option>').text("language."))
.append($('<option>').text("english").val("en"))
.append($('<option>').text("français").val("fr"))
.change(Engine.switchLanguage)
.appendTo(selectWrap);
$.each(langs, function(name,display){
$('<option>').text(display).val(name).appendTo(select)
});
$('<span>')
.addClass('lightsOff menuBtn')
@@ -229,7 +232,7 @@
},
exportImport: function() {
Events.startEvent({
Events.startEvent({
title: 'Export / Import',
scenes: {
start: {
@@ -277,7 +280,7 @@
},
'cancel': {
text: _('cancel'),
nextScene: 'end'
nextScene: 'end'
}
}
}
@@ -299,17 +302,17 @@
text: [_('save this.')],
textarea: string64,
buttons: {
'done': {
'done': {
text: _('got it'),
nextScene: 'end',
onChoose: Engine.disableSelection
onChoose: Engine.disableSelection
}
}
}
}
});
},
import64: function(string64) {
Engine.disableSelection();
string64 = string64.replace(/\s/g, '');
@@ -317,7 +320,7 @@
string64 = string64.replace(/\n/g, '');
var decodedSave = Base64.decode(string64);
localStorage.gameState = decodedSave;
location.reload();
location.reload();
},
event: function(cat, act) {
+3 -3
View File
@@ -2,12 +2,12 @@
//only used for poedit to find translatable strings
var keywords = [ _('saved.'), _('wood'),_('builder'),_('teeth'),_('meat'),_('fur'), _('alien alloy'), _('bullets'),
_('charm'),_('leather'),_('iron'), _('steel'), _('coal'), _('enegy cell'),
_('torch'),_('medicine'),_('hunter'),_('trapper'),_('tanner'),
_('torch'),_('medicine'),_('hunter'),_('trapper'),_('tanner'), _('grenade'), _('bolas'),
_("charcutier"),_('iron miner'),_('coal miner'), _('sulphur miner'), _('armourer'),
_('steelworker'),_('bait'),_('cured meat'), _('scales'), _('compass'), _('laser rifle'),
_('gatherer'),_('cloth'), _('scales'), _('cured meat'), _('thieves'),
_('not enough fur'), _('not enough wood'), _('not enough coal'), _('not enough iron'), _('not enough steel'), _('baited trap'),
_('not enough scales'), _('not enough teeth'), _('not enough leather'),
_('not enough scales'),_('not enough clouth'), _('not enough teeth'), _('not enough leather'),
_('the compass points east.'), _('the compass points west.'), _('the compass points north.'), _('the compass points south.'),
_('the compass points northeast.'), _('the compass points northwest.'), _('the compass points southeast.'), _('the compass points southwest.')];
delete keywords;
@@ -24,4 +24,4 @@
div#lootButtons:before { content: \''+ _("take:") + '\'}\
div#village:before{ content: \''+_('forest')+'\'}\
').appendTo($('head'));
})();
})();