Skip to content

Commit

Permalink
src:Add translations for "Save File" in ImgExport.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <[email protected]>
  • Loading branch information
QQxiaoming committed Nov 7, 2023
1 parent 913710c commit 051fede
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
11 changes: 11 additions & 0 deletions lang/yuvviewer_en_US.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>ImgExport</name>
<message>
<location filename="../src/ImgExport.cpp" line="130"/>
<location filename="../src/ImgExport.cpp" line="138"/>
<location filename="../src/ImgExport.cpp" line="243"/>
<location filename="../src/ImgExport.cpp" line="292"/>
<source>Save File</source>
<translation></translation>
</message>
</context>
<context>
<name>ImgExportWindow</name>
<message>
Expand Down
11 changes: 11 additions & 0 deletions lang/yuvviewer_ja_JP.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
<name>ImgExport</name>
<message>
<location filename="../src/ImgExport.cpp" line="130"/>
<location filename="../src/ImgExport.cpp" line="138"/>
<location filename="../src/ImgExport.cpp" line="243"/>
<location filename="../src/ImgExport.cpp" line="292"/>
<source>Save File</source>
<translation>ファイルを保存する</translation>
</message>
</context>
<context>
<name>ImgExportWindow</name>
<message>
Expand Down
11 changes: 11 additions & 0 deletions lang/yuvviewer_zh_CN.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>ImgExport</name>
<message>
<location filename="../src/ImgExport.cpp" line="130"/>
<location filename="../src/ImgExport.cpp" line="138"/>
<location filename="../src/ImgExport.cpp" line="243"/>
<location filename="../src/ImgExport.cpp" line="292"/>
<source>Save File</source>
<translation>保存文件</translation>
</message>
</context>
<context>
<name>ImgExportWindow</name>
<message>
Expand Down
8 changes: 4 additions & 4 deletions src/ImgExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ void ImgExport::buttonBoxRejected(void)

void ImgExport::export_png(QImage *Img, const QString &name)
{
QString savefile_name = FileDialog::getSaveFileName(this, "保存文件", name + "-png" + ".png", "Image files(*.png)");
QString savefile_name = FileDialog::getSaveFileName(this, tr("Save File"), name + "-png" + ".png", "Image files(*.png)");
if(savefile_name != nullptr) {
Img->save(savefile_name);
}
}

void ImgExport::export_yuv(QImage *Img, const QString &sequence, const QString &name)
{
QString savefile_name = FileDialog::getSaveFileName(this, "保存文件", name + "-" + sequence + ".yuv", "YUV files(*.yuv)");
QString savefile_name = FileDialog::getSaveFileName(this, tr("Save File"), name + "-" + sequence + ".yuv", "YUV files(*.yuv)");
if(savefile_name != nullptr) {
QFile save(savefile_name);
if (save.open(QIODevice::WriteOnly)) {
Expand Down Expand Up @@ -240,7 +240,7 @@ void ImgExport::export_yuv(QImage *Img, const QString &sequence, const QString &

void ImgExport::export_rgb(QImage *Img, const QString &sequence, const QString &name)
{
QString savefile_name = FileDialog::getSaveFileName(this, "保存文件", name + "-" + sequence + ".data", "Data files(*.data)");
QString savefile_name = FileDialog::getSaveFileName(this, tr("Save File"), name + "-" + sequence + ".data", "Data files(*.data)");
if(savefile_name != nullptr) {
QFile save(savefile_name);
if (save.open(QIODevice::WriteOnly)) {
Expand Down Expand Up @@ -289,7 +289,7 @@ void ImgExport::export_bayer(QImage *Img, const QString &sequence,int bit, const
QMessageBox::warning(this, "Warning",
"导出此格式将通过模拟抽样的方式,图像信息将会出现损失!",
QMessageBox::StandardButtons(QMessageBox::Ok));
QString savefile_name = FileDialog::getSaveFileName(this, "保存文件", name + "-bayer" + sequence + QString::number(bit) +".raw", "RAW files(*.raw)");
QString savefile_name = FileDialog::getSaveFileName(this, tr("Save File"), name + "-bayer" + sequence + QString::number(bit) +".raw", "RAW files(*.raw)");
if(savefile_name != nullptr) {
QFile save(savefile_name);
if (save.open(QIODevice::WriteOnly)) {
Expand Down

0 comments on commit 051fede

Please sign in to comment.