I18N Code Work done.

This commit is contained in:
Christopher T. Johnson
2024-02-14 10:02:27 -05:00
parent 633d5e48b1
commit 793d758377
24 changed files with 8712 additions and 206 deletions

View File

@@ -3,6 +3,7 @@ import os
import xml.dom.minidom import xml.dom.minidom
from typing import Dict, List, cast from typing import Dict, List, cast
from PyQt6.QtCore import QCoreApplication
from PyQt6.QtSql import QSqlQuery from PyQt6.QtSql import QSqlQuery
from main import query_error from main import query_error
@@ -20,13 +21,16 @@ class Book:
return return
def load(self, book_id: int) -> None: def load(self, book_id: int) -> None:
translate = QCoreApplication.translate
query = QSqlQuery() query = QSqlQuery()
query.prepare("SELECT * FROM books where book_id = :book_id") query.prepare("SELECT * FROM books where book_id = :book_id")
query.bindValue(":book_id", book_id) query.bindValue(":book_id", book_id)
if not query.exec(): if not query.exec():
query_error(query) query_error(query)
if not query.next(): if not query.next():
raise Exception(f"Missing book? book_id={book_id}") raise Exception(
translate("Book", "Missing book? book_id=") + f"{book_id}"
)
self.metadata = { self.metadata = {
"title": query.value("title"), "title": query.value("title"),
"creator": query.value("author"), "creator": query.value("author"),

View File

@@ -17,7 +17,7 @@ from PyQt6.QtSql import QSqlQuery, QSqlQueryModel
from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QStyledItemDelegate from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QStyledItemDelegate
from main import query_error from main import query_error
from ui.PeopleDialog import Ui_Dialog from ui.PeopleDialog import Ui_PersonDialog
class blockHandler(HTMLParser): class blockHandler(HTMLParser):
@@ -104,7 +104,7 @@ class MLStripper(HTMLParser):
return self.text.getvalue() return self.text.getvalue()
class PersonDialog(QDialog, Ui_Dialog): class PersonDialog(QDialog, Ui_PersonDialog):
SectionIdRole = Qt.ItemDataRole.UserRole SectionIdRole = Qt.ItemDataRole.UserRole
SectionSequenceRole = Qt.ItemDataRole.UserRole + 1 SectionSequenceRole = Qt.ItemDataRole.UserRole + 1
BookIdRole = Qt.ItemDataRole.UserRole + 2 BookIdRole = Qt.ItemDataRole.UserRole + 2
@@ -125,12 +125,12 @@ class PersonDialog(QDialog, Ui_Dialog):
if not query.exec(): if not query.exec():
query_error(query) query_error(query)
model.setQuery(query) model.setQuery(query)
self.bookCombo.setPlaceholderText("Select A Book") self.bookCombo.setPlaceholderText(self.tr("Select A Book"))
self.bookCombo.setModel(model) self.bookCombo.setModel(model)
self.bookCombo.setModelColumn(1) self.bookCombo.setModelColumn(1)
self.bookCombo.setCurrentIndex(-1) self.bookCombo.setCurrentIndex(-1)
model: QStandardItemModel = QStandardItemModel() # type: ignore[no-redef] model: QStandardItemModel = QStandardItemModel() # type: ignore[no-redef]
self.sectionCombo.setPlaceholderText("Select A Section") self.sectionCombo.setPlaceholderText(self.tr("Select A Section"))
self.sectionCombo.setModel(model) self.sectionCombo.setModel(model)
self.sectionCombo.setEnabled(False) self.sectionCombo.setEnabled(False)
self.sectionCombo.setCurrentIndex(-1) self.sectionCombo.setCurrentIndex(-1)
@@ -168,7 +168,7 @@ class PersonDialog(QDialog, Ui_Dialog):
if not query.exec(): if not query.exec():
query_error(query) query_error(query)
if not query.next(): if not query.next():
raise Exception(f"No person record for {person_id}") raise Exception(self.tr("No person record for ") + f"{person_id}")
self.person_id = person_id self.person_id = person_id
self.nameEdit.setText(query.value("name")) self.nameEdit.setText(query.value("name"))
self.orgEdit.setText(query.value("organization")) self.orgEdit.setText(query.value("organization"))
@@ -183,7 +183,8 @@ class PersonDialog(QDialog, Ui_Dialog):
) )
if len(matches) != 1: if len(matches) != 1:
raise Exception( raise Exception(
f"Match failed looking for book_id: {query.value('book_id')}" self.tr("Match failed looking for book_id: ")
+ f"{query.value('book_id')}"
) )
row = int(matches[0].row()) row = int(matches[0].row())
self.bookCombo.setCurrentIndex(row) self.bookCombo.setCurrentIndex(row)
@@ -215,10 +216,14 @@ class PersonDialog(QDialog, Ui_Dialog):
) )
html += "</head><body>\n" html += "</head><body>\n"
html += f"<h1>{title}</h1>\n" html += f"<h1>{title}</h1>\n"
html += self.makeNotes()
html += self.makeDefinitions() html += self.makeDefinitions()
html += self.makeText() html += self.makeText()
html += "</body>\n</html>\n" html += "</body>\n</html>\n"
#
# XXX - Use the sound module, don't do this by hand
#
if self.sender() == self.printBtn: if self.sender() == self.printBtn:
dev = None dev = None
for output in QMediaDevices.audioOutputs(): for output in QMediaDevices.audioOutputs():
@@ -312,9 +317,8 @@ class PersonDialog(QDialog, Ui_Dialog):
book_id = model.data(model.createIndex(row, 0)) book_id = model.data(model.createIndex(row, 0))
query.bindValue(":book_id", book_id) query.bindValue(":book_id", book_id)
section_id = self.sectionCombo.currentData(PersonDialog.SectionIdRole) section_id = self.sectionCombo.currentData(PersonDialog.SectionIdRole)
print(f"section_id: {section_id}")
if not section_id: if not section_id:
raise Exception(f"Section id is null") raise Exception(self.tr("Section id is null"))
if not query.exec(): if not query.exec():
query_error(query) query_error(query)
if self.person_id <= 0: if self.person_id <= 0:
@@ -426,7 +430,9 @@ class PersonDialog(QDialog, Ui_Dialog):
if not section_query.exec(): if not section_query.exec():
query_error(section_query) query_error(section_query)
if not section_query.next(): if not section_query.next():
raise Exception(f"Missing section {section_id}") raise Exception(
self.tr("Missing section ") + f"{section_id}"
)
section = blockHandler() section = blockHandler()
section.feed(section_query.value("content")) section.feed(section_query.value("content"))
html += section.get_block(query.value("block")) + "\n" html += section.get_block(query.value("block")) + "\n"
@@ -437,3 +443,24 @@ class PersonDialog(QDialog, Ui_Dialog):
html = '<div class="stats">' html = '<div class="stats">'
html += "</div>\n" html += "</div>\n"
return html return html
def makeNotes(self) -> str:
html = '<div class="notes">'
query = QSqlQuery()
query.prepare(
"SELECT * FROM sessions " "WHERE session_id = :session_id"
)
row = self.sessionCombo.currentIndex()
model = self.sessionCombo.model()
index = model.index(row, 0)
session_id = index.data()
query.bindValue(":session_id", session_id)
if not query.exec():
query_error(query)
first = True
if not query.next():
return ""
html += "<h3>" + self.tr("Notes") + "</h3>\n"
html += query.value("notes")
html += "</div>"
return html

