Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,601 changes: 874 additions & 727 deletions po/aegisub.pot

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions po/make_pot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ maybe_append() {

find ../src ../src/command -name '*.cpp' -o -name '*.h' \
| xgettext --files-from=- -o - --c++ --sort-by-file \
-k_ -kwxTRANSLATE -kSTR_MENU -kSTR_DISP -kSTR_HELP -kCOMMAND_GROUP:5 \
-k_ -kwxTRANSLATE -kwxGETTEXT_IN_CONTEXT:1c,2 -kSTR_MENU -kSTR_DISP -kSTR_HELP -kCOMMAND_GROUP:5 \
-kfmt_tl -kfmt_plural:2,3 \
| sed 's/SOME DESCRIPTIVE TITLE./Aegisub 3.2/' \
| sed 's/YEAR/2005-2014/' \
Expand Down Expand Up @@ -57,9 +57,3 @@ do
| sed 's/[^=]*=\(.*\)/packages\/win_installer\/fragment_strings.iss|1|"\1"/' \
| maybe_append
done

for lang in $(cat LINGUAS) ; do
# If using gettext < 0.21, run twice to avoid reversing order of old strings
# ref: https://savannah.gnu.org/bugs/?58778
msgmerge --update --backup=none --no-fuzzy-matching "$lang".po aegisub.pot
done
6 changes: 4 additions & 2 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
i18n = import('i18n')
# This is currently busted on OSX
# and incomplete on any platform.
# This should only be used to compile the translations during a build.
# Meson's i18n module is not sufficient to generate a pot file:
# It misses translatable strings not directly found in either
# C++ source, desktop or appdata file. This affects strings
# of the Windows installer (iss), from Lua scripts and JSON files.
# Until a solution is found, POT updates should continue to use make_pot.sh.
# Similarly, since meson insists on regenerating the POT file before updating
# PO files, PO files should be updated using update_po.sh
i18n.gettext('aegisub',
args: [
'-k_', '-kSTR_MENU', '-kSTR_DISP', '-kSTR_HELP', '-kCOMMAND_GROUP:5,',
Expand Down
11 changes: 11 additions & 0 deletions po/update_po.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

# Use as './update_po.sh de ja' to only update some po files,
# or as `./update_po.sh` to update all of them.

for lang in ${@:-$(cat LINGUAS)} ; do
# If using gettext < 0.21, run twice to avoid reversing order of old strings
# ref: https://savannah.gnu.org/bugs/?58778
msgmerge --update --backup=none --previous "$lang".po aegisub.pot
done
12 changes: 6 additions & 6 deletions src/auto4_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ namespace {
subsobj->ProcessingComplete();

if (err) {
wxLogWarning("Runtime error in Lua macro validation function:\n%s", get_wxstring(L, -1));
wxLogWarning(fmt_tl("Runtime error in Lua macro validation function:\n%s", get_wxstring(L, -1)));
lua_pop(L, 2);
return false;
}
Expand Down Expand Up @@ -878,7 +878,7 @@ namespace {
if (lua_isnumber(L, -1)) {
active_idx = lua_tointeger(L, -1);
if (active_idx < 1 || active_idx > (int)lines.size()) {
wxLogError("Active row %d is out of bounds (must be 1-%u)", active_idx, lines.size());
wxLogError(fmt_tl("Active row %d is out of bounds (must be 1-%u)", active_idx, lines.size()));
active_idx = original_active;
}
}
Expand All @@ -894,13 +894,13 @@ namespace {
return;
int cur = lua_tointeger(L, -1);
if (cur < 1 || cur > (int)lines.size()) {
wxLogError("Selected row %d is out of bounds (must be 1-%u)", cur, lines.size());
wxLogError(fmt_tl("Selected row %d is out of bounds (must be 1-%u)", cur, lines.size()));
throw LuaForEachBreak();
}

AssEntry *curline = lines[cur - 1];
if (typeid(*curline) != typeid(AssDialogue)) {
wxLogError("Selected row %d is not a dialogue line", cur);
wxLogError(fmt_tl("Selected row %d is not a dialogue line", cur));
throw LuaForEachBreak();
}

Expand Down Expand Up @@ -966,7 +966,7 @@ namespace {

bool result = false;
if (err)
wxLogWarning("Runtime error in Lua macro IsActive function:\n%s", get_wxstring(L, -1));
wxLogWarning(fmt_tl("Runtime error in Lua macro IsActive function:\n%s", get_wxstring(L, -1)));
else
result = !!lua_toboolean(L, -1);

Expand Down Expand Up @@ -1072,7 +1072,7 @@ namespace {
subsobj->ProcessingComplete();

if (err) {
wxLogWarning("Runtime error in Lua config dialog function:\n%s", get_wxstring(L, -1));
wxLogWarning(fmt_tl("Runtime error in Lua config dialog function:\n%s", get_wxstring(L, -1)));
lua_pop(L, 1); // remove error message
} else {
// Create config dialogue from table on top of stack
Expand Down
2 changes: 1 addition & 1 deletion src/command/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct app_language final : public Command {
OPT_SET("App/Language")->SetString(new_language);

// Ask to restart program
int result = wxMessageBox("Aegisub needs to be restarted so that the new language can be applied. Restart now?", "Restart Aegisub?", wxYES_NO | wxICON_QUESTION | wxCENTER);
int result = wxMessageBox(_("Aegisub needs to be restarted so that the new language can be applied. Restart now?"), _("Restart Aegisub?"), wxYES_NO | wxICON_QUESTION | wxCENTER);
if (result == wxYES) {
// Restart Aegisub
if (c->frame->Close()) {
Expand Down
4 changes: 2 additions & 2 deletions src/command/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct audio_open final : public Command {
auto str = from_wx(_("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.eac3,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.opus,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.eac3;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.opus;*.w64;*.wav;*.wma|"
+ _("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts|"
+ _("All Files") + " (*.*)|*.*");
auto filename = OpenFileSelector(_("Open Audio File"), "Path/Last/Audio", "", "", str, c->parent);
auto filename = OpenFileSelector(wxGETTEXT_IN_CONTEXT("dialog title", "Open Audio File"), "Path/Last/Audio", "", "", str, c->parent);
if (!filename.empty())
c->project->LoadAudio(filename);
}
Expand Down Expand Up @@ -174,7 +174,7 @@ struct audio_save_clip final : public Command {
auto const& sel = c->selectionController->GetSelectedSet();
if (sel.empty()) return;

auto filename = SaveFileSelector(_("Save audio clip"), "", "", "wav", "", c->parent);
auto filename = SaveFileSelector(_("Save Audio Clip"), "", "", "wav", "", c->parent);
if (filename.empty()) return;

agi::Time start = INT_MAX, end = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/command/keyframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct keyframe_open final : public Command {

void operator()(agi::Context *c) override {
auto filename = OpenFileSelector(
_("Open keyframes file"),
_("Open Keyframes File"),
"Path/Last/Keyframes", "" ,".txt",
from_wx(_("All Supported Formats") +
" (*.txt, *.pass, *.stats, *.log)|*.txt;*.pass;*.stats;*.log|" +
Expand All @@ -94,7 +94,7 @@ struct keyframe_save final : public Command {
}

void operator()(agi::Context *c) override {
auto filename = SaveFileSelector(_("Save keyframes file"), "Path/Last/Keyframes", "", "*.key.txt", "Text files (*.txt)|*.txt", c->parent);
auto filename = SaveFileSelector(_("Save Keyframes File"), "Path/Last/Keyframes", "", "*.key.txt", from_wx(_("Text Files") + " (*.txt)|*.txt"), c->parent);
if (filename.empty()) return;

agi::keyframe::Save(filename, c->project->Keyframes());
Expand Down
10 changes: 5 additions & 5 deletions src/command/subtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ struct subtitle_open final : public Command {
void operator()(agi::Context *c) override {
if (!is_okay_to_close_subtitles(c)) return;

auto filename = OpenFileSelector(_("Open subtitles file"), "Path/Last/Subtitles", "","", SubtitleFormat::GetWildcards(0), c->parent);
auto filename = OpenFileSelector(_("Open Subtitles File"), "Path/Last/Subtitles", "","", SubtitleFormat::GetWildcards(0), c->parent);
if (!filename.empty())
load_subtitles(c, filename);
}
Expand Down Expand Up @@ -301,7 +301,7 @@ struct subtitle_open_charset final : public Command {
void operator()(agi::Context *c) override {
if (!is_okay_to_close_subtitles(c)) return;

auto filename = OpenFileSelector(_("Open subtitles file"), "Path/Last/Subtitles", "","", SubtitleFormat::GetWildcards(0), c->parent);
auto filename = OpenFileSelector(_("Open Subtitles File"), "Path/Last/Subtitles", "","", SubtitleFormat::GetWildcards(0), c->parent);
if (filename.empty()) return;

wxString charset = wxGetSingleChoice(_("Choose charset code:"), _("Charset"), agi::charset::GetEncodingsList<wxArrayString>(), c->parent, -1, -1, true, 250, 200);
Expand Down Expand Up @@ -344,7 +344,7 @@ struct subtitle_properties final : public Command {
static void save_subtitles(agi::Context *c, agi::fs::path filename) {
if (filename.empty()) {
c->videoController->Stop();
filename = SaveFileSelector(_("Save subtitles file"), "Path/Last/Subtitles",
filename = SaveFileSelector(_("Save Subtitles File"), "Path/Last/Subtitles",
c->subsController->Filename().stem().string() + ".ass", "ass",
"Advanced Substation Alpha (*.ass)|*.ass", c->parent);
if (filename.empty()) return;
Expand All @@ -354,10 +354,10 @@ static void save_subtitles(agi::Context *c, agi::fs::path filename) {
c->subsController->Save(filename);
}
catch (const agi::Exception& err) {
wxMessageBox(to_wx(err.GetMessage()), "Error", wxOK | wxICON_ERROR | wxCENTER, c->parent);
wxMessageBox(to_wx(err.GetMessage()), _("Error"), wxOK | wxICON_ERROR | wxCENTER, c->parent);
}
catch (...) {
wxMessageBox("Unknown error", "Error", wxOK | wxICON_ERROR | wxCENTER, c->parent);
wxMessageBox(_("Unknown error"), _("Error"), wxOK | wxICON_ERROR | wxCENTER, c->parent);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/command/timecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct timecode_open final : public Command {

void operator()(agi::Context *c) override {
auto str = from_wx(_("Text Files") + " (*.txt)|*.txt|" + _("All Files") + " (*.*)|*.*");
auto filename = OpenFileSelector(_("Open Timecodes File"), "Path/Last/Timecodes", "", "", str, c->parent);
auto filename = OpenFileSelector(wxGETTEXT_IN_CONTEXT("dialog title", "Open Timecodes File"), "Path/Last/Timecodes", "", "", str, c->parent);
if (!filename.empty())
c->project->LoadTimecodes(filename);
}
Expand All @@ -91,7 +91,7 @@ struct timecode_save final : public Command {

void operator()(agi::Context *c) override {
auto str = from_wx(_("Text Files") + " (*.txt)|*.txt|" + _("All Files") + " (*.*)|*.*");
auto filename = SaveFileSelector(_("Save Timecodes File"), "Path/Last/Timecodes", "", "", str, c->parent);
auto filename = SaveFileSelector(wxGETTEXT_IN_CONTEXT("dialog title", "Save Timecodes File"), "Path/Last/Timecodes", "", "", str, c->parent);
if (filename.empty()) return;

try {
Expand All @@ -100,7 +100,7 @@ struct timecode_save final : public Command {
config::mru->Add("Timecodes", filename);
}
catch (agi::Exception const& err) {
wxMessageBox(to_wx(err.GetMessage()), "Error saving timecodes", wxOK | wxICON_ERROR | wxCENTER, c->parent);
wxMessageBox(to_wx(err.GetMessage()), _("Error saving timecodes"), wxOK | wxICON_ERROR | wxCENTER, c->parent);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/command/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ struct video_open final : public Command {
void operator()(agi::Context *c) override {
auto str = from_wx(_("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.h264,*.hevc,*.m2ts,*.m4v,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.webm,*.wmv,*.ts,*.y4m,*.yuv)|*.asf;*.avi;*.avs;*.d2v;*.h264;*.hevc;*.m2ts;*.m4v;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.webm;*.wmv;*.ts;*.y4m;*.yuv|"
+ _("All Files") + " (*.*)|*.*");
auto filename = OpenFileSelector(_("Open video file"), "Path/Last/Video", "", "", str, c->parent);
auto filename = OpenFileSelector(_("Open Video File"), "Path/Last/Video", "", "", str, c->parent);
if (!filename.empty())
c->project->LoadVideo(filename);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ DialogExport::~DialogExport() {
void DialogExport::OnProcess(wxCommandEvent &) {
if (!d.TransferDataFromWindow()) return;

auto filename = SaveFileSelector(_("Export subtitles file"), "", "", "", SubtitleFormat::GetWildcards(1), &d);
auto filename = SaveFileSelector(_("Export Subtitles File"), "", "", "", SubtitleFormat::GetWildcards(1), &d);
if (filename.empty()) return;

for (size_t i = 0; i < filter_list->GetCount(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_fonts_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void DialogFontsCollector::OnBrowse(wxCommandEvent &) {
_("Select archive file name"),
dest_ctrl->GetValue(),
wxFileName(dest_ctrl->GetValue()).GetFullName(),
".zip", "Zip Archives (*.zip)|*.zip",
".zip", _("Zip Archives") + " (*.zip)|*.zip",
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/dialog_kara_timing_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class DialogKanjiTimer final : public wxDialog {
};

DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
: wxDialog(c->parent, -1, _("Kanji timing"))
: wxDialog(c->parent, -1, _("Kanji timer"))
, subs(c->ass.get())
{
SetIcons(GETICONS(kara_timing_copier));
Expand All @@ -405,7 +405,7 @@ DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
display = new KaraokeLineMatchDisplay(DisplayBox);

//Checkbox
Interpolate = new wxCheckBox(DisplayBox,-1,_("Attempt to &interpolate kanji."),wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT);
Interpolate = new wxCheckBox(DisplayBox,-1,_("Attempt to &interpolate kanji"),wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT);
Interpolate->SetValue(OPT_GET("Tool/Kanji Timer/Interpolation")->GetBool());

wxArrayString styles = to_wx(subs->GetStyles());
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_search_replace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void DialogSearchReplace<has_replace>::FindReplace(bool (SearchReplaceEngine::*f
((*c->search).*func)();
}
catch (std::exception const& e) {
wxMessageBox(to_wx(e.what()), "Error", wxOK | wxICON_ERROR | wxCENTER, this);
wxMessageBox(to_wx(e.what()), _("Error"), wxOK | wxICON_ERROR | wxCENTER, this);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/dialog_shift_times.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static wxString get_history_string(json::Object &obj) {

auto shift_amount = to_wx(obj["amount"]);
if (!obj["is by time"])
shift_amount = fmt_tl("%s frames", shift_amount);
shift_amount = fmt_plural(wxAtoi(shift_amount), "1 frame", "%s frames", shift_amount);

wxString shift_direction = obj["is backward"] ? _("backward") : _("forward");

Expand Down
2 changes: 1 addition & 1 deletion src/dialog_style_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void DialogStyleManager::OnCurrentDelete() {
}

void DialogStyleManager::OnCurrentImport() {
auto filename = OpenFileSelector(_("Open subtitles file"), "Path/Last/Subtitles", "", "", SubtitleFormat::GetWildcards(0), this);
auto filename = OpenFileSelector(_("Open Subtitles File"), "Path/Last/Subtitles", "", "", SubtitleFormat::GetWildcards(0), this);
if (filename.empty()) return;

std::string charset;
Expand Down
2 changes: 1 addition & 1 deletion src/dialog_video_details.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void ShowVideoDetailsDialog(agi::Context *c) {
make_field(_("File name:"), c->project->VideoName().wstring());
make_field(_("FPS:"), fmt_wx("%.3f", fps.FPS()));
make_field(_("Resolution:"), fmt_wx("%dx%d (%d:%d)", width, height, ar.numerator(), ar.denominator()));
make_field(_("Length:"), fmt_plural(framecount, "1 frame", "%d frames (%s)",
make_field(_("Length:"), fmt_plural(framecount, "%d frame (%s)", "%d frames (%s)",
framecount, agi::Time(fps.TimeAtFrame(framecount - 1)).GetAssFormatted(true)));
make_field(_("Decoder:"), to_wx(provider->GetDecoderName()));

Expand Down
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool AegisubApp::OnInit() {
config::opt->ConfigUser();
}
catch (agi::Exception const& err) {
wxMessageBox("Configuration file is invalid. Error reported:\n" + to_wx(err.GetMessage()), "Error");
wxMessageBox(fmt_tl("Configuration file is invalid. Error reported:\n%s", err.GetMessage()), _("Error"));
}

#ifdef _WIN32
Expand Down Expand Up @@ -291,7 +291,7 @@ bool AegisubApp::OnInit() {
config::opt->Flush();
}
catch (agi::fs::FileSystemError const& e) {
wxMessageBox(to_wx(e.GetMessage()), "Error saving config file", wxOK | wxICON_ERROR | wxCENTER);
wxMessageBox(to_wx(e.GetMessage()), _("Error saving config file"), wxOK | wxICON_ERROR | wxCENTER);
}
#endif
}
Expand All @@ -307,16 +307,16 @@ bool AegisubApp::OnInit() {
OpenFiles(wxArrayStringsAdapter(args.size() - 1, &args[1]));
}
catch (agi::Exception const& e) {
wxMessageBox(to_wx(e.GetMessage()), "Fatal error while initializing");
wxMessageBox(to_wx(e.GetMessage()), _("Fatal error while initializing"));
return false;
}
catch (std::exception const& e) {
wxMessageBox(to_wx(e.what()), "Fatal error while initializing");
wxMessageBox(to_wx(e.what()), _("Fatal error while initializing"));
return false;
}
#ifndef _DEBUG
catch (...) {
wxMessageBox("Unhandled exception","Fatal error while initializing");
wxMessageBox(_("Unhandled exception"), _("Fatal error while initializing"));
return false;
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/video_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "ass_file.h"
#include "audio_controller.h"
#include "compat.h"
#include "format.h"
#include "include/aegisub/context.h"
#include "options.h"
#include "project.h"
Expand Down Expand Up @@ -224,13 +225,12 @@ int VideoController::FrameAtTime(int time, agi::vfr::Time type) const {

void VideoController::OnVideoError(VideoProviderErrorEvent const& err) {
wxLogError(
"Failed seeking video. The video file may be corrupt or incomplete.\n"
"Error message reported: %s",
to_wx(err.GetMessage()));
fmt_tl("Failed seeking video. The video file may be corrupt or incomplete.\nError message reported: %s",
err.GetMessage()));
}

void VideoController::OnSubtitlesError(SubtitlesProviderErrorEvent const& err) {
wxLogError(
"Failed rendering subtitles. Error message reported: %s",
to_wx(err.GetMessage()));
fmt_tl("Failed rendering subtitles.\nError message reported: %s",
err.GetMessage()));
}
16 changes: 6 additions & 10 deletions src/video_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,15 @@ void VideoDisplay::Render() try {
}
catch (const VideoOutInitException& err) {
wxLogError(
"Failed to initialize video display. Closing other running "
"programs and updating your video card drivers may fix this.\n"
"Error message reported: %s",
err.GetMessage());
fmt_tl("Failed to initialize video display. Closing other running programs and updating your video card drivers may fix this.\nError message reported: %s",
err.GetMessage()));
con->project->CloseVideo();
return;
}
catch (const VideoOutRenderException& err) {
wxLogError(
"Could not upload video frame to graphics card.\n"
"Error message reported: %s",
err.GetMessage());
fmt_tl("Could not upload video frame to graphics card.\nError message reported: %s",
err.GetMessage()));
return;
}

Expand Down Expand Up @@ -253,9 +250,8 @@ void VideoDisplay::Render() try {
}
catch (const agi::Exception &err) {
wxLogError(
"An error occurred trying to render the video frame on the screen.\n"
"Error message reported: %s",
err.GetMessage());
fmt_tl("An error occurred trying to render the video frame on the screen.\nError message reported: %s",
err.GetMessage()));
con->project->CloseVideo();
}

Expand Down
Loading