First for language, you want:
Code:
if language[0] in ("pt_BR", "pt_PT", "pt")
more generally speaking you can eventually setup proper translations for the plugin, via Transifex.
Now for the config dialog , you have to link up the config menu item to some code to actually open the dialog, like this, in main.py:
Code:
def do_config(self):
from calibre.gui2.widgets2 import Dialog
from calibre.gui2.tweak_book import tprefs
from PyQt5.Qt import QVBoxLayout
from calibre_plugins.ACE.config import ConfigWidget
tool = self
class ConfigDialog(Dialog):
def __init__(self):
Dialog.__init__(self, 'Configure ACE', 'plugin-ace-config-dialog', parent=tool.gui, prefs=tprefs)
def setup_ui(self):
self.l = QVBoxLayout(self)
self.w = ConfigWidget()
self.l.addWidget(self.w)
def accept(self):
if self.w.validate():
self.w.save_settings()
Dialog.accept(self)
d = ConfigDialog()
d.exec_()
link it up to you action like this:
Code:
config_menu_item.triggered.connect(self.do_config)