View File

@@ -1,19 +1,28 @@
import json import json
import os import os
from typing import Any, Dict, List, Optional, Type, cast import re
from typing import Any, Dict, List, Optional, Self, Type, cast
from PyQt6.QtCore import Qt, pyqtSlot from PyQt6.QtCore import (
QCoreApplication,
QLocale,
QResource,
Qt,
QTranslator,
pyqtSlot,
)
from PyQt6.QtMultimedia import QMediaDevices from PyQt6.QtMultimedia import QMediaDevices
from PyQt6.QtWidgets import QAbstractItemView, QDialog, QListWidgetItem, QWidget from PyQt6.QtWidgets import QAbstractItemView, QDialog, QListWidgetItem, QWidget
from ui.Preferences import Ui_Dialog from ui.Preferences import Ui_Preferences
class Preferences(QDialog, Ui_Dialog): class Preferences(QDialog, Ui_Preferences):
translator: Optional[QTranslator]
_instance = None _instance = None
preferences: Dict[str, str | List[str]] preferences: Dict[str, str | List[str]]
def __new__(cls: Type[Preferences]) -> Preferences: def __new__(cls: Type[Self]) -> Self:
if cls._instance: if cls._instance:
return cls._instance return cls._instance
cls._instance = super(Preferences, cls).__new__(cls) cls._instance = super(Preferences, cls).__new__(cls)
@@ -59,6 +68,15 @@ class Preferences(QDialog, Ui_Dialog):
description = output.description() description = output.description()
self.alertList.addItem(description) self.alertList.addItem(description)
self.playerList.addItem(description) self.playerList.addItem(description)
resource = QResource("/translate")
translator = QTranslator()
for child in resource.children():
fn = f":/translate/{child}"
if translator.load(fn):
locale = QLocale(translator.language())
lang_code = locale.language()
language = QLocale.languageToString(lang_code)
self.languageCombo.addItem(language, translator.language())
self.setCurrent() self.setCurrent()
return return
@@ -72,6 +90,7 @@ class Preferences(QDialog, Ui_Dialog):
"phoneticFont": "Gentium", "phoneticFont": "Gentium",
"alertOutputs": ["default"], "alertOutputs": ["default"],
"playerOutputs": ["Feed for virtual microphone"], "playerOutputs": ["Feed for virtual microphone"],
"language": "pt",
} }
for output in self.preferences["alertOutputs"]: for output in self.preferences["alertOutputs"]:
if output == "default": if output == "default":
@@ -87,6 +106,17 @@ class Preferences(QDialog, Ui_Dialog):
output, Qt.MatchFlag.MatchExactly output, Qt.MatchFlag.MatchExactly
): ):
item.setSelected(True) item.setSelected(True)
index = self.languageCombo.findData(self.preferences["language"])
if index >= 0:
self.languageCombo.setCurrentIndex(index)
self.translator = QTranslator()
if self.translator.load(
f":/translate/esl_reader_{self.preferences['language']}"
):
assert self.translator is not None
QCoreApplication.installTranslator(self.translator)
else:
self.translator = None
index = self.readerCombo.findText(self.preferences["readerFont"]) index = self.readerCombo.findText(self.preferences["readerFont"])
if index >= 0: if index >= 0:
self.readerCombo.setCurrentIndex(index) self.readerCombo.setCurrentIndex(index)
@@ -107,6 +137,7 @@ class Preferences(QDialog, Ui_Dialog):
self.preferences[ self.preferences[
"phoneticFont" "phoneticFont"
] = self.phoneticsCombo.currentFont().family() ] = self.phoneticsCombo.currentFont().family()
self.preferences["language"] = self.languageCombo.currentData()
self.preferences["alertOutputs"] = [ self.preferences["alertOutputs"] = [
x.data(Qt.ItemDataRole.DisplayRole) x.data(Qt.ItemDataRole.DisplayRole)
for x in self.alertList.selectedItems() for x in self.alertList.selectedItems()
@@ -117,5 +148,22 @@ class Preferences(QDialog, Ui_Dialog):
] ]
with open("preferences.json", "w") as f: with open("preferences.json", "w") as f:
json.dump(self.preferences, f, indent=2) json.dump(self.preferences, f, indent=2)
if self.translator:
if self.translator.language() != self.preferences["language"]:
full_code: str = cast(str, self.preferences["language"])
locale = QLocale(full_code)
language = locale.language()
code = QLocale.languageToCode(
language, QLocale.LanguageCodeType.ISO639Part1
)
print(language, code)
fn = f":/translate/esl_reader_{code}.qm"
translator = QTranslator()
if translator.load(fn):
QCoreApplication.removeTranslator(self.translator)
self.translator = translator
QCoreApplication.installTranslator(self.translator)
else:
print(self.tr("Unable to load translation file ") + f"{fn}")
super().accept() super().accept()
return return

View File

