Skip to content

Commit

Permalink
Localization diff comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagolove committed Jun 6, 2021
1 parent 0c01ffd commit f7a1921
Show file tree
Hide file tree
Showing 8 changed files with 1,552 additions and 65 deletions.
22 changes: 11 additions & 11 deletions locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@
many = "Wait for %d seconds",
},

levelInfo1 = "Уровень %d Экспозиция %d секунд",
levelInfo2 = "Продолжительность %d минут %d секунд",
settingsBtn = "Settings",
--backToMainMenu = "Back to menu",
backToMainMenu = "Main menu",
--quitBtn = "Back to main", -- лучше назвать - "в главное меню?"
quitBtn = "Main menu", -- лучше назвать - "в главное меню?"
backToMainMenu = "Back to menu",
quitBtn = "Back to main", -- лучше назвать - "в главное меню?"

nodata = "No fineshed games yet. Try to play.",
today = "today",
yesterday = "yesterday",
twoDays = "two days ago",
threeDays = "three days ago",
fourDays = "four days ago",
twoDays = "two days ago",
threeDays = "three days ago",
fourDays = "four days ago",
fiveDays = "five days ago",
sixDays = "six days ago",
lastWeek = "last week",
lastTwoWeek = "last two week",
lastMonth = "last month",
lastYear = "last year",
lastWeek = "last week",
lastTwoWeek = "last two week",
lastMonth = "last month",
lastYear = "last year",
moreTime = "more year ago",

