From f479aaef53dc351b5d546b77af406fd31c190259 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Sep 2016 11:47:34 +0530 Subject: [PATCH] Update RapydScript --- resources/rapydscript/lib/gettext.pyj | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/rapydscript/lib/gettext.pyj b/resources/rapydscript/lib/gettext.pyj index 673d67bf5c..bb1665df78 100644 --- a/resources/rapydscript/lib/gettext.pyj +++ b/resources/rapydscript/lib/gettext.pyj @@ -516,10 +516,21 @@ def ngettext(text, plural, n): def install(translation_data): t = new Translations(translation_data) t.install() + for func in register_callback.install_callbacks: + try: + func(t) + except: + pass return t 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: def __init__(self, translation_data):