Skip to content
216 changes: 170 additions & 46 deletions po/aegisub.pot

Large diffs are not rendered by default.

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
2 changes: 1 addition & 1 deletion 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(_("Open audio file"), "Path/Last/Audio", "", "", str, c->parent);
if (!filename.empty())
c->project->LoadAudio(filename);
}
Expand Down
2 changes: 1 addition & 1 deletion src/command/keyframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/command/subtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(_("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(_("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/dialog_fonts_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,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 @@ -382,7 +382,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 @@ -399,7 +399,7 @@ DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
display = new KaraokeLineMatchDisplay(this);

//Checkbox
Interpolate = new wxCheckBox(this,-1,_("Attempt to &interpolate kanji."),wxDefaultPosition,wxDefaultSize,wxALIGN_LEFT);
Interpolate = new wxCheckBox(this,-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 @@ -92,7 +92,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_video_details.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,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, "1 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 @@ -191,7 +191,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 @@ -288,7 +288,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 @@ -304,16 +304,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. Error 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 @@ -190,18 +190,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 @@ -245,9 +242,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