-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathi18n.lua
More file actions
44 lines (41 loc) · 1.08 KB
/
Copy pathi18n.lua
File metadata and controls
44 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--[[
Internationalization tool
@author ikubicki
]]
class 'i18n'
function i18n:new(langCode)
if phrases[langCode] == nil then
langCode = 'en'
end
self.phrases = phrases[langCode]
return self
end
function i18n:get(key)
if self.phrases[key] then
return self.phrases[key]
end
return key
end
phrases = {
pl = {
['name'] = 'SMA czujnik energii fotowoltaicznej',
['refresh'] = 'Odśwież',
['last-update'] = 'Ostatnia aktualizacja: %s',
['please-wait'] = 'Proszę czekać...',
['device-updated'] = 'Zaktualizowano dane czujnika',
},
en = {
['name'] = 'SMA PV Energy sensor',
['refresh'] = 'Refresh',
['last-update'] = 'Last update at %s',
['please-wait'] = 'Please wait...',
['device-updated'] = 'Sensor data updated',
},
de = {
['name'] = 'SMA PV Energie sensor',
['refresh'] = 'Aktualisieren',
['last-update'] = 'Letztes update: %s',
['please-wait'] = 'Ein moment bitte...',
['device-updated'] = 'Sensor aktualisiert',
}
}