Done and "implemented" locales

Language for now is called 1 time and hardcoded.
Solved error on todo and made a coment on every lenguage.
This commit is contained in:
bizcochito 2022-01-31 11:03:58 +01:00
parent ed253ddb92
commit 1759196f26
6 changed files with 18 additions and 11 deletions

View File

@ -8,5 +8,3 @@ Locale.ui.pause_screen_exit = "Exit"
Locale.entity = {}
Locale.entity.fairy = {}
Locale.entity.fairy.name = "Ozy"
return Locale

View File

@ -22,3 +22,6 @@ require "data/scripts/ui"
require "data/scripts/game"
require "data/scripts/gameworld"
require "data/scripts/editor"
-- locale
require "data/scripts/locale"

4
data/scripts/locale.lua Normal file
View File

@ -0,0 +1,4 @@
function LocaleLoad(ISO639)
local ISO639 = ISO639 or "ENG"
dofile("Mothback/data/locale/"..ISO639..".lua")
end

View File

@ -67,7 +67,7 @@ function MenuInit(menu)
{false,true},
1,
{
text = "Resume",
text = Locale.ui.pause_screen_resume,
color = {0,0,0.5},
color2 = {1,1,1}
}
@ -80,7 +80,7 @@ function MenuInit(menu)
{false,true},
1,
{
text = "Options",
text = Locale.ui.pause_screen_options,
color = {0,0,0.5},
color2 = {1,1,1}
}
@ -93,7 +93,7 @@ function MenuInit(menu)
{false,true},
1,
{
text = "Exit",
text = Locale.ui.pause_screen_exit,
color = {0,0,0.5},
color2 = {1,1,1}
}
@ -101,4 +101,5 @@ function MenuInit(menu)
end
end
UIElement = {}
require "data/scripts/ui/button"

View File

@ -13,8 +13,6 @@ function love.load()
fps_draw = 0
fps_total = 0
UIElement = {}
love.graphics.setColor(1,1,1)
love.keyboard.setKeyRepeat(true)
love.graphics.setDefaultFilter("nearest") -- good pixel
@ -44,6 +42,9 @@ function love.load()
LoadedParticles = {}
LevelLoadTiles()
language = "ENG"
LocaleLoad(lenguage)
main_Player = Player:New(75,50)
--Kupo:New(100,150)

View File

@ -52,7 +52,7 @@
( ) Characters
( ) Level design
( ) Translations
( ) ESP
( ) ENG
( ) CAT
( ) HEN
( ) SPA "es_ES"
( ) ENG "en_UK"
( ) CAT "ca_ES"
( ) HEN "Myrheonian"