Fail to add custom-event emitting for atom


#1

Hello, I tried to handle event when language of system was changed (not language for keypad, whole system language is changed). I success to add and emit event from atom - native level to atom - javascript level. I’ve added small code into atom/browser/native_window.cc, such like:

FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnLanguageChanged(str));

and added OnLanguageChanged into atom_api_window.cc, and use “Emit” like below:

Emit(“language-changed”, locale);

locale is std::string and indicates new locale information.

Event sent from native level was called successfully in Javascript level, but the parameter which I’ve sent as “locale” was not sent properly. Is there other way to pass parameter to Javascript? Please show me the enlightenment idea!