Skip to content
Permalink
Browse files

Set correct translation context for classes without qobjec #186

  • Loading branch information...
DamirPorobic committed Sep 8, 2019
1 parent d94848a commit c2c69c615953f5153215934589ed6e5109e9ef95
@@ -40,7 +40,7 @@ void AddWatermarkOperation::execute()

void AddWatermarkOperation::NotifyAboutMissingWatermarkImage() const
{
MessageBoxHelper::ok(QObject::tr("Watermark Image Required"), QObject::tr("Please add a Watermark Image via Options > Settings > Annotator > Update"));
MessageBoxHelper::ok(QCoreApplication::translate("AddWatermarkOperation", "Watermark Image Required"), QCoreApplication::translate("AddWatermarkOperation", "Please add a Watermark Image via Options > Settings > Annotator > Update"));
}

QPointF AddWatermarkOperation::getPositionForWatermark(const QPixmap &image, const QSize &availableSpace) const
@@ -20,6 +20,8 @@
#ifndef KSNIP_ADDWATERMARKOPERATION_H
#define KSNIP_ADDWATERMARKOPERATION_H

#include <QCoreApplication>

#include <random>

#include <kImageAnnotator/KImageAnnotator.h>
@@ -31,8 +31,8 @@ bool SaveAsOperation::execute()
{
auto path = mSavePathProvider.savePath();

auto title = QObject::tr("Save As");
auto filter = QObject::tr("Images") + QStringLiteral(" (*.png *.gif *.jpg);;") + QObject::tr("All Files") + QStringLiteral("(*)");
auto title = QCoreApplication::translate("SaveAsOperation", "Save As");
auto filter = QCoreApplication::translate("SaveAsOperation", "Images") + QStringLiteral(" (*.png *.gif *.jpg);;") + QCoreApplication::translate("SaveAsOperation", "All Files") + QStringLiteral("(*)");
QFileDialog saveDialog(mParent, title, path, filter);
saveDialog.setAcceptMode(QFileDialog::AcceptSave);

@@ -20,6 +20,8 @@
#ifndef KSNIP_SAVEASOPERATION_H
#define KSNIP_SAVEASOPERATION_H

#include <QCoreApplication>

#include "src/backend/config/KsnipConfig.h"
#include "src/backend/config/SavePathProvider.h"
#include "src/backend/ImageSaver.h"
@@ -26,8 +26,8 @@ UpdateWatermarkOperation::UpdateWatermarkOperation(QWidget *parent)

bool UpdateWatermarkOperation::execute()
{
auto title = QObject::tr("Select Image");
auto filter = QObject::tr("Images") + QStringLiteral(" (*.png *.gif *.jpg);;") + QObject::tr("All Files") + QStringLiteral("(*)");
auto title = QCoreApplication::translate("UpdateWatermarkOperation", "Select Image");
auto filter = QCoreApplication::translate("UpdateWatermarkOperation", "Images") + QStringLiteral(" (*.png *.gif *.jpg);;") + QCoreApplication::translate("UpdateWatermarkOperation", "All Files") + QStringLiteral("(*)");
QFileDialog dialog(mParent, title, QString(), filter);
dialog.setAcceptMode(QFileDialog::AcceptOpen);

@@ -20,6 +20,7 @@
#ifndef KSNIP_UPDATEWATERMARKOPERATION_H
#define KSNIP_UPDATEWATERMARKOPERATION_H

#include <QCoreApplication>
#include <QFileDialog>

#include "src/backend/WatermarkImageLoader.h"
@@ -81,6 +81,17 @@
<translation>Polnische Übersetzung</translation>
</message>
</context>
<context>
<name>AddWatermarkOperation</name>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AnnotationSettings</name>
<message>
@@ -633,10 +644,10 @@ Möchten Sie sie speichern?</translation>
</message>
</context>
<context>
<name>QObject</name>
<name>SaveAsOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
<source>Save As</source>
<translation type="unfinished">Speichern als</translation>
</message>
<message>
<source>Images</source>
@@ -646,18 +657,6 @@ Möchten Sie sie speichern?</translation>
<source>All Files</source>
<translation type="unfinished">Alle Dateien</translation>
</message>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save As</source>
<translation type="unfinished">Speichern als</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
@@ -690,4 +689,19 @@ Möchten Sie sie speichern?</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateWatermarkOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Images</source>
<translation type="unfinished">Bilder</translation>
</message>
<message>
<source>All Files</source>
<translation type="unfinished">Alle Dateien</translation>
</message>
</context>
</TS>
@@ -80,6 +80,17 @@
<translation>Traducción polaca</translation>
</message>
</context>
<context>
<name>AddWatermarkOperation</name>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AnnotationSettings</name>
<message>
@@ -629,10 +640,10 @@ Desea guardarla?</translation>
</message>
</context>
<context>
<name>QObject</name>
<name>SaveAsOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
<source>Save As</source>
<translation type="unfinished">Salvar como</translation>
</message>
<message>
<source>Images</source>
@@ -642,18 +653,6 @@ Desea guardarla?</translation>
<source>All Files</source>
<translation type="unfinished">Todos los archivos</translation>
</message>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save As</source>
<translation type="unfinished">Salvar como</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
@@ -686,4 +685,19 @@ Desea guardarla?</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateWatermarkOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Images</source>
<translation type="unfinished">Imágenes</translation>
</message>
<message>
<source>All Files</source>
<translation type="unfinished">Todos los archivos</translation>
</message>
</context>
</TS>
@@ -80,6 +80,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddWatermarkOperation</name>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AnnotationSettings</name>
<message>
@@ -614,10 +625,10 @@ Voulez-vous l&apos;enregistrer ?</translation>
</message>
</context>
<context>
<name>QObject</name>
<name>SaveAsOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
<source>Save As</source>
<translation type="unfinished">Enregistrer sous</translation>
</message>
<message>
<source>Images</source>
@@ -627,18 +638,6 @@ Voulez-vous l&apos;enregistrer ?</translation>
<source>All Files</source>
<translation type="unfinished">Tous les fichiers</translation>
</message>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save As</source>
<translation type="unfinished">Enregistrer sous</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
@@ -671,4 +670,19 @@ Voulez-vous l&apos;enregistrer ?</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateWatermarkOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Images</source>
<translation type="unfinished">Image</translation>
</message>
<message>
<source>All Files</source>
<translation type="unfinished">Tous les fichiers</translation>
</message>
</context>
</TS>
@@ -80,6 +80,17 @@
<translation>Tradución ao polaco</translation>
</message>
</context>
<context>
<name>AddWatermarkOperation</name>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AnnotationSettings</name>
<message>
@@ -620,10 +631,10 @@ Quere gardala?</translation>
</message>
</context>
<context>
<name>QObject</name>
<name>SaveAsOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
<source>Save As</source>
<translation type="unfinished">Gardar como</translation>
</message>
<message>
<source>Images</source>
@@ -633,18 +644,6 @@ Quere gardala?</translation>
<source>All Files</source>
<translation type="unfinished">Todos os ficheiros</translation>
</message>
<message>
<source>Watermark Image Required</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please add a Watermark Image via Options &gt; Settings &gt; Annotator &gt; Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save As</source>
<translation type="unfinished">Gardar como</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
@@ -677,4 +676,19 @@ Quere gardala?</translation>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateWatermarkOperation</name>
<message>
<source>Select Image</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Images</source>
<translation type="unfinished">Imaxes</translation>
</message>
<message>
<source>All Files</source>
<translation type="unfinished">Todos os ficheiros</translation>
</message>
</context>
</TS>

0 comments on commit c2c69c6

Please sign in to comment.
You can’t perform that action at this time.