Skip to content

Commit

Permalink
Integrate localization.
Browse files Browse the repository at this point in the history
  • Loading branch information
victords committed Mar 29, 2022
1 parent c70492c commit 880c47c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source 'https://rubygems.org'

ruby '~> 3.0'

gem 'minigl', '~> 2.3.9'
gem 'minigl', '~> 2.4.0'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ GEM
remote: https://rubygems.org/
specs:
gosu (1.4.1)
minigl (2.3.9)
minigl (2.4.0)
gosu (>= 0.11, < 2.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
minigl (~> 2.3.9)
minigl (~> 2.4.0)

RUBY VERSION
ruby 3.0.1p64
Expand Down
5 changes: 5 additions & 0 deletions data/text/english.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
play Play
instructions Instructions
options Options
high_scores High Scores
exit Exit
5 changes: 5 additions & 0 deletions data/text/portuguese.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
play Jogar
instructions Instruções
options Opções
high_scores Recordes
exit Sair
1 change: 1 addition & 0 deletions src/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class << self
attr_reader :font

def initialize
Localization.initialize
@music_volume = 10
@sound_volume = 10
@font = Res.font(:arialRounded, 24)
Expand Down
10 changes: 5 additions & 5 deletions src/menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def initialize

@buttons = {
main: [
Button.new(305, 240, 'Play'),
Button.new(305, 290, 'Instructions'),
Button.new(305, 340, 'Options'),
Button.new(305, 390, 'High Scores'),
Button.new(305, 480, 'Exit') do
Button.new(305, 240, Localization.text(:play)),
Button.new(305, 290, Localization.text(:instructions)),
Button.new(305, 340, Localization.text(:options)),
Button.new(305, 390, Localization.text(:high_scores)),
Button.new(305, 480, Localization.text(:exit)) do
exit
end,
]
Expand Down

0 comments on commit 880c47c

Please sign in to comment.