translation
This commit is contained in:
+18
-18
@@ -49,7 +49,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx,
|
||||
ret = avcodec_send_frame(codec_ctx, frame);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Failed to send frame to encoder." << ret;
|
||||
ed->export_error = "failed to send frame to encoder (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("failed to send frame to encoder (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx,
|
||||
} else if (ret < 0) {
|
||||
if (ret != AVERROR_EOF) {
|
||||
qCritical() << "Failed to receive packet from encoder." << ret;
|
||||
ed->export_error = "failed to receive packet from encoder (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("failed to receive packet from encoder (%1)").arg(QString::number(ret));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ bool ExportThread::setupVideo() {
|
||||
vcodec = avcodec_find_encoder((enum AVCodecID) video_codec);
|
||||
if (!vcodec) {
|
||||
qCritical() << "Could not find video encoder";
|
||||
ed->export_error = "could not video encoder for " + QString::number(video_codec);
|
||||
ed->export_error = tr("could not video encoder for %1").arg(QString::number(video_codec));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ bool ExportThread::setupVideo() {
|
||||
video_stream->id = 0;
|
||||
if (!video_stream) {
|
||||
qCritical() << "Could not allocate video stream";
|
||||
ed->export_error = "could not allocate video stream";
|
||||
ed->export_error = tr("could not allocate video stream");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bool ExportThread::setupVideo() {
|
||||
vcodec_ctx = avcodec_alloc_context3(vcodec);
|
||||
if (!vcodec_ctx) {
|
||||
qCritical() << "Could not allocate video encoding context";
|
||||
ed->export_error = "could not allocate video encoding context";
|
||||
ed->export_error = tr("could not allocate video encoding context");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ bool ExportThread::setupVideo() {
|
||||
ret = avcodec_open2(vcodec_ctx, vcodec, NULL);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not open output video encoder." << ret;
|
||||
ed->export_error = "could not open output video encoder (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not open output video encoder (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ bool ExportThread::setupVideo() {
|
||||
ret = avcodec_parameters_from_context(video_stream->codecpar, vcodec_ctx);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not copy video encoder parameters to output stream." << ret;
|
||||
ed->export_error = "could not copy video encoder parameters to output stream (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not copy video encoder parameters to output stream (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ bool ExportThread::setupAudio() {
|
||||
acodec = avcodec_find_encoder(static_cast<AVCodecID>(audio_codec));
|
||||
if (!acodec) {
|
||||
qCritical() << "Could not find audio encoder";
|
||||
ed->export_error = "could not audio encoder for " + QString::number(audio_codec);
|
||||
ed->export_error = tr("could not audio encoder for %1").arg(QString::number(audio_codec));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ bool ExportThread::setupAudio() {
|
||||
audio_stream->id = 1;
|
||||
if (!audio_stream) {
|
||||
qCritical() << "Could not allocate audio stream";
|
||||
ed->export_error = "could not allocate audio stream";
|
||||
ed->export_error = tr("could not allocate audio stream");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ bool ExportThread::setupAudio() {
|
||||
acodec_ctx = avcodec_alloc_context3(acodec);
|
||||
if (!acodec_ctx) {
|
||||
qCritical() << "Could not find allocate audio encoding context";
|
||||
ed->export_error = "could not allocate audio encoding context";
|
||||
ed->export_error = tr("could not allocate audio encoding context");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ bool ExportThread::setupAudio() {
|
||||
ret = avcodec_open2(acodec_ctx, acodec, NULL);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not open output audio encoder." << ret;
|
||||
ed->export_error = "could not open output audio encoder (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not open output audio encoder (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ bool ExportThread::setupAudio() {
|
||||
ret = avcodec_parameters_from_context(audio_stream->codecpar, acodec_ctx);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not copy audio encoder parameters to output stream." << ret;
|
||||
ed->export_error = "could not copy audio encoder parameters to output stream (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not copy audio encoder parameters to output stream (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ bool ExportThread::setupAudio() {
|
||||
ret = av_frame_get_buffer(audio_frame, 0);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not allocate audio buffer." << ret;
|
||||
ed->export_error = "could not allocate audio buffer (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not allocate audio buffer (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
aframe_bytes = av_samples_get_buffer_size(NULL, audio_frame->channels, audio_frame->nb_samples, static_cast<AVSampleFormat>(audio_frame->format), 0);
|
||||
@@ -291,7 +291,7 @@ bool ExportThread::setupContainer() {
|
||||
avformat_alloc_output_context2(&fmt_ctx, NULL, NULL, c_filename);
|
||||
if (!fmt_ctx) {
|
||||
qCritical() << "Could not create output context";
|
||||
ed->export_error = "could not create output format context";
|
||||
ed->export_error = tr("could not create output format context");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ bool ExportThread::setupContainer() {
|
||||
ret = avio_open(&fmt_ctx->pb, c_filename, AVIO_FLAG_WRITE);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not open output file." << ret;
|
||||
ed->export_error = "could not open output file (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not open output file (%1)").arg(QString::number(ret));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ void ExportThread::run() {
|
||||
|
||||
if (!panel_sequence_viewer->viewer_widget->context()->makeCurrent(&surface)) {
|
||||
qCritical() << "Make current failed";
|
||||
ed->export_error = "could not make OpenGL context current";
|
||||
ed->export_error = tr("could not make OpenGL context current");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ void ExportThread::run() {
|
||||
ret = avformat_write_header(fmt_ctx, NULL);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not write output file header." << ret;
|
||||
ed->export_error = "could not write output file header (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not write output file header (%1)").arg(QString::number(ret));
|
||||
continueEncode = false;
|
||||
}
|
||||
}
|
||||
@@ -440,7 +440,7 @@ void ExportThread::run() {
|
||||
ret = av_write_trailer(fmt_ctx);
|
||||
if (ret < 0) {
|
||||
qCritical() << "Could not write output file trailer." << ret;
|
||||
ed->export_error = "could not write output file trailer (" + QString::number(ret) + ")";
|
||||
ed->export_error = tr("could not write output file trailer (%1)").arg(QString::number(ret));
|
||||
continueEncode = false;
|
||||
}
|
||||
|
||||
|
||||
+20
-5
@@ -153,7 +153,12 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
if (type == LOAD_TYPE_VERSION) {
|
||||
int proj_version = stream.readElementText().toInt();
|
||||
if (proj_version < MIN_SAVE_VERSION && proj_version > SAVE_VERSION) {
|
||||
if (QMessageBox::warning(mainWindow, "Version Mismatch", "This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
|
||||
if (QMessageBox::warning(
|
||||
mainWindow,
|
||||
tr("Version Mismatch"),
|
||||
tr("This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?"),
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::No) == QMessageBox::No) {
|
||||
show_err = false;
|
||||
return false;
|
||||
}
|
||||
@@ -435,7 +440,11 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
if (!found) {
|
||||
correct_clip->linked.removeAt(j);
|
||||
j--;
|
||||
if (QMessageBox::warning(mainWindow, "Invalid Clip Link", "This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
|
||||
if (QMessageBox::warning(mainWindow,
|
||||
tr("Invalid Clip Link"),
|
||||
tr("This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?"),
|
||||
QMessageBox::Yes,
|
||||
QMessageBox::No) == QMessageBox::No) {
|
||||
delete s;
|
||||
return false;
|
||||
}
|
||||
@@ -584,7 +593,7 @@ void LoadThread::run() {
|
||||
xml_error = false;
|
||||
if (show_err) emit error();
|
||||
} else if (stream.hasError()) {
|
||||
error_str = stream.errorString() + " - Line: " + QString::number(stream.lineNumber()) + " Col:" + QString::number(stream.columnNumber());
|
||||
error_str = tr("%1 - Line: %2 Col: %3").arg(stream.errorString(), QString::number(stream.lineNumber()), QString::number(stream.columnNumber()));
|
||||
xml_error = true;
|
||||
emit error();
|
||||
cont = false;
|
||||
@@ -624,9 +633,15 @@ void LoadThread::cancel() {
|
||||
void LoadThread::error_func() {
|
||||
if (xml_error) {
|
||||
qCritical() << "Error parsing XML." << error_str;
|
||||
QMessageBox::critical(mainWindow, "XML Parsing Error", "Couldn't load '" + project_url + "'. " + error_str, QMessageBox::Ok);
|
||||
QMessageBox::critical(mainWindow,
|
||||
tr("XML Parsing Error"),
|
||||
tr("Couldn't load '%1'. %2").arg(project_url, error_str),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
QMessageBox::critical(mainWindow, "Project Load Error", "Error loading project: " + error_str, QMessageBox::Ok);
|
||||
QMessageBox::critical(mainWindow,
|
||||
tr("Project Load Error"),
|
||||
tr("Error loading project: %1").arg(error_str),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -435,14 +435,14 @@ void PreviewGenerator::run() {
|
||||
if(errCode != 0) {
|
||||
char err[1024];
|
||||
av_strerror(errCode, err, 1024);
|
||||
errorStr = "Could not open file - " + QString(err);
|
||||
errorStr = tr("Could not open file - %1").arg(err);
|
||||
error = true;
|
||||
} else {
|
||||
errCode = avformat_find_stream_info(fmt_ctx, NULL);
|
||||
if (errCode < 0) {
|
||||
char err[1024];
|
||||
av_strerror(errCode, err, 1024);
|
||||
errorStr = "Could not find stream information - " + QString(err);
|
||||
errorStr = tr("Could not find stream information - %1").arg(err);
|
||||
error = true;
|
||||
} else {
|
||||
av_dump_format(fmt_ctx, 0, filename, 0);
|
||||
|
||||
Reference in New Issue
Block a user