From 0059723805f988a07455e5e2e43fa8ac2cd35cdf Mon Sep 17 00:00:00 2001 From: Tine Jozelj Date: Mon, 17 Jul 2023 11:43:37 +0200 Subject: [PATCH] chore: initial localization support --- README.md | 16 +++- data/dev.mnts.Transcription.desktop.in.in | 4 +- .../dev.mnts.Transcription.metainfo.xml.in.in | 11 +-- data/resources/ui/window.ui | 6 +- meson.build | 2 +- po/LINGUAS | 1 + po/POTFILES.in | 7 ++ po/en.po | 75 +++++++++++++++ po/gtk-transcription.pot | 93 +++++++++++++++++++ po/si.po | 75 +++++++++++++++ 10 files changed, 276 insertions(+), 14 deletions(-) create mode 100644 po/en.po create mode 100644 po/gtk-transcription.pot create mode 100644 po/si.po diff --git a/README.md b/README.md index 2cfb448..d950b28 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,26 @@ -# `gtk-Transcription` +# `gtk-transcription` ## Building the project Make sure you have `flatpak` and `flatpak-builder` installed. Then run the commands below. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension. -``` +```sh flatpak install --user org.gnome.Sdk//43 org.freedesktop.Sdk.Extension.rust-stable//22.08 org.gnome.Platform//43 org.freedesktop.Sdk.Extension.llvm14//22.08 flatpak-builder --user flatpak_app build-aux/dev.mnts.Transcription.Devel.json ``` ## Running the project -``` +```sh flatpak-builder --run flatpak_app build-aux/dev.mnts.Transcription.Devel.json Transcription ``` + +### Contributing + +### Generating `po` and `pot` files. + +```sh +meson build build/ +cd build +meson compile gtk-transcription-update-po +``` diff --git a/data/dev.mnts.Transcription.desktop.in.in b/data/dev.mnts.Transcription.desktop.in.in index 86ba153..5db0632 100644 --- a/data/dev.mnts.Transcription.desktop.in.in +++ b/data/dev.mnts.Transcription.desktop.in.in @@ -1,6 +1,6 @@ [Desktop Entry] Name=Transcription -Comment=Write a GTK + Rust application +Comment=Transcription of voice using Whisper by OpenAI. Type=Application Exec=gtk-transcription Terminal=false @@ -10,3 +10,5 @@ Keywords=Gnome;GTK; # Translators: Do NOT translate or transliterate this text (this is an icon file name)! Icon=@icon@ StartupNotify=true + + diff --git a/data/dev.mnts.Transcription.metainfo.xml.in.in b/data/dev.mnts.Transcription.metainfo.xml.in.in index f60a1a8..01fc4ce 100644 --- a/data/dev.mnts.Transcription.metainfo.xml.in.in +++ b/data/dev.mnts.Transcription.metainfo.xml.in.in @@ -3,12 +3,11 @@ @app-id@ CC0 - - + GPL-3.0-only Transcription - Automated Voice Transcription + Transcription of voice using Whisper by OpenAI. -

Transcription of voice using Whisper by OpenAI.

+

Longer description.

