Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Apply localization to player-visible text.
Browse files Browse the repository at this point in the history
Closes #4.
  • Loading branch information
narc0tiq committed Jul 23, 2015
1 parent efa9406 commit 61eeb82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 7 additions & 9 deletions evoGUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ end
evogui.create_or_update = create_or_update

local function update_evolution(evoGUI)
evoGUI.evolution_factor.caption = string.format("Biter evolution: %0.1f%%", game.evolution_factor * 100)
evoGUI.evolution_factor.caption = {"biter-evolution", string.format("%0.1f%%", game.evolution_factor * 100)}
end
evogui.update_evolution = update_evolution

Expand All @@ -46,10 +46,10 @@ local function update_run_time(evoGUI)
local run_time_minutes = math.floor(run_time_seconds/60)
local run_time_hours = math.floor(run_time_minutes/60)

evoGUI.run_time.caption = string.format("Play time: %d:%02d:%02d",
run_time_hours,
run_time_minutes % 60,
run_time_seconds % 60)
evoGUI.run_time.caption = {"play-time", string.format("%d:%02d:%02d",
run_time_hours,
run_time_minutes % 60,
run_time_seconds % 60)}
end
evogui.update_run_time = update_run_time

Expand All @@ -64,9 +64,7 @@ local function update_day_time(evoGUI)

local brightness = math.floor((1 - game.darkness) * 100)

evoGUI.day_time.caption = string.format("The time is: %d:%02d. Brightness: %d%%",
day_time_hours,
rounded_minutes % 60,
brightness)
evoGUI.day_time.caption = {"", {"time-of-day", string.format("%d:%02d", day_time_hours, rounded_minutes % 60)}, " ",
{"brightness", string.format("%d%%", brightness)}}
end
evogui.update_day_time = update_day_time
5 changes: 5 additions & 0 deletions script-locale/en.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
biter-evolution=Biter evolution: __1__.
play-time=Play time: __1__.
time-of-day=It's __1__.
brightness=Brightness: __1__.

0 comments on commit 61eeb82

Please sign in to comment.