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