i18n with gettext
This commit is contained in:
@@ -11,17 +11,13 @@ from raven.pluginbase import PluginBase
|
||||
from raven.plugins.domain.menucontribution import MenuContribution
|
||||
from raven.plugins.domain.raction import RAction
|
||||
from raven.plugins.ravenlog.Tab import Tab
|
||||
|
||||
from raven.i18n import _
|
||||
|
||||
class RavenLogPlugin(PluginBase):
|
||||
def __init__(self):
|
||||
super(RavenLogPlugin, self).__init__()
|
||||
self.tr = None
|
||||
self.main_window = None
|
||||
|
||||
def set_translator(self, tr: Callable[[str], str]):
|
||||
self.tr = tr
|
||||
|
||||
def create_main_window(self):
|
||||
if not self.main_window:
|
||||
self.main_window = MainWindow()
|
||||
@@ -46,7 +42,7 @@ class RavenLogPlugin(PluginBase):
|
||||
|
||||
def _action_about(self) -> RAction:
|
||||
about_action = RAction(
|
||||
self.tr("&About"),
|
||||
_("&About"),
|
||||
action=lambda: AboutDialog().exec(),
|
||||
icon_file=constants.raven_icon
|
||||
)
|
||||
@@ -54,6 +50,6 @@ class RavenLogPlugin(PluginBase):
|
||||
|
||||
def _action_close(self) -> RAction:
|
||||
icon = "close" if sys.platform == 'win32' or sys.platform == 'cygwin' else "exit"
|
||||
close_action = RAction(self.tr("E&xit"), action=lambda: self.main_window.destruct(), shortcut='Ctrl+X',
|
||||
close_action = RAction(_("E&xit"), action=lambda: self.main_window.destruct(), shortcut='Ctrl+X',
|
||||
icon_from_theme=icon)
|
||||
return close_action
|
||||
|
||||
Reference in New Issue
Block a user