mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update RapydScript
This commit is contained in:
parent
80f311a6d0
commit
f479aaef53
@ -516,10 +516,21 @@ def ngettext(text, plural, n):
|
|||||||
def install(translation_data):
|
def install(translation_data):
|
||||||
t = new Translations(translation_data)
|
t = new Translations(translation_data)
|
||||||
t.install()
|
t.install()
|
||||||
|
for func in register_callback.install_callbacks:
|
||||||
|
try:
|
||||||
|
func(t)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return t
|
return t
|
||||||
|
|
||||||
has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty)
|
has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty)
|
||||||
|
|
||||||
|
def register_callback(func):
|
||||||
|
# Register callbacks that will be called when new translation data is
|
||||||
|
# installed
|
||||||
|
register_callback.install_callbacks.push(func)
|
||||||
|
register_callback.install_callbacks = v'[]'
|
||||||
|
|
||||||
class Translations:
|
class Translations:
|
||||||
|
|
||||||
def __init__(self, translation_data):
|
def __init__(self, translation_data):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user