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) [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)
+2
View File
@@ -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;
+4
View File
@@ -0,0 +1,4 @@
var langs = {
'en':'english',
'fr':'français'
}
+6 -3
View File
@@ -115,14 +115,17 @@
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')
.text(_('lights off.')) .text(_('lights off.'))
+2 -2
View File
@@ -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;