Skip to content

Commit

Permalink
update translation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Jun 28, 2024
1 parent 65da104 commit 2840b8e
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 180 deletions.
4 changes: 2 additions & 2 deletions libresvip/cli/commands/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def print_plugin_details(plugin: FormatProviderPluginInfo) -> None:
)
if plugin.website:
typer.echo("\n" + _("Website: ") + plugin.website)
format_desc = f"{plugin.file_format} (*.{plugin.suffix})"
typer.echo("\n" + f'{_("This plugin is applicable to")} {_(format_desc)}.')
format_desc = f"{_(plugin.file_format)} (*.{plugin.suffix})"
typer.echo("\n" + f'{_("This plugin is applicable to")} {format_desc}.')
typer.echo(
_(
"If you want to use this plugin, please specify '-i {}' (input) or '-o {}' (output) when converting."
Expand Down
125 changes: 59 additions & 66 deletions libresvip/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2237,58 +2237,51 @@
/\x9aU}\x93\xc3\x11\x18\xa6y\xe2<i8\x92i\
\x9a\x14_c\x86\xb8&\xbc\xc1\xae\x8f\xd0\xcb\xdf\xc2\x15\
\x05\x09\
\x00\x00\x03\x13\
\x00\x00\x02\xad\
\x00\
\x00\x0d\xd8x\xda\xb5WMo\xe20\x10\xbd#\xf1\x1f\
\xbc\x1cV\xa0VA{E\xeaJ\x94\x16\x15\xa9\x15\xa5\
\xa0\xddc\xe5\x84)\xf1\xe2\xd8\xa9=)T\xa8\xff}\
\xed\x84\xf0\x9d\xc4\x08\xd5\xa7\xd8~\xe3y\xf3<\x1e;\
,\x8a\xa5B2\xc2Q\xc2\x82y\xbd\xc6\xf6\xfa\xde_\
&\xa6rq4\xdc\x93\x02\x95\xe4\xbap\xc2{\xa2\x08\
\x8aQ\xbeA<2_\xc1\xf8\xcf\xe0\xb9^\xab\xd7\x06\
\x08\x11Y\xd5k\xc4\xb4X\xc9\x18\x14~\x9a5\x86\xfe\
?\x08\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9_\xc9\
t\xe7x\xaa\x90\xd0s\x0b\xd5m\xef\x05\xca\xaf2z\
u\xd5\xc9\x5c\xa4S\xca\xd39\x8d2wn\x9d\xd6{\
\x02\xab\x1f\xbf\xed\xeb\x00\x88\x5c\xc6\xe6T\x08\xfd/\xc5\
?\x82\xcc=`\xf4\xab`\xa0R\x22`\x9a\x1e\x84\xf4\
\x820X\xb5\x8d{\xa5S\xe6\x8bc\xf0\x1d\xbd\xa0\xc8\
\xe1\x10\xd3\x99:\xbb\xfb8\x99\xe2\xddwS<\xc4t\
&\xc5\x07\x10\x99'\xb5\x07\x1f\x15m\xe2yIh\xc8\
d\x9c[\xea\x9e\x00\x86>\x00\x8a1\xbd@L\x13\xb0\
\xcf\x93'\x84\xa9\x0f\x84]\xc4\xfan\x8fLc\x7f\xfb\
<\xfb\xbciw\xd26\xba\x13Z\xe8A\xcf\xdf?p\
\xdd\xf3A\xb2@@T.\xbe\x82BW\xbb_v\xed\
\xe4L\xf1\xdd\xaa0OA\x22\xc3z\xee\xf7?\xab8\
\xdb\xce\xc7_9|\xe5\xfeEp9k\xb7\x12\xc4\xcc\
t\xaf\xae\x8c\xcaE\x0a\xc2\xf6V\x1asL\xf2\x80r\
u\xb5\xfd\xd3m\xd5]\xcf[\xce\xbd\xfa\xcc\xb8\x0a\xdb\
\x18\xa9\x8bQ\xd0\xc1\xf2\x1f4\xd8Y+\
"

qt_resource_name = b"\
Expand Down Expand Up @@ -2376,35 +2369,35 @@
\x00\x00\x00\x0c\x00\x02\x00\x00\x00\x0e\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00&\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x8f\xdc\x16m\xae\
\x00\x00\x01\x8f\xd8L\xcf\x5c\
\x00\x00\x01\x82\x00\x00\x00\x00\x00\x01\x00\x00s\xb9\
\x00\x00\x01\x8eU\xe1!\xf7\
\x00\x00\x01\x8d\xe2\x17bW\
\x00\x00\x02\x02\x00\x01\x00\x00\x00\x01\x00\x00\x85\x80\
\x00\x00\x01\x8f\xadSb\x16\
\x00\x00\x01\x8f\xac\xf8\xad\x92\
\x00\x00\x01\x0e\x00\x01\x00\x00\x00\x01\x00\x00P\xca\
\x00\x00\x01\x8f\xdc\x16m\xae\
\x00\x00\x01\x8f\xde=m\xe0\
\x00\x00\x01\xe6\x00\x01\x00\x00\x00\x01\x00\x00z\x90\
\x00\x00\x01\x8f\xadSb\x14\
\x00\x00\x01\x8f\xad\x1a\x0d\x93\
\x00\x00\x00f\x00\x01\x00\x00\x00\x01\x00\x00*:\
\x00\x00\x01\x90(\xe7\xcfW\
\x00\x00\x01\x902x\xe0\xc1\
\x00\x00\x00\xe4\x00\x00\x00\x00\x00\x01\x00\x00N7\
\x00\x00\x01\x90^9\xff\xac\
\x00\x00\x01\x90_\x1a\xb4\xed\
\x00\x00\x02&\x00\x01\x00\x00\x00\x01\x00\x00\x89\x97\
\x00\x00\x01\x8f\xadSb\x12\
\x00\x00\x01\x90`\xd9\xc5o\
\x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x003W\
\x00\x00\x01\x8eU\xe1!\xfa\
\x00\x00\x01\x8d\xe2\x17b\x5c\
\x00\x00\x01\xd4\x00\x00\x00\x00\x00\x01\x00\x00x\xbe\
\x00\x00\x01\x8eU\xe1!\xfa\
\x00\x00\x01\x8d\xe2\x17bZ\
\x00\x00\x012\x00\x00\x00\x00\x00\x01\x00\x00\x5c\xd4\
\x00\x00\x01\x903+\xdb\xda\
\x00\x00\x01\x902\x9b\x19\xdb\
\x00\x00\x01V\x00\x01\x00\x00\x00\x01\x00\x00b`\
\x00\x00\x01\x90]\xfeV\x22\
\x00\x00\x01\x90_\x1a\xb4\xee\
\x00\x00\x01\xb0\x00\x01\x00\x00\x00\x01\x00\x00wm\
\x00\x00\x01\x8eU\xe1!\xf9\
\x00\x00\x01\x8e#\xc6#s\
\x00\x00\x00<\x00\x01\x00\x00\x00\x01\x00\x00\x0a\xb7\
\x00\x00\x01\x90%\x04\x00\xa7\
\x00\x00\x01\x90#A<\x8b\
\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x01\x00\x00B\x16\
\x00\x00\x01\x8f\xadSb\x16\
\x00\x00\x01\x8f\xac\xf8\xad\x95\
"


Expand Down
15 changes: 0 additions & 15 deletions libresvip/res/qml/components/actions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import LibreSVIP

Item {
property QtObject openFile: Action {
text: qsTr("&Open")
shortcut: "Ctrl+O"
onTriggered: {
if (!taskManager.busy) {
Expand All @@ -15,19 +14,16 @@ Item {
}
}
property QtObject chooseSavePath: Action {
text: qsTr("&Choose Save Path")
shortcut: "Ctrl+Shift+S"
onTriggered: dialogs.saveDialog.open()
}
property QtObject swapInputOutput: Action {
text: qsTr("&Swap Input/Output")
shortcut: "Ctrl+Tab"
onTriggered: {
converterPage.swapInputOutputButton.clicked()
}
}
property QtObject clearTasks: Action {
text: qsTr("&Restore Task List")
shortcut: "Ctrl+R"
onTriggered: {
if (!taskManager.busy) {
Expand All @@ -46,22 +42,18 @@ Item {
}
}
property QtObject openAbout: Action {
text: qsTr("&About")
shortcut: "Ctrl+A"
onTriggered: dialogs.aboutDialog.open()
}
property QtObject openOptions: Action {
text: qsTr("&Options")
shortcut: "Alt+O"
onTriggered: dialogs.settingsDialog.open()
}
property QtObject openConvertMenu: Action {
text: qsTr("&Convert")
shortcut: "Alt+C"
onTriggered: toolbar.openConvertMenu()
}
property QtObject openImportFormatMenu: Action {
text: qsTr("&Import From")
shortcut: "Alt+I"
onTriggered: {
if (!taskManager.busy) {
Expand All @@ -70,7 +62,6 @@ Item {
}
}
property QtObject openExportFormatMenu: Action {
text: qsTr("&Export To")
shortcut: "Alt+E"
onTriggered: {
if (!taskManager.busy) {
Expand All @@ -79,22 +70,18 @@ Item {
}
}
property QtObject openHelpMenu: Action {
text: qsTr("&Help")
shortcut: "Alt+H"
onTriggered: toolbar.openHelpMenu()
}
property QtObject openLanguageMenu: Action {
text: qsTr("&Language")
shortcut: "Alt+L"
onTriggered: toolbar.openLanguageMenu()
}
property QtObject openThemesMenu: Action {
text: qsTr("&Themes")
shortcut: "Alt+T"
onTriggered: toolbar.openThemesMenu()
}
property QtObject startConversion: Action {
text: qsTr("&Start Conversion")
shortcut: "Ctrl+Enter"
onTriggered: {
if (converterPage.startConversionButton.enabled) {
Expand All @@ -103,12 +90,10 @@ Item {
}
}
property QtObject openDocumentation: Action {
text: qsTr("&Documentation")
shortcut: "F1"
onTriggered: notifier.open_link("https://soulmelody.github.io/LibreSVIP")
}
property QtObject quit: Action {
text: qsTr("&Quit")
shortcut: "Ctrl+Q"
onTriggered: Qt.quit()
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/babel.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[extractors]
yapsy_plugin = gen_extra_locale:extract_from_plugin_metadata
qt_ts = gen_extra_locale:extract_from_qt_ts
yapsy_plugin = extract_messages:extract_from_plugin_metadata
qt_ts = extract_messages:extract_from_qt_ts

[yapsy_plugin: **.yapsy-plugin]

Expand Down
18 changes: 18 additions & 0 deletions scripts/gen_extra_locale.py → scripts/extract_messages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
import subprocess
from collections.abc import Iterator
from configparser import RawConfigParser
from typing import Any, BinaryIO, Optional, Union
Expand Down Expand Up @@ -87,6 +88,16 @@ def extract_from_qt_ts(


def extract_qt_ts_msgs() -> None:
subprocess.call(
[
"pyside6-lupdate",
"-I",
*(str(qml_path) for qml_path in pathlib.Path("../libresvip/res/qml").rglob("**/*.qml")),
"-no-obsolete",
"-ts",
"../translations/libresvip_gui.ts",
]
)
cmdinst = setuptools_frontend.extract_messages()
cmdinst.initialize_options()
cmdinst.omit_header = True
Expand All @@ -101,6 +112,13 @@ def extract_qt_ts_msgs() -> None:
cmdinst.run()


def extract_python_msgs() -> None:
subprocess.call(
["pybabel", "extract", "../libresvip/", "-o", "../translations/libresvip_python.pot"]
)


if __name__ == "__main__":
extract_python_msgs()
extract_plugin_metadata_msgs()
extract_qt_ts_msgs()
3 changes: 0 additions & 3 deletions scripts/gen_qt_locale.sh

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 2840b8e

Please sign in to comment.