levelInfo1_part1 = {
Expand Down
24 changes: 12 additions & 12 deletions locales/ru.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language = "Русский",
ru = {
pos = "Положение", -- пространство
positon = "Положение",
position = "Положение",
sound = "Звук",
form = "Форма",
color = "Цвет",
Expand All @@ -18,6 +18,8 @@
start = "Начать",
expTime = "Время экспозиции ",
expTime_sec = " секунд",
diffLevel = "Уровень сложности: ",
dimLevel = "Размер поля:", -- разница между размерностью и размером поля.

expTime_plural = {
one = "Время экспозиции %{count} секунда",
Expand All @@ -26,9 +28,6 @@
many = "Время экспозиции %{count} секунд",
other = "Время экспозиции %{count} секунд",
},

diffLevel = "Уровень сложности: ",
dimLevel = "Размер поля:",
},

waitFor = {
Expand All @@ -43,20 +42,20 @@
backToMainMenu = "Вернуться в меню",
quitBtn = "Закончить",

nodata = "Пока нету законченных игр. Попробуйте сыграть.",
today = "сегодня",
yesterday = "вчера",
twoDays = "два дня назад",
threeDays = "три дня назад",
fourDays = "четыре дня назад",
twoDays = "два дня назад",
threeDays = "три дня назад",
fourDays = "четыре дня назад",
fiveDays = "пять дней назад",
sixDays = "шесть дней назад",
lastWeek = "на прошлой неделе",
lastTwoWeek = "две недели назад",
lastMonth = "в прошлом месяце",
lastYear = "в прошлом году",
lastWeek = "на прошлой неделе",
lastTwoWeek = "две недели назад",
lastMonth = "в прошлом месяце",
lastYear = "в прошлом году",
moreTime = "более года назад",

nodata = "Пока нету законченных игр. Попробуйте сыграть.",

levelInfo1_part1 = {
one = "Продолжительность %{count} минута",
Expand All @@ -70,6 +69,7 @@
many = "%{count} секунд",
other = "%{count} секунд",
},

levelInfo2_part1 = "Сложность %{count}",
levelInfo2_part2 = {
one = "Экспозиция %{count} секунда",
Expand Down
56 changes: 36 additions & 20 deletions nback.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local coroutine = _tl_compat and _tl_compat.coroutine or coroutine; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local math = _tl_compat and _tl_compat.math or math; local os = _tl_compat and _tl_compat.os or os; local pcall = _tl_compat and _tl_compat.pcall or pcall; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table

require("common")
require("layout")
require("snippets")
require("button")
require("drawstat")
require("coroprocessor")
require("Timer")
require("signal_quad_field")

require("nbtypes")
require("button")
require("cmn")
require("common")
require("coroprocessor")
require("drawstat")
require("layout")
require("menu")
require("nbtypes")
require("signal_quad_field")
require("snippets")
require("tiledbackground")


local i18n = require("i18n")

local colorConstants = require("colorconstants")
local g = love.graphics
local gr = love.graphics
local generator = require("generator")
local getTime = love.timer.getTime

local gr = love.graphics
local i18n = require("i18n")
local pallete = require("pallete")
local serpent = require("serpent")
local setupmenu = require("setupmenu")
Expand Down Expand Up @@ -114,11 +113,6 @@ local yield = coroutine.yield











Expand Down Expand Up @@ -280,7 +274,7 @@ function Nback:createSetupMenu()


local expositionList = { "1", "2", "3", "4", "5", "6" }
local activeExpositionItem = 3
local activeExpositionItem = 2

local parameterColor = { 0, 0.9, 0 }

Expand All @@ -305,9 +299,31 @@ function Nback:createSetupMenu()

self.setupmenu:addItem({
oninit = function()
local fullStr = i18n("setupMenu.expTime_plural", { count = tonumber(expositionList[activeExpositionItem]) })

local fullStr = i18n("setupMenu.expTime_plural", {
count = tonumber(expositionList[activeExpositionItem]),
})
print("------", tonumber(expositionList[activeExpositionItem]))
print("------", i18n("setupMenu.expTime_plural", { count = tonumber(expositionList[activeExpositionItem]) }))
print("------", i18n("setupMenu.expTime_plural_stub", {
count = tonumber(expositionList[activeExpositionItem]),
}))















print("fullStr = %s", fullStr)

local part1, _, part2 = string.match(fullStr, "(.+)(%d)(.+)")

return { pallete.signal, part1, parameterColor,
Expand Down
56 changes: 37 additions & 19 deletions nback.tl
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
-- vim: set foldmethod=indent

require "common"
require "layout"
require "snippets"
require "button"
require "drawstat"
require "coroprocessor"
require "Timer"
require "signal_quad_field"
--require "globals"
require "nbtypes"
require "button"
require "cmn"
require "common"
require "coroprocessor"
require "drawstat"
require "layout"
require "menu"
require "nbtypes"
require "signal_quad_field"
require "snippets"
require "tiledbackground"

--local hex = require "hex"
local i18n = require "i18n"
--local inspect = require "inspect"
local colorConstants = require "colorconstants"
local g = love.graphics
local gr = love.graphics
local generator = require "generator"
local getTime = love.timer.getTime
--local inspect = require "inspect"
local gr = love.graphics
local i18n = require "i18n"
local pallete = require "pallete"
local serpent = require "serpent"
local setupmenu = require "setupmenu"
Expand Down Expand Up @@ -67,7 +66,6 @@ global type Nback = record
written: boolean
pause: boolean
signals: Signals
--show_statistic: boolean
timestamp: number
pressed: Signals.Eq
signal: SignalView
Expand Down Expand Up @@ -95,10 +93,6 @@ global type Nback = record
durationSec: number
signalsInspected: boolean

--startcx: number
--startcy: number
--hexField: H
--hexMesh: love.graphics.Mesh
map: {{number}}

new: function(): Nback
Expand Down Expand Up @@ -305,9 +299,33 @@ function Nback:createSetupMenu()
-- выбор продолжительности экспозиции
self.setupmenu:addItem({
oninit = function(): {string}, boolean, boolean
local fullStr = i18n("setupMenu.expTime_plural", {count = tonumber(expositionList[activeExpositionItem])})
--debug.debug()
local fullStr = i18n("setupMenu.expTime_plural", {
count = tonumber(expositionList[activeExpositionItem])
})

print("------", tonumber(expositionList[activeExpositionItem]))
print("------", i18n("setupMenu.expTime_plural", {count = tonumber(expositionList[activeExpositionItem])}))
print("------", i18n("setupMenu.expTime_plural_stub", {
count = tonumber(expositionList[activeExpositionItem])
}))

--print("------", i18n("setupMenu.expTime_plural", {
--count = tonumber(expositionList[activeExpositionItem])
--}))

--[[
local colors = require 'ansicolors'
print(colors('%{red}hello'))
print(colors('%{redbg}hello%{reset}'))
print(colors('%{bright red underline}hello'))
--]]

--local ansicolors = require 'ansicolors'
--print(ansicolors(string.format("%{red}fullStr = %s", fullStr)))

--print(string.format("\%{red}fullStr = %s", fullStr))
print("fullStr = ", fullStr)

local part1, _, part2 = string.match(fullStr, "(.+)(%d)(.+)")
-- XXX may be harmful type conversion
return {pallete.signal, part1, parameterColor,
Expand Down
Loading

0 comments on commit f7a1921

Please sign in to comment.