Commit 9ffc57b2 authored by David Redondo's avatar David Redondo 🏎 Committed by Nate Graham

Change i18n of filename formatting options

Summary: Change to use ki18n to avoid duplicated context. After a suggestion in D19914#435402.

Reviewers: #spectacle, aspotashev, #localization, aacid, ngraham

Reviewed By: #spectacle, aspotashev, ngraham

Subscribers: #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D19968
parent 80c54ab1
......@@ -32,7 +32,6 @@
#include <QRegularExpression>
#include <QRegularExpressionMatch>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KIO/ListJob>
......@@ -519,35 +518,35 @@ void ExportManager::doPrint(QPrinter *printer)
return;
}
const QMap<QString, const char*> ExportManager::filenamePlaceholders {
{QStringLiteral("%Y"), I18N_NOOP2(
const QMap<QString, KLocalizedString> ExportManager::filenamePlaceholders {
{QStringLiteral("%Y"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Year (4 digit)")},
{QStringLiteral("%y"), I18N_NOOP2(
{QStringLiteral("%y"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Year (2 digit)")},
{QStringLiteral("%M"), I18N_NOOP2(
{QStringLiteral("%M"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Month")},
{QStringLiteral("%D"), I18N_NOOP2(
{QStringLiteral("%D"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Day")},
{QStringLiteral("%H"), I18N_NOOP2(
{QStringLiteral("%H"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Hour")},
{QStringLiteral("%m"), I18N_NOOP2(
{QStringLiteral("%m"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Minute")},
{QStringLiteral("%S"), I18N_NOOP2(
{QStringLiteral("%S"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Second")},
{QStringLiteral("%T"), I18N_NOOP2(
{QStringLiteral("%T"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Window Title")},
{QStringLiteral("%d"), I18N_NOOP2(
{QStringLiteral("%d"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Sequential numbering")},
{QStringLiteral("%Nd"), I18N_NOOP2(
{QStringLiteral("%Nd"), ki18nc(
"A placeholder in the user configurable filename will replaced by the specified value",
"Sequential numbering, padded out to N digits")},
};
......@@ -28,6 +28,8 @@
#include <QDateTime>
#include <QUrl>
#include <KLocalizedString>
#include "PlatformBackends/ImageGrabber.h"
class QTemporaryDir;
......@@ -69,7 +71,7 @@ class ExportManager : public QObject
void setGrabMode(const ImageGrabber::GrabMode &grabMode);
QString formatFilename(const QString &nameTemplate);
static const QMap<QString, const char*> filenamePlaceholders;
static const QMap<QString, KLocalizedString> filenamePlaceholders;
Q_SIGNALS:
......
......@@ -131,9 +131,8 @@ SaveOptionsPage::SaveOptionsPage(QWidget *parent) :
);
for (auto option = ExportManager::filenamePlaceholders.cbegin();
option != ExportManager::filenamePlaceholders.cend(); ++option) {
helpText += QStringLiteral("<a href=%1>%1</a>: %2<br>").arg(
option.key(),
i18nc("A placeholder in the user configurable filename will replaced by the specified value", option.value()));
helpText += QStringLiteral("<a href=%1>%1</a>: %2<br>").arg(option.key(),
option.value().toString());
}
helpText += QStringLiteral("<a href='/'>/</a>: ") + i18n("To save to a sub-folder");
helpText += QStringLiteral("</blockquote>");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment