Skip to content

Commit

Permalink
Make everything translatable (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryonakano authored Dec 1, 2018
1 parent 6ca9ef8 commit 4efeeb2
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
15 changes: 11 additions & 4 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
install_data(
'com.github.ryonakano.reco.desktop',
i18n.merge_file(
input: 'com.github.ryonakano.reco.desktop.in',
output: 'com.github.ryonakano.reco.desktop',
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

install_data(
'com.github.ryonakano.reco.appdata.xml',
i18n.merge_file(
input: 'com.github.ryonakano.reco.appdata.xml.in',
output: 'com.github.ryonakano.reco.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

Expand Down
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
project('com.github.ryonakano.reco', 'vala', 'c')

gnome = import('gnome')
i18n = import('i18n')

add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
language: 'c'
)

asresources = gnome.compile_resources(
'as-resources',
Expand All @@ -26,5 +32,6 @@ executable(
)

subdir('data')
subdir('po')

meson.add_install_script('meson/post_install.py')
Empty file added po/LINGUAS
Empty file.
4 changes: 4 additions & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src/Views/WelcomeView.vala
src/Views/RecordView.vala
src/Application.vala
src/MainWindow.vala
47 changes: 47 additions & 0 deletions po/com.github.ryonakano.reco.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the com.github.ryonakano.reco package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: com.github.ryonakano.reco\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-01 16:57+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/Views/WelcomeView.vala:35
msgid "Format:"
msgstr ""

#: src/Views/WelcomeView.vala:42
msgid "Delay in seconds:"
msgstr ""

#: src/Views/WelcomeView.vala:58
msgid "Start recording"
msgstr ""

#: src/Views/RecordView.vala:51
msgid "Stop recording"
msgstr ""

#: src/Views/RecordView.vala:78
msgid "Unable to Create an Audio File"
msgstr ""

#: src/Views/RecordView.vala:78
msgid "A gstreamer error happened while recording:"
msgstr ""

#: src/Views/RecordView.vala:78
#, c-format
msgid "Error: %s"
msgstr ""
Empty file added po/extra/LINGUAS
Empty file.
2 changes: 2 additions & 0 deletions po/extra/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data/com.github.ryonakano.reco.appdata.xml.in
data/com.github.ryonakano.reco.desktop.in
64 changes: 64 additions & 0 deletions po/extra/extra.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the extra package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: extra\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-01 16:57+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: data/com.github.ryonakano.reco.appdata.xml.in:7
#: data/com.github.ryonakano.reco.desktop.in:3
msgid "Reco"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:8
#: data/com.github.ryonakano.reco.desktop.in:5
msgid "Record talk to remember its content later"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:10
msgid "An audio recording app that lets you recall things talked later."
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:13
msgid "Useful when:"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:15
msgid "you join a discussion and take your minutes later"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:16
msgid "you want to record talk with your friends or lover"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:18
msgid "Features include:"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:20
msgid "Timed recording"
msgstr ""

#: data/com.github.ryonakano.reco.appdata.xml.in:59
msgid "Ryo Nakano"
msgstr ""

#: data/com.github.ryonakano.reco.desktop.in:4
msgid "Audio Recording App"
msgstr ""

#: data/com.github.ryonakano.reco.desktop.in:8
msgid "com.github.ryonakano.reco"
msgstr ""
7 changes: 7 additions & 0 deletions po/extra/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
i18n.gettext('extra',
args: [
'--directory=' + meson.source_root (),
'--from-code=UTF-8'
],
install: false
)
8 changes: 8 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
i18n.gettext(meson.project_name(),
args: [
'--directory=' + meson.source_root (),
'--from-code=UTF-8'
]
)

subdir('extra')
4 changes: 2 additions & 2 deletions src/Views/RecordView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class RecordView : Gtk.Box {

stop_button = new Gtk.Button ();
stop_button.image = new Gtk.Image.from_icon_name ("media-playback-stop-symbolic", Gtk.IconSize.DND);
stop_button.tooltip_text = "Stop recording";
stop_button.tooltip_text = _("Stop recording");
stop_button.get_style_context ().add_class ("record-button");
stop_button.halign = Gtk.Align.CENTER;
stop_button.margin_top = 12;
Expand All @@ -75,7 +75,7 @@ public class RecordView : Gtk.Box {
msg.parse_error (out err, out debug);

is_recording = false;
var error_dialog = new Granite.MessageDialog.with_image_from_icon_name ("Unable to Create an Audio File", "A gstreamer error happened while recording:" + "\n%s\n\n".printf (err.message) + "Error: %s".printf (debug) + "\n", "dialog-error", Gtk.ButtonsType.CLOSE);
var error_dialog = new Granite.MessageDialog.with_image_from_icon_name (_("Unable to Create an Audio File"), _("A gstreamer error happened while recording:") + "\n%s\n\n".printf (err.message) + _("Error: %s").printf (debug) + "\n", "dialog-error", Gtk.ButtonsType.CLOSE);
error_dialog.transient_for = window;
error_dialog.run ();
error_dialog.destroy ();
Expand Down
6 changes: 3 additions & 3 deletions src/Views/WelcomeView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public class WelcomeView : Gtk.Box {

construct {
// Create settings widgets
var format_label = new Gtk.Label ("Format:");
var format_label = new Gtk.Label (_("Format:"));
format_label.xalign = 1;
// TODO: Make it possible to record with various formats
format_combobox = new Gtk.ComboBoxText ();
format_combobox.append ("wav", "Wav");
format_combobox.active_id = "wav";

var delay_label = new Gtk.Label ("Delay in seconds:");
var delay_label = new Gtk.Label (_("Delay in seconds:"));
delay_label.xalign = 1;
delay_spin = new Gtk.SpinButton.with_range (0, 15, 1);

Expand All @@ -55,7 +55,7 @@ public class WelcomeView : Gtk.Box {
// Create buttons
record_button = new Gtk.Button ();
record_button.image = new Gtk.Image.from_icon_name ("audio-input-microphone-symbolic", Gtk.IconSize.DND);
record_button.tooltip_text = "Start recording";
record_button.tooltip_text = _("Start recording");
record_button.get_style_context ().add_class ("record-button");
record_button.halign = Gtk.Align.CENTER;
record_button.margin_top = 12;
Expand Down

0 comments on commit 4efeeb2

Please sign in to comment.