@@ -36,10 +36,10 @@ from lib.preferences import Preferences
from lib.session import SessionDialog from lib.session import SessionDialog
from lib.sounds import SoundOff from lib.sounds import SoundOff
from main import query_error from main import query_error
from ui.ReadDialog import Ui_Dialog from ui.ReadDialog import Ui_ReadDialog
class ReadDialog(QDialog, Ui_Dialog): class ReadDialog(QDialog, Ui_ReadDialog):
playSound = pyqtSignal(str) playSound = pyqtSignal(str)
playAlert = pyqtSignal() playAlert = pyqtSignal()
block: int block: int
@@ -112,9 +112,9 @@ class ReadDialog(QDialog, Ui_Dialog):
@pyqtSlot() @pyqtSlot()
def timerAction(self) -> None: def timerAction(self) -> None:
if self.session.isActive(): # We are stopping if self.session.isActive(): # We are stopping
self.sessionBtn.setText("Start") self.sessionBtn.setText(self.tr("Start"))
else: else:
self.sessionBtn.setText("Stop") self.sessionBtn.setText(self.tr("Stop"))
self.session.timerAction() self.session.timerAction()
self.newParagraph.emit(self.section_id, self.block) self.newParagraph.emit(self.section_id, self.block)
return return
@@ -153,7 +153,6 @@ class ReadDialog(QDialog, Ui_Dialog):
@pyqtSlot() @pyqtSlot()
def playAction(self) -> None: def playAction(self) -> None:
print("playAction")
idx = self.stackedWidget.currentIndex() idx = self.stackedWidget.currentIndex()
if idx == 0: # Reading if idx == 0: # Reading
# find word # find word
@@ -188,11 +187,11 @@ class ReadDialog(QDialog, Ui_Dialog):
self.phonetics = None self.phonetics = None
if not self.phonetics: if not self.phonetics:
return return
print("Searching for audio file") print(self.tr("Searching for audio file"))
for entry in self.phonetics: for entry in self.phonetics:
if len(entry["audio"]) > 0: if len(entry["audio"]) > 0:
# self.parent().playAlert.emit() # self.parent().playAlert.emit()
print(f"playing {entry['audio']}") print(self.tr("playing ") + f"{entry['audio']}")
self.playSound.emit(entry["audio"]) self.playSound.emit(entry["audio"])
return return
@@ -279,16 +278,23 @@ class ReadDialog(QDialog, Ui_Dialog):
return return
def defToHtml(self, word: str, definition: Dict[str, Any]) -> str: def defToHtml(self, word: str, definition: Dict[str, Any]) -> str:
SPEAKER = "\U0001F508"
html = f'<h1 class="def-word">{word}</h1>' + "\n" html = f'<h1 class="def-word">{word}</h1>' + "\n"
try: try:
words: List[str] = [] words: List[str] = []
for phonetic in definition["phonetics"]: for phonetic in definition["phonetics"]:
# XXX - Some phonetics have text and audio but audio is empty,
# some have just text and some have just audio
if phonetic["text"] in words: if phonetic["text"] in words:
continue continue
words.append(phonetic["text"]) words.append(phonetic["text"])
html += f'<p class="phonetic">{phonetic["text"]}</p>' + "\n" html += f'<p class="phonetic">{phonetic["text"]}'
if "audio" in phonetic:
html += f'<a href="{phonetic["audio"]}">{SPEAKER}</a>'
html += "</p>\n"
except Exception: except Exception:
pass pass
print(html + "\n")
html += '<ul class="outer">' + "\n" html += '<ul class="outer">' + "\n"
for meaning in definition["meanings"]: for meaning in definition["meanings"]:
html += f"<li>{meaning['partOfSpeech']}" html += f"<li>{meaning['partOfSpeech']}"
@@ -391,17 +397,17 @@ class ReadDialog(QDialog, Ui_Dialog):
# Event handlers # Event handlers
# #
def keyReleaseEvent(self, event: Optional[QKeyEvent]) -> None: def keyReleaseEvent(self, event: Optional[QKeyEvent]) -> None:
self.nextBtn.setText("Next Para") self.nextBtn.setText(self.tr("Next Paragraph"))
self.prevBtn.setText("Prev Para") self.prevBtn.setText(self.tr("Previous Paragraph"))
self.defineBtn.setText("Show Def") self.defineBtn.setText(self.tr("Definition"))
self.paragraphs = True self.paragraphs = True
super().keyReleaseEvent(event) super().keyReleaseEvent(event)
return return
def keyPressEvent(self, event: Optional[QKeyEvent]) -> None: def keyPressEvent(self, event: Optional[QKeyEvent]) -> None:
self.nextBtn.setText("Next Sect") self.nextBtn.setText(self.tr("Next Section"))
self.prevBtn.setText("Prev Sect") self.prevBtn.setText(self.tr("Previous Secttion"))
self.defineBtn.setText("Add Def") self.defineBtn.setText(self.tr("Definition"))
self.paragraphs = False self.paragraphs = False
super().keyPressEvent(event) super().keyPressEvent(event)
return return
@@ -601,11 +607,11 @@ class ReadDialog(QDialog, Ui_Dialog):
def returnAction(self) -> None: def returnAction(self) -> None:
self.returnBtn.setVisible(False) self.returnBtn.setVisible(False)
if self.paragraphs: if self.paragraphs:
self.nextBtn.setText("Next Para") self.nextBtn.setText(self.tr("Next Paragraph"))
self.prevBtn.setText("Prev Para") self.prevBtn.setText(self.tr("Previous Paragraph"))
else: else:
self.nextBtn.setText("Next Sect") self.nextBtn.setText(self.tr("Next Section"))
self.prevBtn.setText("Prev Sect") self.prevBtn.setText(self.tr("Previous Section"))
self.stackedWidget.setCurrentIndex(0) self.stackedWidget.setCurrentIndex(0)
self.update() self.update()
return return
@@ -613,8 +619,8 @@ class ReadDialog(QDialog, Ui_Dialog):
def showDefinition(self) -> None: def showDefinition(self) -> None:
idx = self.stackedWidget.currentIndex() idx = self.stackedWidget.currentIndex()
self.returnBtn.setVisible(True) self.returnBtn.setVisible(True)
self.nextBtn.setText("Next Def") self.nextBtn.setText(self.tr("Next Definition"))
self.prevBtn.setText("Prev Def") self.prevBtn.setText(self.tr("Previous Definition"))
if not self.display_definition(idx): if not self.display_definition(idx):
return return
self.stackedWidget.setCurrentIndex(1) self.stackedWidget.setCurrentIndex(1)

View File