@@ -16,8 +15,8 @@ Main window - https://gitlab.gnome.org/bilelmoussaoui/gtk-transcription - https://gitlab.gnome.org/bilelmoussaoui/gtk-transcription/issues + https://github.com/mentos1386/gtk-transcription + https://github.com/mentos1386/gtk-transcription diff --git a/data/resources/ui/window.ui b/data/resources/ui/window.ui index 99a3bda..cd12f8e 100644 --- a/data/resources/ui/window.ui +++ b/data/resources/ui/window.ui @@ -3,15 +3,15 @@
- _Preferences + Preferences app.preferences - _Keyboard Shortcuts + Keyboard Shortcuts win.show-help-overlay - _About Transcription + About Transcription app.about
diff --git a/meson.build b/meson.build index b965e3b..e4722e3 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'rust', version: '0.1.0', meson_version: '>= 0.59', - # license: 'MIT', + license: 'GPL-3.0-only', ) i18n = import('i18n') diff --git a/po/LINGUAS b/po/LINGUAS index e69de29..cfbe289 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -0,0 +1 @@ +en si diff --git a/po/POTFILES.in b/po/POTFILES.in index d707392..62c5619 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,13 @@ data/dev.mnts.Transcription.desktop.in.in data/dev.mnts.Transcription.gschema.xml.in data/dev.mnts.Transcription.metainfo.xml.in.in + +# find src -name "*.ui" -print data/resources/ui/shortcuts.ui data/resources/ui/window.ui + +# find src -name "*.blp" -print + +# grep gettext src/**/*.rs | cut -d: -f1 | uniq src/application.rs +src/main.rs diff --git a/po/en.po b/po/en.po new file mode 100644 index 0000000..77429c0 --- /dev/null +++ b/po/en.po @@ -0,0 +1,75 @@ +#: data/dev.mnts.Transcription.desktop.in.in:3 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:7 +#: data/resources/ui/window.ui:27 src/main.rs:21 +msgid "Transcription" +msgstr "Transcription" + +#: data/dev.mnts.Transcription.desktop.in.in:4 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:8 +msgid "Transcription of voice using Whisper by OpenAI." +msgstr "" + +#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +#: data/dev.mnts.Transcription.desktop.in.in:10 +msgid "Gnome;GTK;" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:6 +msgid "Window width" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:10 +msgid "Window height" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:14 +msgid "Window maximized state" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:10 +msgid "Longer description." +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:15 +msgid "Main window" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:32 +msgid "Tine Jozelj" +msgstr "" + +#: data/resources/ui/shortcuts.ui:11 +msgctxt "shortcut window" +msgid "General" +msgstr "" + +#: data/resources/ui/shortcuts.ui:14 +msgctxt "shortcut window" +msgid "Show Shortcuts" +msgstr "" + +#: data/resources/ui/shortcuts.ui:20 +msgctxt "shortcut window" +msgid "Quit" +msgstr "" + +#: data/resources/ui/window.ui:6 +msgid "Preferences" +msgstr "" + +#: data/resources/ui/window.ui:10 +msgid "Keyboard Shortcuts" +msgstr "" + +#: data/resources/ui/window.ui:14 +#, fuzzy +msgid "About Transcription" +msgstr "Transcription" + +#: data/resources/ui/window.ui:40 +msgid "Hello world!" +msgstr "" + +#: src/application.rs:120 +msgid "translator-credits" +msgstr "" diff --git a/po/gtk-transcription.pot b/po/gtk-transcription.pot new file mode 100644 index 0000000..8a8b13f --- /dev/null +++ b/po/gtk-transcription.pot @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the gtk-transcription package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: gtk-transcription\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-17 11:31+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: data/dev.mnts.Transcription.desktop.in.in:3 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:7 +#: data/resources/ui/window.ui:27 src/main.rs:21 +msgid "Transcription" +msgstr "" + +#: data/dev.mnts.Transcription.desktop.in.in:4 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:8 +msgid "Transcription of voice using Whisper by OpenAI." +msgstr "" + +#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +#: data/dev.mnts.Transcription.desktop.in.in:10 +msgid "Gnome;GTK;" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:6 +msgid "Window width" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:10 +msgid "Window height" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:14 +msgid "Window maximized state" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:10 +msgid "Longer description." +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:15 +msgid "Main window" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:32 +msgid "Tine Jozelj" +msgstr "" + +#: data/resources/ui/shortcuts.ui:11 +msgctxt "shortcut window" +msgid "General" +msgstr "" + +#: data/resources/ui/shortcuts.ui:14 +msgctxt "shortcut window" +msgid "Show Shortcuts" +msgstr "" + +#: data/resources/ui/shortcuts.ui:20 +msgctxt "shortcut window" +msgid "Quit" +msgstr "" + +#: data/resources/ui/window.ui:6 +msgid "Preferences" +msgstr "" + +#: data/resources/ui/window.ui:10 +msgid "Keyboard Shortcuts" +msgstr "" + +#: data/resources/ui/window.ui:14 +msgid "About Transcription" +msgstr "" + +#: data/resources/ui/window.ui:40 +msgid "Hello world!" +msgstr "" + +#: src/application.rs:120 +msgid "translator-credits" +msgstr "" diff --git a/po/si.po b/po/si.po new file mode 100644 index 0000000..949a5bc --- /dev/null +++ b/po/si.po @@ -0,0 +1,75 @@ +#: data/dev.mnts.Transcription.desktop.in.in:3 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:7 +#: data/resources/ui/window.ui:27 src/main.rs:21 +msgid "Transcription" +msgstr "Transkripcija" + +#: data/dev.mnts.Transcription.desktop.in.in:4 +#: data/dev.mnts.Transcription.metainfo.xml.in.in:8 +msgid "Transcription of voice using Whisper by OpenAI." +msgstr "" + +#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +#: data/dev.mnts.Transcription.desktop.in.in:10 +msgid "Gnome;GTK;" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:6 +msgid "Window width" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:10 +msgid "Window height" +msgstr "" + +#: data/dev.mnts.Transcription.gschema.xml.in:14 +msgid "Window maximized state" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:10 +msgid "Longer description." +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:15 +msgid "Main window" +msgstr "" + +#: data/dev.mnts.Transcription.metainfo.xml.in.in:32 +msgid "Tine Jozelj" +msgstr "" + +#: data/resources/ui/shortcuts.ui:11 +msgctxt "shortcut window" +msgid "General" +msgstr "" + +#: data/resources/ui/shortcuts.ui:14 +msgctxt "shortcut window" +msgid "Show Shortcuts" +msgstr "" + +#: data/resources/ui/shortcuts.ui:20 +msgctxt "shortcut window" +msgid "Quit" +msgstr "" + +#: data/resources/ui/window.ui:6 +msgid "Preferences" +msgstr "" + +#: data/resources/ui/window.ui:10 +msgid "Keyboard Shortcuts" +msgstr "" + +#: data/resources/ui/window.ui:14 +#, fuzzy +msgid "About Transcription" +msgstr "O Transkripciji" + +#: data/resources/ui/window.ui:40 +msgid "Hello world!" +msgstr "Pozdravljen svet!" + +#: src/application.rs:120 +msgid "translator-credits" +msgstr ""