Add global locale change event, application now automatically change language when the event is triggered

This commit is contained in:
Xuan Sang LE
2018-03-10 12:22:01 +01:00
parent 45c89be5be
commit 1b9e6e88fa
38 changed files with 255 additions and 219 deletions

View File

@ -96,17 +96,16 @@ class Preview extends this.OS.GUI.BaseApplication
menu: () ->
me = @
menu = [{
text: __("File"),
text: "__(File)",
child: [
{ text: __("Open"), dataid: "#{@name}-Open", shortcut: "A-O" },
{ text: __("Close"), dataid: "#{@name}-Close", shortcut: "C-X" },
{ text: "__(Open)", dataid: "#{@name}-Open", shortcut: "A-O" },
{ text: "__(Close)", dataid: "#{@name}-Close", shortcut: "C-X" },
],
onmenuselect: (e) -> me.actionFile e.item.data.dataid
}]
menu
actionFile: (e) ->
console.log e
me = @
switch e
when "#{@name}-Open"