Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TranslateAPI program developed by Christophe Daloz - De Los rios
- -- License: http://cecill.info/licences/Licence_CECILL_V2-en.txt
- -- Version: 1.0
- --
- -- TranslateAPI is an API for translate LUA programs in different languages
- local table_translation = {}
- function open(filename)
- if fs.exists(filename) then
- print("OK")
- local file = fs.open(filename, "r")
- table_translation = textutils.unserialize( file.readAll() )
- file.close()
- return true
- else
- print("The "..filename.." file is not exists")
- return false
- end
- end
- function tr(text)
- if table_translation[text] then
- return table_translation[text].text
- end
- return "Undefined "..text.." translation"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement