feat: add-intl-directory APi for scripts to extend localization

This commit is contained in:
tomasklaen
2023-04-25 10:51:39 +02:00
parent ec4e51e954
commit e23eea6e43
3 changed files with 33 additions and 4 deletions

View File

@@ -133,7 +133,8 @@ fg, bg = serialize_rgba(options.foreground).color, serialize_rgba(options.backgr
fgt, bgt = serialize_rgba(options.foreground_text).color, serialize_rgba(options.background_text).color
--[[ INTERNATIONALIZATION ]]
t = require('uosc_shared/lib/intl')
local intl = require('uosc_shared/lib/intl')
t = intl.t
--[[ CONFIG ]]
@@ -1255,6 +1256,7 @@ mp.register_script_message('set-min-visibility', function(visibility, elements)
end)
mp.register_script_message('flash-elements', function(elements) Elements:flash(split(elements, ' *, *')) end)
mp.register_script_message('overwrite-binding', function(name, command) key_binding_overwrites[name] = command end)
mp.register_script_message('add-intl-directory', function(path) intl.add_directory(path) end)
--[[ ELEMENTS ]]