Add English and Russian ChatGUI interface translations
This commit is contained in:
1 parent
972c6b7f0a
commit
27d93ecaf9
50 files changed
+4978
-491
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include <QCoreApplication>
|
||||
#include "videoplayer_engine.h"
|
||||
#include "sound_manager.h"
|
||||
#include "../../lib/debug_config.h"
|
||||
@@ -74,10 +75,10 @@ void Worker::run() {
|
||||
};
|
||||
|
||||
if (avformat_open_input(&fmt, path.toUtf8().constData(), nullptr, nullptr) != 0) {
|
||||
worker_fail(this, QString("cannot open: %1").arg(path)); return;
|
||||
worker_fail(this, QCoreApplication::translate("ChatGui", "cannot open: %1").arg(path)); return;
|
||||
}
|
||||
if (avformat_find_stream_info(fmt, nullptr) < 0) {
|
||||
worker_fail(this, QString("no stream info: %1").arg(path)); cleanup(); return;
|
||||
worker_fail(this, QCoreApplication::translate("ChatGui", "no stream info: %1").arg(path)); cleanup(); return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < fmt->nb_streams; i++) {
|
||||
@@ -85,7 +86,7 @@ void Worker::run() {
|
||||
if (p->codec_type == AVMEDIA_TYPE_VIDEO && vidx < 0) vidx = (int)i;
|
||||
else if (p->codec_type == AVMEDIA_TYPE_AUDIO && aidx < 0) aidx = (int)i;
|
||||
}
|
||||
if (vidx < 0) { worker_fail(this, QString("no video stream: %1").arg(path)); cleanup(); return; }
|
||||
if (vidx < 0) { worker_fail(this, QCoreApplication::translate("ChatGui", "no video stream: %1").arg(path)); cleanup(); return; }
|
||||
|
||||
AVStream* vst = fmt->streams[vidx];
|
||||
int vw = vst->codecpar->width, vh = vst->codecpar->height;
|
||||
@@ -131,7 +132,7 @@ void Worker::run() {
|
||||
if (aidx >= 0) {
|
||||
aframe = av_frame_alloc();
|
||||
pkt = av_packet_alloc();
|
||||
if (!aframe || !pkt) { worker_fail(this, "alloc failed"); cleanup(); return; }
|
||||
if (!aframe || !pkt) { worker_fail(this, QCoreApplication::translate("ChatGui", "alloc failed")); cleanup(); return; }
|
||||
|
||||
while (av_read_frame(fmt, pkt) >= 0) {
|
||||
if (abort->loadRelaxed()) { av_packet_unref(pkt); cleanup(); return; }
|
||||
@@ -175,11 +176,11 @@ void Worker::run() {
|
||||
vdec = avcodec_alloc_context3(vc);
|
||||
if (!vc || !vdec || avcodec_parameters_to_context(vdec, vst->codecpar) < 0 ||
|
||||
avcodec_open2(vdec, vc, nullptr) < 0) {
|
||||
worker_fail(this, "video decoder open failed"); cleanup(); return;
|
||||
worker_fail(this, QCoreApplication::translate("ChatGui", "video decoder open failed")); cleanup(); return;
|
||||
}
|
||||
frame = av_frame_alloc();
|
||||
pkt = av_packet_alloc();
|
||||
if (!frame || !pkt) { worker_fail(this, "alloc failed"); cleanup(); return; }
|
||||
if (!frame || !pkt) { worker_fail(this, QCoreApplication::translate("ChatGui", "alloc failed")); cleanup(); return; }
|
||||
/* YUVJ* (deprecated full-range) → обычный формат + явный range, чтобы
|
||||
* не ловить warning swscaler и не искажать цвета */
|
||||
AVPixelFormat srcFmt = vdec->pix_fmt;
|
||||
@@ -192,7 +193,7 @@ void Worker::run() {
|
||||
}
|
||||
sws = sws_getContext(vw, vh, srcFmt, vw, vh, AV_PIX_FMT_RGB24,
|
||||
SWS_BILINEAR, nullptr, nullptr, nullptr);
|
||||
if (!sws) { worker_fail(this, "sws init failed"); cleanup(); return; }
|
||||
if (!sws) { worker_fail(this, QCoreApplication::translate("ChatGui", "sws init failed")); cleanup(); return; }
|
||||
int *invTbl = nullptr, *tbl = nullptr, sr = 0, dr = 0, br = 0, ct = 0, st = 0;
|
||||
if (sws_getColorspaceDetails(sws, &invTbl, &sr, &tbl, &dr, &br, &ct, &st) >= 0)
|
||||
sws_setColorspaceDetails(sws, invTbl, srcRange, tbl, 1 /* RGB full-range */, br, ct, st);
|
||||
@@ -252,7 +253,7 @@ void Worker::run() {
|
||||
|
||||
void Worker::run() {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_VIDEO, "VideoEngine: built without FFmpeg");
|
||||
emit error(QStringLiteral("видео недоступно (сборка без FFmpeg)"));
|
||||
emit error(QCoreApplication::translate("ChatGui", "video unavailable (built without FFmpeg)"));
|
||||
}
|
||||
|
||||
#endif /* HAVE_FFMPEG */
|
||||
|
||||
Reference in new issue
Block a user