@@ -15,10 +15,10 @@ from PyQt6.QtSql import QSqlQuery
from PyQt6.QtWidgets import QCheckBox, QDialog, QListView, QMessageBox from PyQt6.QtWidgets import QCheckBox, QDialog, QListView, QMessageBox
from main import query_error from main import query_error
from ui.SessionDialog import Ui_Dialog from ui.SessionDialog import Ui_SessionDialog
class SessionDialog(QDialog, Ui_Dialog): class SessionDialog(QDialog, Ui_SessionDialog):
WordIdRole = Qt.ItemDataRole.UserRole WordIdRole = Qt.ItemDataRole.UserRole
SectionIdRole = Qt.ItemDataRole.UserRole + 1 SectionIdRole = Qt.ItemDataRole.UserRole + 1
BlockRole = Qt.ItemDataRole.UserRole + 2 BlockRole = Qt.ItemDataRole.UserRole + 2
@@ -90,8 +90,8 @@ class SessionDialog(QDialog, Ui_Dialog):
@pyqtSlot() @pyqtSlot()
def rejected(self): # type: ignore[no-untyped-def] def rejected(self): # type: ignore[no-untyped-def]
msg = QMessageBox() msg = QMessageBox()
msg.setText("There is unsaved data.") msg.setText(self.tr("There is unsaved data."))
msg.setInformativeText("Do you want to save the session?") msg.setInformativeText(self.tr("Do you want to save the session?"))
msg.setStandardButtons( msg.setStandardButtons(
QMessageBox.StandardButton.Save QMessageBox.StandardButton.Save
| QMessageBox.StandardButton.Discard | QMessageBox.StandardButton.Discard
@@ -212,7 +212,7 @@ class SessionDialog(QDialog, Ui_Dialog):
if not query.exec(): if not query.exec():
query_error(query) query_error(query)
else: else:
print(f"Not active: {word_id}") print(self.tr("Not active: ") + f"{word_id}")
return return
@pyqtSlot(int, int) @pyqtSlot(int, int)

View File

@@ -1,4 +1,4 @@
from typing import Optional, Type, cast from typing import Optional, Self, Type, cast
from PyQt6.QtCore import QObject, Qt, QUrl, pyqtSlot from PyQt6.QtCore import QObject, Qt, QUrl, pyqtSlot
from PyQt6.QtMultimedia import ( from PyQt6.QtMultimedia import (
@@ -15,7 +15,7 @@ from PyQt6.QtMultimedia import (
class SoundOff(QObject): class SoundOff(QObject):
_instance = None _instance = None
def __new__(cls: Type[SoundOff]) -> SoundOff: def __new__(cls: Type[Self]) -> Self:
if cls._instance: if cls._instance:
return cls._instance return cls._instance
cls._instance = super(SoundOff, cls).__new__(cls) cls._instance = super(SoundOff, cls).__new__(cls)

69
main.py
View File

@@ -2,15 +2,9 @@
# #
# TODO: # TODO:
# #
# Add definition to definition
# Add book import dialog # Add book import dialog
# Reading scroll with speed control # Reading scroll with speed control
# Move controls out of reading window.
# Ability to edit text with updates to word-section links # Ability to edit text with updates to word-section links
# Need to be able to place a visible cursor in text.
# Scroll to cursor
# XXX:
# Scrolling is messed up. Need a way of marking current line.
# #
import os import os
import re import re
@@ -19,6 +13,8 @@ from datetime import datetime, timedelta
from typing import Optional from typing import Optional
from PyQt6.QtCore import ( from PyQt6.QtCore import (
QCoreApplication,
QEvent,
QModelIndex, QModelIndex,
QResource, QResource,
Qt, Qt,
@@ -47,30 +43,26 @@ from lib import *
from lib.preferences import Preferences from lib.preferences import Preferences
from ui.MainWindow import Ui_MainWindow from ui.MainWindow import Ui_MainWindow
translate = QCoreApplication.translate
def query_error(query: QSqlQuery) -> None: def query_error(query: QSqlQuery) -> None:
print( print(
"SQL Error:\n{}\n{}\n{}:{}".format( translate("MainWindow", "SQL Error:\n")
+ "{}\n{}\n{}:{}".format(
query.executedQuery(), query.executedQuery(),
query.boundValues(), query.boundValues(),
query.lastError().type(), query.lastError().type(),
query.lastError().text(), query.lastError().text(),
) )
) )
raise Exception("SQL Error") raise Exception(translate("MainWindow", "SQL Error"))
class MainWindow(QMainWindow, Ui_MainWindow): class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self) -> None: def __init__(self) -> None:
super(MainWindow, self).__init__() super(MainWindow, self).__init__()
self.setupUi(self) self.setupUi(self)
#
# Setup resources
#
if not QResource.registerResource(
os.path.join(os.path.dirname(__file__), "ui/resources.rcc"), "/"
):
raise Exception("Unable to register resources.rcc")
model = QSqlQueryModel() model = QSqlQueryModel()
query = QSqlQuery("SELECT * FROM people ORDER BY name") query = QSqlQuery("SELECT * FROM people ORDER BY name")
@@ -153,7 +145,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
@pyqtSlot() @pyqtSlot()
def editBook(self) -> None: def editBook(self) -> None:
print("Edit Book") print(self.tr("Edit Book"))
return return
session = None session = None
@@ -176,6 +168,15 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.dlg.raise_() self.dlg.raise_()
return return
#
# Events
#
def changeEvent(self, event: Optional[QEvent]) -> None:
assert event is not None
if event.type() == QEvent.Type.LanguageChange:
self.retranslateUi(self)
return
SQL_CMDS = [ SQL_CMDS = [
"PRAGMA foreign_keys=ON", "PRAGMA foreign_keys=ON",
@@ -266,7 +267,7 @@ def schema_update(db: QSqlDatabase) -> None:
continue continue
print(old.lower()) print(old.lower())
print(create_cmd.lower()) print(create_cmd.lower())
print(f"Updating: {table_name}") print(translate("MainWindow", "Updating: ") + f"{table_name}")
# Step 1 turn off foreign key constraints # Step 1 turn off foreign key constraints
if not query.exec("PRAGMA foreign_keys=OFF"): if not query.exec("PRAGMA foreign_keys=OFF"):
@@ -312,30 +313,24 @@ def main() -> int:
db.setDatabaseName("twel.db") db.setDatabaseName("twel.db")
db.open() db.open()
app = QApplication(sys.argv) app = QApplication(sys.argv)
#
# Setup resources
#
if not QResource.registerResource(
os.path.join(os.path.dirname(__file__), "ui/resources.rcc"), "/"
):
raise Exception(
translate("MainWindow", "Unable to register resources.rcc")
)
schema_update(db) schema_update(db)
Preferences()
window: QMainWindow = MainWindow() window: QMainWindow = MainWindow()
return app.exec() return app.exec()
if __name__ == "__main__": if __name__ == "__main__":
outOfDate = [] #
for fileName in os.listdir("ui"): # XXX - Update the Makefile so that we can run a `make -q` will
if not fileName.endswith(".py"): # report back if make needs to be run.
continue #
uiName = "ui/" + fileName[:-3] + ".ui"
rccName = "ui/" + fileName[:-3] + ".qrc"
if not os.path.isfile(uiName) and not os.path.isfile(rccName):
outOfDate.append(fileName)
continue
if os.path.isfile(uiName) and os.path.getmtime(
uiName
) > os.path.getmtime("ui/" + fileName):
outOfDate.append(fileName)
if os.path.isfile(rccName) and os.path.getmtime(
rccName
) > os.path.getmtime("ui/" + fileName):
outOfDate.append(fileName)
if len(outOfDate) > 0:
print(f"UI out of date: {', '.join(outOfDate)}")
sys.exit(1)
sys.exit(main()) sys.exit(main())

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>PersonDialog</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="PersonDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@@ -155,7 +155,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>Dialog</receiver> <receiver>PersonDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@@ -171,7 +171,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>Dialog</receiver> <receiver>PersonDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'ui/Preferences.ui' # Form implementation generated from reading ui file 'Preferences.ui'
# #
# Created by: PyQt6 UI code generator 6.6.0 # Created by: PyQt6 UI code generator 6.6.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
@@ -9,54 +9,62 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Preferences(object):
def setupUi(self, Dialog): def setupUi(self, Preferences):
Dialog.setObjectName("Dialog") Preferences.setObjectName("Preferences")
Dialog.resize(601, 265) Preferences.resize(601, 298)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout = QtWidgets.QVBoxLayout(Preferences)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout() self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setObjectName("formLayout") self.formLayout.setObjectName("formLayout")
self.label = QtWidgets.QLabel(parent=Dialog) self.label = QtWidgets.QLabel(parent=Preferences)
self.label.setObjectName("label") self.label.setObjectName("label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label) self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label)
self.readerCombo = QtWidgets.QFontComboBox(parent=Dialog) self.readerCombo = QtWidgets.QFontComboBox(parent=Preferences)
self.readerCombo.setObjectName("readerCombo") self.readerCombo.setObjectName("readerCombo")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.readerCombo) self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.readerCombo)
self.label_2 = QtWidgets.QLabel(parent=Dialog) self.label_2 = QtWidgets.QLabel(parent=Preferences)
self.label_2.setObjectName("label_2") self.label_2.setObjectName("label_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2) self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
self.phoneticsCombo = QtWidgets.QFontComboBox(parent=Dialog) self.phoneticsCombo = QtWidgets.QFontComboBox(parent=Preferences)
self.phoneticsCombo.setObjectName("phoneticsCombo") self.phoneticsCombo.setObjectName("phoneticsCombo")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.phoneticsCombo) self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.phoneticsCombo)
self.label_3 = QtWidgets.QLabel(parent=Dialog) self.label_3 = QtWidgets.QLabel(parent=Preferences)
self.label_3.setObjectName("label_3") self.label_3.setObjectName("label_3")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3) self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
self.alertList = QtWidgets.QListWidget(parent=Dialog) self.alertList = QtWidgets.QListWidget(parent=Preferences)
self.alertList.setObjectName("alertList") self.alertList.setObjectName("alertList")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.alertList) self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.alertList)
self.label_4 = QtWidgets.QLabel(parent=Dialog) self.label_4 = QtWidgets.QLabel(parent=Preferences)
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4) self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4)
self.playerList = QtWidgets.QListWidget(parent=Dialog) self.playerList = QtWidgets.QListWidget(parent=Preferences)
self.playerList.setObjectName("playerList") self.playerList.setObjectName("playerList")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerList) self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.playerList)
self.label_5 = QtWidgets.QLabel(parent=Preferences)
self.label_5.setObjectName("label_5")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_5)
self.languageCombo = QtWidgets.QComboBox(parent=Preferences)
self.languageCombo.setObjectName("languageCombo")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.languageCombo)
self.verticalLayout.addLayout(self.formLayout) self.verticalLayout.addLayout(self.formLayout)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) self.buttonBox = QtWidgets.QDialogButtonBox(parent=Preferences)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog) self.retranslateUi(Preferences)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore self.buttonBox.accepted.connect(Preferences.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore self.buttonBox.rejected.connect(Preferences.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Preferences)
def retranslateUi(self, Dialog): def retranslateUi(self, Preferences):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Preferences.setWindowTitle(_translate("Preferences", "Dialog"))
self.label.setText(_translate("Dialog", "Reader")) self.label.setText(_translate("Preferences", "Reader"))
self.label_2.setText(_translate("Dialog", "Phonetics")) self.label_2.setText(_translate("Preferences", "Phonetics"))
self.label_3.setText(_translate("Dialog", "Alert Outputs")) self.label_3.setText(_translate("Preferences", "Alert Outputs"))
self.label_4.setText(_translate("Dialog", "Player Outputs")) self.label_4.setText(_translate("Preferences", "Player Outputs"))
self.label_5.setText(_translate("Preferences", "Language"))
self.languageCombo.setPlaceholderText(_translate("Preferences", "English"))

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>Preferences</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="Preferences">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>601</width> <width>601</width>
<height>265</height> <height>298</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -16,45 +16,58 @@
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<item row="0" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Reader</string> <string>Reader</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="1" column="1">
<widget class="QFontComboBox" name="readerCombo"/> <widget class="QFontComboBox" name="readerCombo"/>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Phonetics</string> <string>Phonetics</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="1">
<widget class="QFontComboBox" name="phoneticsCombo"/> <widget class="QFontComboBox" name="phoneticsCombo"/>
</item> </item>
<item row="2" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Alert Outputs</string> <string>Alert Outputs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="QListWidget" name="alertList"/> <widget class="QListWidget" name="alertList"/>
</item> </item>
<item row="3" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Player Outputs</string> <string>Player Outputs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="4" column="1">
<widget class="QListWidget" name="playerList"> <widget class="QListWidget" name="playerList"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="languageCombo">
<property name="placeholderText">
<string>English</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -76,7 +89,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>Dialog</receiver> <receiver>Preferences</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@@ -92,7 +105,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>Dialog</receiver> <receiver>Preferences</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@@ -1,4 +1,4 @@
# Form implementation generated from reading ui file 'ui/ReadDialog.ui' # Form implementation generated from reading ui file 'ReadDialog.ui'
# #
# Created by: PyQt6 UI code generator 6.6.1 # Created by: PyQt6 UI code generator 6.6.1
# #
@@ -9,13 +9,13 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_ReadDialog(object):
def setupUi(self, Dialog): def setupUi(self, ReadDialog):
Dialog.setObjectName("Dialog") ReadDialog.setObjectName("ReadDialog")
Dialog.resize(1024, 427) ReadDialog.resize(1103, 427)
self.horizontalLayout = QtWidgets.QHBoxLayout(Dialog) self.horizontalLayout = QtWidgets.QHBoxLayout(ReadDialog)
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.stackedWidget = QtWidgets.QStackedWidget(parent=Dialog) self.stackedWidget = QtWidgets.QStackedWidget(parent=ReadDialog)
self.stackedWidget.setObjectName("stackedWidget") self.stackedWidget.setObjectName("stackedWidget")
self.page = QtWidgets.QWidget() self.page = QtWidgets.QWidget()
self.page.setObjectName("page") self.page.setObjectName("page")
@@ -45,7 +45,7 @@ class Ui_Dialog(object):
self.verticalLayout_3.addWidget(self.defEdit) self.verticalLayout_3.addWidget(self.defEdit)
self.stackedWidget.addWidget(self.page_2) self.stackedWidget.addWidget(self.page_2)
self.horizontalLayout.addWidget(self.stackedWidget) self.horizontalLayout.addWidget(self.stackedWidget)
self.widget = QtWidgets.QWidget(parent=Dialog) self.widget = QtWidgets.QWidget(parent=ReadDialog)
self.widget.setObjectName("widget") self.widget.setObjectName("widget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget) self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
@@ -79,18 +79,18 @@ class Ui_Dialog(object):
self.verticalLayout.addWidget(self.sessionBtn) self.verticalLayout.addWidget(self.sessionBtn)
self.horizontalLayout.addWidget(self.widget) self.horizontalLayout.addWidget(self.widget)
self.retranslateUi(Dialog) self.retranslateUi(ReadDialog)
self.stackedWidget.setCurrentIndex(0) self.stackedWidget.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(ReadDialog)
def retranslateUi(self, Dialog): def retranslateUi(self, ReadDialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Reader")) ReadDialog.setWindowTitle(_translate("ReadDialog", "Reader"))
self.titleLbl.setText(_translate("Dialog", "TextLabel")) self.titleLbl.setText(_translate("ReadDialog", "TextLabel"))
self.defineBtn.setText(_translate("Dialog", "Show Def")) self.defineBtn.setText(_translate("ReadDialog", "Definition"))
self.returnBtn.setText(_translate("Dialog", "Return")) self.returnBtn.setText(_translate("ReadDialog", "Return"))
self.playBtn.setText(_translate("Dialog", "Play")) self.playBtn.setText(_translate("ReadDialog", "Play"))
self.scrollBtn.setText(_translate("Dialog", "Scroll")) self.scrollBtn.setText(_translate("ReadDialog", "Scroll"))
self.nextBtn.setText(_translate("Dialog", "Next Para")) self.nextBtn.setText(_translate("ReadDialog", "Next Paragraph"))
self.prevBtn.setText(_translate("Dialog", "Prev Para")) self.prevBtn.setText(_translate("ReadDialog", "Previous Paragraph"))
self.sessionBtn.setText(_translate("Dialog", "Start")) self.sessionBtn.setText(_translate("ReadDialog", "Start"))

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>ReadDialog</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="ReadDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1024</width> <width>1103</width>
<height>427</height> <height>427</height>
</rect> </rect>
</property> </property>
@@ -64,7 +64,7 @@
<item> <item>
<widget class="QPushButton" name="defineBtn"> <widget class="QPushButton" name="defineBtn">
<property name="text"> <property name="text">
<string>Show Def</string> <string>Definition</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -105,14 +105,14 @@
<item> <item>
<widget class="QPushButton" name="nextBtn"> <widget class="QPushButton" name="nextBtn">
<property name="text"> <property name="text">
<string>Next Para</string> <string>Next Paragraph</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="prevBtn"> <widget class="QPushButton" name="prevBtn">
<property name="text"> <property name="text">
<string>Prev Para</string> <string>Previous Paragraph</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'ui/SessionDialog.ui' # Form implementation generated from reading ui file 'SessionDialog.ui'
# #
# Created by: PyQt6 UI code generator 6.6.0 # Created by: PyQt6 UI code generator 6.6.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
@@ -9,36 +9,36 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_SessionDialog(object):
def setupUi(self, Dialog): def setupUi(self, SessionDialog):
Dialog.setObjectName("Dialog") SessionDialog.setObjectName("SessionDialog")
Dialog.resize(842, 569) SessionDialog.resize(842, 569)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout = QtWidgets.QVBoxLayout(SessionDialog)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.nameLbl = QtWidgets.QLabel(parent=Dialog) self.nameLbl = QtWidgets.QLabel(parent=SessionDialog)
self.nameLbl.setObjectName("nameLbl") self.nameLbl.setObjectName("nameLbl")
self.verticalLayout.addWidget(self.nameLbl) self.verticalLayout.addWidget(self.nameLbl)
self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.label_2 = QtWidgets.QLabel(parent=Dialog) self.label_2 = QtWidgets.QLabel(parent=SessionDialog)
self.label_2.setObjectName("label_2") self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2) self.horizontalLayout.addWidget(self.label_2)
self.timerLbl = QtWidgets.QLabel(parent=Dialog) self.timerLbl = QtWidgets.QLabel(parent=SessionDialog)
self.timerLbl.setObjectName("timerLbl") self.timerLbl.setObjectName("timerLbl")
self.horizontalLayout.addWidget(self.timerLbl) self.horizontalLayout.addWidget(self.timerLbl)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.horizontalLayout.addItem(spacerItem) self.horizontalLayout.addItem(spacerItem)
self.activeBox = QtWidgets.QCheckBox(parent=Dialog) self.activeBox = QtWidgets.QCheckBox(parent=SessionDialog)
self.activeBox.setEnabled(True) self.activeBox.setEnabled(True)
self.activeBox.setObjectName("activeBox") self.activeBox.setObjectName("activeBox")
self.horizontalLayout.addWidget(self.activeBox) self.horizontalLayout.addWidget(self.activeBox)
self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.addLayout(self.horizontalLayout)
self.label = QtWidgets.QLabel(parent=Dialog) self.label = QtWidgets.QLabel(parent=SessionDialog)
self.label.setObjectName("label") self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label) self.verticalLayout.addWidget(self.label)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.wordView = QtWidgets.QListView(parent=Dialog) self.wordView = QtWidgets.QListView(parent=SessionDialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
@@ -46,36 +46,36 @@ class Ui_Dialog(object):
self.wordView.setSizePolicy(sizePolicy) self.wordView.setSizePolicy(sizePolicy)
self.wordView.setObjectName("wordView") self.wordView.setObjectName("wordView")
self.horizontalLayout_2.addWidget(self.wordView) self.horizontalLayout_2.addWidget(self.wordView)
self.textBrowser = QtWidgets.QTextBrowser(parent=Dialog) self.textBrowser = QtWidgets.QTextBrowser(parent=SessionDialog)
self.textBrowser.setObjectName("textBrowser") self.textBrowser.setObjectName("textBrowser")
self.horizontalLayout_2.addWidget(self.textBrowser) self.horizontalLayout_2.addWidget(self.textBrowser)
self.verticalLayout.addLayout(self.horizontalLayout_2) self.verticalLayout.addLayout(self.horizontalLayout_2)
self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label_4 = QtWidgets.QLabel(parent=Dialog) self.label_4 = QtWidgets.QLabel(parent=SessionDialog)
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.verticalLayout_2.addWidget(self.label_4) self.verticalLayout_2.addWidget(self.label_4)
self.textEdit = QtWidgets.QTextEdit(parent=Dialog) self.textEdit = QtWidgets.QTextEdit(parent=SessionDialog)
self.textEdit.setObjectName("textEdit") self.textEdit.setObjectName("textEdit")
self.verticalLayout_2.addWidget(self.textEdit) self.verticalLayout_2.addWidget(self.textEdit)
self.verticalLayout.addLayout(self.verticalLayout_2) self.verticalLayout.addLayout(self.verticalLayout_2)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) self.buttonBox = QtWidgets.QDialogButtonBox(parent=SessionDialog)
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog) self.retranslateUi(SessionDialog)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore self.buttonBox.accepted.connect(SessionDialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore self.buttonBox.rejected.connect(SessionDialog.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(SessionDialog)
def retranslateUi(self, Dialog): def retranslateUi(self, SessionDialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Session")) SessionDialog.setWindowTitle(_translate("SessionDialog", "Session"))
self.nameLbl.setText(_translate("Dialog", "nameLbl")) self.nameLbl.setText(_translate("SessionDialog", "nameLbl"))
self.label_2.setText(_translate("Dialog", "Session Timer")) self.label_2.setText(_translate("SessionDialog", "Session Timer"))
self.timerLbl.setText(_translate("Dialog", "00:00:00")) self.timerLbl.setText(_translate("SessionDialog", "00:00:00"))
self.activeBox.setText(_translate("Dialog", "Active")) self.activeBox.setText(_translate("SessionDialog", "Active"))
self.label.setText(_translate("Dialog", "Words")) self.label.setText(_translate("SessionDialog", "Words"))
self.label_4.setText(_translate("Dialog", "Notes")) self.label_4.setText(_translate("SessionDialog", "Notes"))

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>SessionDialog</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="SessionDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@@ -117,7 +117,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>Dialog</receiver> <receiver>SessionDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@@ -133,7 +133,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>Dialog</receiver> <receiver>SessionDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'ui/WordDialog.ui' # Form implementation generated from reading ui file 'WordDialog.ui'
# #
# Created by: PyQt6 UI code generator 6.6.0 # Created by: PyQt6 UI code generator 6.6.1
# #
# WARNING: Any manual changes made to this file will be lost when pyuic6 is # WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing. # run again. Do not edit this file unless you know what you are doing.
@@ -9,15 +9,15 @@
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Word(object):
def setupUi(self, Dialog): def setupUi(self, Word):
Dialog.setObjectName("Dialog") Word.setObjectName("Word")
Dialog.resize(802, 300) Word.resize(802, 300)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout = QtWidgets.QVBoxLayout(Word)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
self.wordList = QtWidgets.QListView(parent=Dialog) self.wordList = QtWidgets.QListView(parent=Word)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
@@ -25,18 +25,18 @@ class Ui_Dialog(object):
self.wordList.setSizePolicy(sizePolicy) self.wordList.setSizePolicy(sizePolicy)
self.wordList.setObjectName("wordList") self.wordList.setObjectName("wordList")
self.horizontalLayout.addWidget(self.wordList) self.horizontalLayout.addWidget(self.wordList)
self.definition = QtWidgets.QTextEdit(parent=Dialog) self.definition = QtWidgets.QTextEdit(parent=Word)
self.definition.setObjectName("definition") self.definition.setObjectName("definition")
self.horizontalLayout.addWidget(self.definition) self.horizontalLayout.addWidget(self.definition)
self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.addLayout(self.horizontalLayout)
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) self.buttonBox = QtWidgets.QDialogButtonBox(parent=Word)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog) self.retranslateUi(Word)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Word)
def retranslateUi(self, Dialog): def retranslateUi(self, Word):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Word.setWindowTitle(_translate("Word", "Dialog"))

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>Word</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="Word">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

0
ui/assets/KEEP Normal file
View File

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,401 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>Book</name>
<message>
<location filename="../../lib/books.py" line="32"/>
<source>Missing book? book_id=</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../MainWindow.ui" line="14"/>
<source>Reading Helper</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="27"/>
<location filename="../MainWindow.ui" line="157"/>
<source>Read</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="34"/>
<location filename="../MainWindow.ui" line="94"/>
<location filename="../MainWindow.ui" line="133"/>
<location filename="../MainWindow.ui" line="149"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="61"/>
<location filename="../MainWindow.ui" line="128"/>
<source>Add Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="68"/>
<source>Add Person</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="88"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="98"/>
<source>Books</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="105"/>
<source>People</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="120"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="125"/>
<location filename="../MainWindow.ui" line="141"/>
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="136"/>
<location filename="../../main.py" line="148"/>
<source>Edit Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="144"/>
<source>Add A Person</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="152"/>
<source>Edit A Person</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="160"/>
<source>Read Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.ui" line="165"/>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../main.py" line="52"/>
<source>SQL Error:
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../main.py" line="59"/>
<source>SQL Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../main.py" line="270"/>
<source>Updating: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../main.py" line="324"/>
<source>Unable to register resources.rcc</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PersonDialog</name>
<message>
<location filename="../../lib/person.py" line="128"/>
<source>Select A Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="133"/>
<source>Select A Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="171"/>
<source>No person record for </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="187"/>
<source>Match failed looking for book_id: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="321"/>
<source>Section id is null</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="434"/>
<source>Missing section </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/person.py" line="463"/>
<source>Notes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="20"/>
<source>People</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="26"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="36"/>
<source>Email</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="46"/>
<source>Organization</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="56"/>
<source>Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="66"/>
<source>Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="91"/>
<source>Print</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="104"/>
<source>EMail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="137"/>
<source>Session</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Preferences</name>
<message>
<location filename="../../lib/preferences.py" line="167"/>
<source>Unable to load translation file </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="14"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="22"/>
<source>Reader</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="32"/>
<source>Phonetics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="42"/>
<source>Alert Outputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="52"/>
<source>Player Outputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="62"/>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Preferences.ui" line="69"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReadDialog</name>
<message>
<location filename="../ReadDialog.ui" line="129"/>
<location filename="../../lib/read.py" line="115"/>
<source>Start</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="117"/>
<source>Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="190"/>
<source>Searching for audio file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="194"/>
<source>playing </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="14"/>
<source>Reader</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="27"/>
<source>TextLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="74"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="81"/>
<source>Play</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="101"/>
<source>Scroll</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="108"/>
<location filename="../../lib/read.py" line="400"/>
<location filename="../../lib/read.py" line="610"/>
<source>Next Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="115"/>
<location filename="../../lib/read.py" line="401"/>
<location filename="../../lib/read.py" line="611"/>
<source>Previous Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="67"/>
<location filename="../../lib/read.py" line="402"/>
<location filename="../../lib/read.py" line="410"/>
<source>Definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="408"/>
<location filename="../../lib/read.py" line="613"/>
<source>Next Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="409"/>
<source>Previous Secttion</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="614"/>
<source>Previous Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="622"/>
<source>Next Definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="623"/>
<source>Previous Definition</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SessionDialog</name>
<message>
<location filename="../../lib/session.py" line="93"/>
<source>There is unsaved data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/session.py" line="94"/>
<source>Do you want to save the session?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/session.py" line="215"/>
<source>Not active: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="14"/>
<source>Session</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="20"/>
<source>nameLbl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="29"/>
<source>Session Timer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="36"/>
<source>00:00:00</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="59"/>
<source>Active</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="68"/>
<source>Words</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="94"/>
<source>Notes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Word</name>
<message>
<location filename="../WordDialog.ui" line="14"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,506 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pt_BR" sourcelanguage="en_US">
<context>
<name>Book</name>
<message>
<location filename="../../lib/books.py" line="32"/>
<source>Missing book? book_id=</source>
<translation>Livro faltando? book_id=</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../../main.py" line="52"/>
<source>SQL Error:
</source>
<translation>Erro SQL:</translation>
</message>
<message>
<location filename="../../main.py" line="59"/>
<source>SQL Error</source>
<translation>Erro SQL</translation>
</message>
<message>
<location filename="../../main.py" line="324"/>
<source>Unable to register resources.rcc</source>
<translation>Não foi possível registrar resources.rcc</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="136"/>
<location filename="../../main.py" line="148"/>
<source>Edit Book</source>
<translation>Editar livro</translation>
</message>
<message>
<location filename="../../main.py" line="270"/>
<source>Updating: </source>
<translation>Atualizando</translation>
</message>
<message>
<source>UI out of date: </source>
<translation type="vanished">IU desatualizada:</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="14"/>
<source>Reading Helper</source>
<translation>Auxiliar de leitura</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="27"/>
<location filename="../MainWindow.ui" line="157"/>
<source>Read</source>
<translation>Ler</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="34"/>
<location filename="../MainWindow.ui" line="94"/>
<location filename="../MainWindow.ui" line="133"/>
<location filename="../MainWindow.ui" line="149"/>
<source>Edit</source>
<translation>Editar</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="61"/>
<location filename="../MainWindow.ui" line="128"/>
<source>Add Book</source>
<translation>Adicionar livro</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="68"/>
<source>Add Person</source>
<translation>Adicionar pessoa</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="88"/>
<source>File</source>
<translation>Arquivo</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="98"/>
<source>Books</source>
<translation>Livros</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="105"/>
<source>People</source>
<translation>Pessoas</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="120"/>
<source>Quit</source>
<translation>Desistir</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="125"/>
<location filename="../MainWindow.ui" line="141"/>
<source>Add</source>
<translation>Adicionar</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="144"/>
<source>Add A Person</source>
<translation>Adicionar uma pessoa</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="152"/>
<source>Edit A Person</source>
<translation>Editar uma pessoa</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="160"/>
<source>Read Book</source>
<translation>Ler livro</translation>
</message>
<message>
<location filename="../MainWindow.ui" line="165"/>
<source>Preferences</source>
<translation>Preferências</translation>
</message>
<message>
<source>MainWindow</source>
<translation type="vanished">MainWindow</translation>
</message>
</context>
<context>
<name>People</name>
<message>
<source>People</source>
<translation type="vanished">Pessoas</translation>
</message>
<message>
<source>Name</source>
<translation type="vanished">Nome</translation>
</message>
<message>
<source>Email</source>
<translation type="vanished">e-mail</translation>
</message>
<message>
<source>Organization</source>
<translation type="vanished">Organização</translation>
</message>
<message>
<source>Book</source>
<translation type="vanished">Livro</translation>
</message>
<message>
<source>Section</source>
<translation type="vanished">Seção</translation>
</message>
<message>
<source>Print</source>
<translation type="vanished">Imprimir</translation>
</message>
<message>
<source>EMail</source>
<translation type="vanished">E-mail</translation>
</message>
</context>
<context>
<name>PersonDialog</name>
<message>
<location filename="../../lib/person.py" line="128"/>
<source>Select A Book</source>
<translation>Selecione um livro</translation>
</message>
<message>
<location filename="../../lib/person.py" line="133"/>
<source>Select A Section</source>
<translation>Selecione uma seção</translation>
</message>
<message>
<location filename="../../lib/person.py" line="171"/>
<source>No person record for </source>
<translation>Nenhum registro de pessoa para</translation>
</message>
<message>
<location filename="../../lib/person.py" line="187"/>
<source>Match failed looking for book_id: </source>
<translation>Falha na busca da correspondência book_id:</translation>
</message>
<message>
<location filename="../../lib/person.py" line="321"/>
<source>Section id is null</source>
<translation>O ID da seção é nulo</translation>
</message>
<message>
<location filename="../../lib/person.py" line="434"/>
<source>Missing section </source>
<translation>Seção ausente</translation>
</message>
<message>
<location filename="../../lib/person.py" line="463"/>
<source>Notes</source>
<translation>Notas</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="20"/>
<source>People</source>
<translation type="unfinished">Pessoas</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="26"/>
<source>Name</source>
<translation type="unfinished">Nome</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="36"/>
<source>Email</source>
<translation type="unfinished">e-mail</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="46"/>
<source>Organization</source>
<translation type="unfinished">Organização</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="56"/>
<source>Book</source>
<translation type="unfinished">Livro</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="66"/>
<source>Section</source>
<translation type="unfinished">Seção</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="91"/>
<source>Print</source>
<translation type="unfinished">Imprimir</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="104"/>
<source>EMail</source>
<translation type="unfinished">E-mail</translation>
</message>
<message>
<location filename="../PersonDialog.ui" line="137"/>
<source>Session</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Preferences</name>
<message>
<location filename="../../lib/preferences.py" line="167"/>
<source>Unable to load translation file </source>
<translation>Não foi possível carregar o arquivo de tradução</translation>
</message>
<message>
<location filename="../Preferences.ui" line="14"/>
<source>Dialog</source>
<translation>Diálogo</translation>
</message>
<message>
<location filename="../Preferences.ui" line="22"/>
<source>Reader</source>
<translation>Leitor</translation>
</message>
<message>
<location filename="../Preferences.ui" line="32"/>
<source>Phonetics</source>
<translation>Fonético</translation>
</message>
<message>
<location filename="../Preferences.ui" line="42"/>
<source>Alert Outputs</source>
<translation>Saídas de alerta</translation>
</message>
<message>
<location filename="../Preferences.ui" line="52"/>
<source>Player Outputs</source>
<translation>Saídas do jogador</translation>
</message>
<message>
<location filename="../Preferences.ui" line="62"/>
<source>Language</source>
<translation>Linguagem</translation>
</message>
<message>
<location filename="../Preferences.ui" line="69"/>
<source>English</source>
<translation>Inglês</translation>
</message>
</context>
<context>
<name>Read</name>
<message>
<source>Reader</source>
<translation type="obsolete">Leitor</translation>
</message>
<message>
<source>TextLabel</source>
<translation type="obsolete">textLabel</translation>
</message>
<message>
<source>Show Def</source>
<translation type="obsolete">Definir</translation>
</message>
<message>
<source>Return</source>
<translation type="obsolete">Retornar</translation>
</message>
<message>
<source>Play</source>
<translation type="obsolete">Jogar</translation>
</message>
<message>
<source>Scroll</source>
<translation type="obsolete">Rolagem</translation>
</message>
<message>
<source>Next Para</source>
<translation type="obsolete">Próximo parágrafo</translation>
</message>
<message>
<source>Prev Para</source>
<translation type="obsolete">Parágrafo Anterior</translation>
</message>
<message>
<source>Start</source>
<translation type="obsolete">Começar</translation>
</message>
</context>
<context>
<name>ReadDialog</name>
<message>
<location filename="../ReadDialog.ui" line="129"/>
<location filename="../../lib/read.py" line="115"/>
<source>Start</source>
<translation>Começar</translation>
</message>
<message>
<location filename="../../lib/read.py" line="117"/>
<source>Stop</source>
<translation>Parar</translation>
</message>
<message>
<location filename="../../lib/read.py" line="190"/>
<source>Searching for audio file</source>
<translation>Procurando por arquivo de áudio</translation>
</message>
<message>
<location filename="../../lib/read.py" line="194"/>
<source>playing </source>
<translation>jogando </translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="14"/>
<source>Reader</source>
<translation type="unfinished">Leitor</translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="27"/>
<source>TextLabel</source>
<translation type="unfinished">textLabel</translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="74"/>
<source>Return</source>
<translation type="unfinished">Retornar</translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="81"/>
<source>Play</source>
<translation type="unfinished">Jogar</translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="101"/>
<source>Scroll</source>
<translation type="unfinished">Rolagem</translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="108"/>
<location filename="../../lib/read.py" line="400"/>
<location filename="../../lib/read.py" line="610"/>
<source>Next Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="115"/>
<location filename="../../lib/read.py" line="401"/>
<location filename="../../lib/read.py" line="611"/>
<source>Previous Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ReadDialog.ui" line="67"/>
<location filename="../../lib/read.py" line="402"/>
<location filename="../../lib/read.py" line="410"/>
<source>Definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="408"/>
<location filename="../../lib/read.py" line="613"/>
<source>Next Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="409"/>
<source>Previous Secttion</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="614"/>
<source>Previous Section</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="622"/>
<source>Next Definition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/read.py" line="623"/>
<source>Previous Definition</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SessionDialog</name>
<message>
<location filename="../../lib/session.py" line="93"/>
<source>There is unsaved data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/session.py" line="94"/>
<source>Do you want to save the session?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../lib/session.py" line="215"/>
<source>Not active: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="14"/>
<source>Session</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="20"/>
<source>nameLbl</source>
<translation type="unfinished">nameLbl</translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="29"/>
<source>Session Timer</source>
<translation type="unfinished">Temporizador de sessão</translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="36"/>
<source>00:00:00</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="59"/>
<source>Active</source>
<translation type="unfinished">Ativo</translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="68"/>
<source>Words</source>
<translation type="unfinished">Palavras</translation>
</message>
<message>
<location filename="../SessionDialog.ui" line="94"/>
<source>Notes</source>
<translation type="unfinished">Notas</translation>
</message>
</context>
<context>
<name>Sesssion</name>
<message>
<source>nameLbl</source>
<translation type="obsolete">nameLbl</translation>
</message>
<message>
<source>Session Timer</source>
<translation type="obsolete">Temporizador de sessão</translation>
</message>
<message>
<source>Active</source>
<translation type="obsolete">Ativo</translation>
</message>
<message>
<source>Words</source>
<translation type="obsolete">Palavras</translation>
</message>
<message>
<source>Notes</source>
<translation type="obsolete">Notas</translation>
</message>
</context>
<context>
<name>Word</name>
<message>
<location filename="../WordDialog.ui" line="14"/>
<source>Dialog</source>
<translation type="unfinished">Diálogo</translation>
</message>
</context>
</TS>