Commit bec5a03c authored by David Jarvie's avatar David Jarvie
Browse files

Add context to i18n strings

parent 2c2bb730
......@@ -94,10 +94,10 @@ void CalendarUpdater::setCompleted()
QString CalendarUpdater::conversionPrompt(const QString& calendarName, const QString& calendarVersion, bool whole)
{
const QString msg = whole
? xi18n("Calendar <resource>%1</resource> is in an old format (<application>KAlarm</application> version %2), "
? xi18nc("@info", "Calendar <resource>%1</resource> is in an old format (<application>KAlarm</application> version %2), "
"and will be read-only unless you choose to update it to the current format.",
calendarName, calendarVersion)
: xi18n("Some or all of the alarms in calendar <resource>%1</resource> are in an old <application>KAlarm</application> format, "
: xi18nc("@info", "Some or all of the alarms in calendar <resource>%1</resource> are in an old <application>KAlarm</application> format, "
"and will be read-only unless you choose to update them to the current format.",
calendarName);
return xi18nc("@info", "<para>%1</para><para>"
......
......@@ -79,24 +79,6 @@ public:
static AlarmListModel* allAlarmListModel();
static TemplateListModel* createTemplateListModel(QObject* parent);
static TemplateListModel* allTemplateListModel();
#if 0
static QSize iconSize() { return mIconSize; }
/** Return a bulleted list of alarm types for inclusion in an i18n message. */
static QString typeListForDisplay(CalEvent::Types);
/** Get the tooltip for a resource. The resource's enabled status is
* evaluated for specified alarm types. */
QString tooltip(const Resource&, CalEvent::Types) const;
/** Return the read-only status tooltip for a resource.
* A null string is returned if the resource is fully writable. */
static QString readOnlyTooltip(const Resource&);
/** Return offset to add to headerData() role, for item models. */
virtual int headerDataEventRoleOffset() const { return 0; }
#endif
};
#endif // DATAMODEL_H
......
......@@ -44,19 +44,19 @@ DirResourceImportDialog::DirResourceImportDialog(const QString& dirResourceName,
: KAssistantDialog(parent)
, mAlarmTypes(types)
{
setWindowTitle(i18n("Import Directory Resource"));
setWindowTitle(i18nc("@title:window", "Import Directory Resource"));
// Remove Help button
buttonBox()->removeButton(button(QDialogButtonBox::Help));
mPageIntro = new DirResourceImportIntroWidget(dirResourceName, dirResourcePath, types, this);
addPage(mPageIntro, i18n("Import Calendar Directory Resource"));
addPage(mPageIntro, i18nc("@title:tab", "Import Calendar Directory Resource"));
mAlarmTypeCount = 0;
if (mAlarmTypes & CalEvent::ACTIVE)
{
++mAlarmTypeCount;
mPageActive = new DirResourceImportTypeWidget(CalEvent::ACTIVE, this);
addPage(mPageActive, i18n("Import Active Alarms"));
addPage(mPageActive, i18nc("@title:tab", "Import Active Alarms"));
connect(mPageActive, &DirResourceImportTypeWidget::status, this, &DirResourceImportDialog::typeStatusChanged);
mLastPage = mPageActive;
}
......@@ -65,7 +65,7 @@ DirResourceImportDialog::DirResourceImportDialog(const QString& dirResourceName,
{
++mAlarmTypeCount;
mPageArchived = new DirResourceImportTypeWidget(CalEvent::ARCHIVED, this);
addPage(mPageArchived, i18n("Import Archived Alarms"));
addPage(mPageArchived, i18nc("@title:tab", "Import Archived Alarms"));
connect(mPageArchived, &DirResourceImportTypeWidget::status, this, &DirResourceImportDialog::typeStatusChanged);
mLastPage = mPageArchived;
}
......@@ -74,7 +74,7 @@ DirResourceImportDialog::DirResourceImportDialog(const QString& dirResourceName,
{
++mAlarmTypeCount;
mPageTemplate = new DirResourceImportTypeWidget(CalEvent::TEMPLATE, this);
addPage(mPageTemplate, i18n("Import Alarm Templates"));
addPage(mPageTemplate, i18nc("@title:tab", "Import Alarm Templates"));
connect(mPageTemplate, &DirResourceImportTypeWidget::status, this, &DirResourceImportDialog::typeStatusChanged);
mLastPage = mPageTemplate;
}
......@@ -201,11 +201,11 @@ DirResourceImportIntroWidget::DirResourceImportIntroWidget(const QString& dirRes
QStringList typeNames;
if (types & CalEvent::ACTIVE)
typeNames += i18n("Active alarms");
typeNames += i18nc("@item:intext", "Active alarms");
if (types & CalEvent::ARCHIVED)
typeNames += i18n("Archived alarms");
typeNames += i18nc("@item:intext", "Archived alarms");
if (types & CalEvent::TEMPLATE)
typeNames += i18n("Alarm templates");
typeNames += i18nc("@item:intext", "Alarm templates");
mUi->dirTypesLabel->setText(typeNames.join(QStringLiteral(", ")));
if (typeNames.size() > 1)
......@@ -261,7 +261,7 @@ DirResourceImportTypeWidget::DirResourceImportTypeWidget(CalEvent::Type alarmTyp
connect(mUi->optionGroup, QOverload<int, bool>::of(&QButtonGroup::buttonToggled), this, &DirResourceImportTypeWidget::importTypeSelected);
mUi->pathRequester->setMode(KFile::File);
mUi->pathRequester->setFilter(QStringLiteral("*.ics|%1").arg(i18nc("@info", "Calendar Files")));
mUi->pathRequester->setFilter(QStringLiteral("*.ics|%1").arg(i18nc("@item:inlistbox", "Calendar Files")));
mUi->statusLabel->setText(QString());
mUi->pathRequester->setFocus();
mUi->pathRequester->installEventFilter(this);
......@@ -480,9 +480,9 @@ void DirResourceImportTypeWidget::slotStatJobResult(KJob* job)
{
KFileItem fi(statJob->statResult(), KIO::upUrl(mUi->pathRequester->url()));
if (!fi.isDir())
setStatus(false, i18nc("@info:status", "Error! Cannot create file (directory does not exist)."));
setStatus(false, i18nc("@info", "Error! Cannot create file (directory does not exist)."));
else if (!fi.isWritable())
setStatus(false, i18nc("@info:status", "Error! Cannot create file (directory is not writable)."));
setStatus(false, i18nc("@info", "Error! Cannot create file (directory is not writable)."));
else
setStatus(true);
}
......
......@@ -9,7 +9,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>KAlarm no longer supports calendar directory resources. In order to continue using the contents of the directory resource below, you must import it into a KAlarm calendar file resource.</string>
<string comment="@info">KAlarm no longer supports calendar directory resources. In order to continue using the contents of the directory resource below, you must import it into a KAlarm calendar file resource.</string>
</property>
</widget>
</item>
......@@ -19,14 +19,14 @@
<bool>true</bool>
</property>
<property name="text">
<string>KAlarm no longer supports calendar directory resources. In order to continue using the contents of the directory resource below, you must import each of its alarm types into separate KAlarm calendar file resources.</string>
<string comment="@info">KAlarm no longer supports calendar directory resources. In order to continue using the contents of the directory resource below, you must import each of its alarm types into separate KAlarm calendar file resources.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label1">
<property name="text">
<string>Display name:</string>
<string comment="@label:textbox">Display name:</string>
</property>
</widget>
</item>
......@@ -40,7 +40,7 @@
<item row="3" column="0">
<widget class="QLabel" name="label2">
<property name="text">
<string>Calendar directory:</string>
<string comment="@label:textbox">Calendar directory:</string>
</property>
</widget>
</item>
......@@ -54,7 +54,7 @@
<item row="4" column="0">
<widget class="QLabel" name="label3">
<property name="text">
<string>Alarm types:</string>
<string comment="@label:textbox">Alarm types:</string>
</property>
</widget>
</item>
......@@ -71,7 +71,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>If you prefer, you can import this calendar directory resource later, by using the Import Alarms menu option to import the calendar files contained within it.</string>
<string comment="@info">If you prefer, you can import this calendar directory resource later, by using the Import Alarms menu option to import the calendar files contained within it.</string>
</property>
</widget>
</item>
......
......@@ -6,7 +6,7 @@
<item row="0" column="0" colspan="2">
<widget class="QRadioButton" name="mergeRadio">
<property name="text">
<string>Import into existing calendar file resource</string>
<string comment="@option:radio">Import into existing calendar file resource</string>
</property>
<property name="checked">
<bool>true</bool>
......@@ -19,7 +19,7 @@
<item row="1" column="1">
<widget class="QComboBox" name="mergeResource">
<property name="whatsThis">
<string>Select the resource to import the directory resource's alarms into.</string>
<string comment="@info:whatsthis">Select the resource to import the directory resource's alarms into.</string>
</property>
</widget>
</item>
......@@ -42,7 +42,7 @@
<item row="3" column="0" colspan="2">
<widget class="QRadioButton" name="newRadio">
<property name="text">
<string>Import into new calendar file resource</string>
<string comment="@option:radio">Import into new calendar file resource</string>
</property>
<property name="checked">
<bool>false</bool>
......@@ -57,7 +57,7 @@
<item row="0" column="0">
<widget class="QLabel" name="pathLabel">
<property name="text">
<string>Filename:</string>
<string comment="@label:textbox">Filename:</string>
</property>
<property name="buddy">
<cstring>pathRequester</cstring>
......@@ -67,10 +67,10 @@
<item row="0" column="1">
<widget class="KUrlRequester" name="pathRequester">
<property name="toolTip">
<string>Select the file to contain this resource. The file must not already exist.</string>
<string comment="@info:tooltip">Select the file to contain this resource. The file must not already exist.</string>
</property>
<property name="whatsThis">
<string>Select the file to contain this resource.
<string comment="@info:whatsthis">Select the file to contain this resource.
The file must not already exist.
Note that if the URL of a remote file is specified, monitoring for file changes will not work.</string>
</property>
......@@ -85,14 +85,14 @@ Note that if the URL of a remote file is specified, monitoring for file changes
</font>
</property>
<property name="text">
<string>Status:</string>
<string notr="true">Status:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>Display name:</string>
<string comment="@label:textbox">Display name:</string>
</property>
<property name="buddy">
<cstring>nameText</cstring>
......@@ -102,10 +102,10 @@ Note that if the URL of a remote file is specified, monitoring for file changes
<item row="2" column="1">
<widget class="KLineEdit" name="nameText">
<property name="toolTip">
<string>Enter the name used to identify this resource in displays.</string>
<string comment="@info:tooltip">Enter the name used to identify this resource in displays.</string>
</property>
<property name="whatsThis">
<string>Enter the name used to identify this resource in displays.</string>
<string comment="@info:whatsthis">Enter the name used to identify this resource in displays.</string>
</property>
</widget>
</item>
......@@ -130,7 +130,7 @@ Note that if the URL of a remote file is specified, monitoring for file changes
<item row="6" column="0" colspan="2">
<widget class="QRadioButton" name="noRadio">
<property name="text">
<string>Do not import</string>
<string comment="@option:radio">Do not import</string>
</property>
<property name="checked">
<bool>false</bool>
......
......@@ -31,11 +31,6 @@
#include <KLocalizedString>
namespace
{
const QString loadErrorMessage = i18n("Error loading calendar '%1'.");
const QString saveErrorMessage = i18n("Error saving calendar '%1'.");
}
FileResource::FileResource(FileResourceSettings* settings)
: ResourceType(settings->id())
......@@ -310,7 +305,7 @@ bool FileResource::load(bool readThroughCache)
if (!mSettings->isValid())
{
qCWarning(KALARM_LOG) << "FileResource::load: Resource not configured!" << mSettings->displayName();
errorMessage = i18n("Resource is not configured.");
errorMessage = i18nc("@info", "Resource is not configured.");
}
else if (mStatus == Status::Closed)
qCWarning(KALARM_LOG) << "FileResource::load: Resource closed!" << mSettings->displayName();
......@@ -339,7 +334,7 @@ bool FileResource::load(bool readThroughCache)
}
if (!errorMessage.isEmpty())
Resources::notifyResourceMessage(this, MessageType::Error, loadErrorMessage.arg(displayName()), errorMessage);
Resources::notifyResourceMessage(this, MessageType::Error, xi18nc("@info", "Error loading calendar <resource>%1</resource>.", displayName()), errorMessage);
return false;
}
......@@ -354,7 +349,7 @@ void FileResource::loaded(bool success, QHash<QString, KAEvent>& newEvents, cons
// If the resource previously loaded successfully, leave its events (in
// mEvents) unchanged.
if (!success && !errorMessage.isEmpty())
Resources::notifyResourceMessage(this, MessageType::Error, loadErrorMessage.arg(displayName()), errorMessage);
Resources::notifyResourceMessage(this, MessageType::Error, xi18nc("@info", "Error loading calendar <resource>%1</resource>.", displayName()), errorMessage);
return;
}
......@@ -413,7 +408,7 @@ bool FileResource::save(bool writeThroughCache, bool force)
default: // failure
if (!errorMessage.isEmpty())
Resources::notifyResourceMessage(this, MessageType::Error, saveErrorMessage.arg(displayName()), errorMessage);
Resources::notifyResourceMessage(this, MessageType::Error, xi18nc("@info", "Error saving calendar <resource>%1</resource>.", displayName()), errorMessage);
return false;
}
}
......@@ -427,24 +422,24 @@ bool FileResource::checkSave()
if (!mSettings->isValid())
{
qCWarning(KALARM_LOG) << "FileResource::checkSave: FileResource not configured!" << displayName();
errorMessage = i18n("Resource is not configured.");
errorMessage = i18nc("@info", "Resource is not configured.");
}
else if (!isValid() || !mSettings->enabledTypes())
return false;
else if (readOnly())
{
qCWarning(KALARM_LOG) << "FileResource::checkSave: Read-only resource!" << displayName();
errorMessage = i18n("Resource is read-only.");
errorMessage = i18nc("@info", "Resource is read-only.");
}
else if (mCompatibility != KACalendar::Current)
{
qCWarning(KALARM_LOG) << "FileResource::checkSave: Calendar is in wrong format" << displayLocation();
errorMessage = i18n("Calendar file is in wrong format: '%1'.", displayLocation());
errorMessage = xi18nc("@info", "Calendar file is in wrong format: <filename>%1</filename>.", displayLocation());
}
else
return true;
Resources::notifyResourceMessage(this, MessageType::Error, saveErrorMessage.arg(displayName()), errorMessage);
Resources::notifyResourceMessage(this, MessageType::Error, xi18nc("@info", "Error saving calendar <resource>%1</resource>.", displayName()), errorMessage);
return false;
}
......@@ -454,7 +449,7 @@ bool FileResource::checkSave()
void FileResource::saved(bool success, const QString& errorMessage)
{
if (!success && !errorMessage.isEmpty())
Resources::notifyResourceMessage(this, MessageType::Error, saveErrorMessage.arg(displayName()), errorMessage);
Resources::notifyResourceMessage(this, MessageType::Error, xi18nc("@info", "Error saving calendar <resource>%1</resource>.", displayName()), errorMessage);
}
/******************************************************************************
......
......@@ -64,7 +64,7 @@ void FileResourceCreator::doCreateResource()
// deletion of ResourceSelector, and on return from this function).
AutoQPointer<QInputDialog> dlg = new QInputDialog(mParent);
dlg->setWindowTitle(i18nc("@title:window", "Calendar Configuration"));
dlg->setLabelText(i18nc("@info", "Select storage type of new calendar:"));
dlg->setLabelText(i18nc("@label:listbox", "Select storage type of new calendar:"));
dlg->setOption(QInputDialog::UseListViewForComboBoxItems);
dlg->setInputMode(QInputDialog::TextInput);
dlg->setComboBoxEditable(false);
......@@ -146,7 +146,7 @@ QString validateFileUrl(const QUrl& url)
{
const QString path = url.toDisplayString(QUrl::PrettyDecoded | QUrl::PreferLocalFile);
qCWarning(KALARM_LOG) << "FileResourceCreator::validateFileUrl: Duplicate path for new resource:" << path;
return xi18nc("@info", "Error! The file is already used by an existing resource.", path);
return xi18nc("@info", "Error! The file <filename>%1</filename> is already used by an existing resource.", path);
}
}
return QString();
......
......@@ -445,11 +445,11 @@ void FileResourceMigrator::createDefaultResources()
{
qCDebug(KALARM_LOG) << "FileResourceMigrator::createDefaultResources";
if (!(mExistingAlarmTypes & CalEvent::ACTIVE))
createCalendar(CalEvent::ACTIVE, QStringLiteral("calendar.ics"), i18nc("@info", "Active Alarms"));
createCalendar(CalEvent::ACTIVE, QStringLiteral("calendar.ics"), i18nc("@info/plain Name of a calendar", "Active Alarms"));
if (!(mExistingAlarmTypes & CalEvent::ARCHIVED))
createCalendar(CalEvent::ARCHIVED, QStringLiteral("expired.ics"), i18nc("@info", "Archived Alarms"));
createCalendar(CalEvent::ARCHIVED, QStringLiteral("expired.ics"), i18nc("@info/plain Name of a calendar", "Archived Alarms"));
if (!(mExistingAlarmTypes & CalEvent::TEMPLATE))
createCalendar(CalEvent::TEMPLATE, QStringLiteral("template.ics"), i18nc("@info", "Alarm Templates"));
createCalendar(CalEvent::TEMPLATE, QStringLiteral("template.ics"), i18nc("@info/plain Name of a calendar", "Alarm Templates"));
mCompleted = true;
checkIfComplete(); // delete this instance if everything is finished
......@@ -469,9 +469,9 @@ void FileResourceMigrator::createCalendar(CalEvent::Type alarmType, const QStrin
Resource resource = FileResourceConfigManager::addResource(settings);
if (resource.failed())
{
QString errmsg = xi18nc("@info/plain", "Failed to create default calendar <resource>%1</resource>", name);
const QString locn = i18nc("@info File path or URL", "Location: %1", resource.displayLocation());
errmsg = xi18nc("@info", "<para>%1</para><para>%2</para>", errmsg, locn);
const QString errmsg = xi18nc("@info", "<para>Failed to create default calendar <resource>%1</resource></para>"
"<para>Location: <filename>%2</filename></para>",
name, resource.displayLocation());
Resources::notifyResourceMessage(resource.id(), ResourceType::MessageType::Error, errmsg, QString());
return;
}
......
......@@ -85,11 +85,11 @@ QString ResourceDataModelBase::typeListForDisplay(CalEvent::Types alarmTypes)
{
QString list;
if (alarmTypes & CalEvent::ACTIVE)
list += QLatin1String("<item>") + i18nc("@info", "Active Alarms") + QLatin1String("</item>");
list += QLatin1String("<item>") + i18nc("@item:intext", "Active Alarms") + QLatin1String("</item>");
if (alarmTypes & CalEvent::ARCHIVED)
list += QLatin1String("<item>") + i18nc("@info", "Archived Alarms") + QLatin1String("</item>");
list += QLatin1String("<item>") + i18nc("@item:intext", "Archived Alarms") + QLatin1String("</item>");
if (alarmTypes & CalEvent::TEMPLATE)
list += QLatin1String("<item>") + i18nc("@info", "Alarm Templates") + QLatin1String("</item>");
list += QLatin1String("<item>") + i18nc("@item:intext", "Alarm Templates") + QLatin1String("</item>");
if (!list.isEmpty())
list = QLatin1String("<list>") + list + QLatin1String("</list>");
return list;
......@@ -105,13 +105,13 @@ QString ResourceDataModelBase::readOnlyTooltip(const Resource& resource)
switch (resource.compatibility())
{
case KACalendar::Current:
return resource.readOnly() ? i18nc("@info", "Read-only") : QString();
return resource.readOnly() ? i18nc("@item:intext Calendar status", "Read-only") : QString();
case KACalendar::Converted:
case KACalendar::Convertible:
return i18nc("@info", "Read-only (old format)");
return i18nc("@item:intext Calendar status", "Read-only (old format)");
case KACalendar::Incompatible:
default:
return i18nc("@info", "Read-only (other format)");
return i18nc("@item:intext Calendar status", "Read-only (other format)");
}
}
......@@ -499,7 +499,7 @@ QString ResourceDataModelBase::tooltip(const Resource& resource, CalEvent::Types
const bool inactive = !(resource.enabledTypes() & types);
const QString readonly = readOnlyTooltip(resource);
const bool writable = readonly.isEmpty();
const QString disabled = i18nc("@info", "Disabled");
const QString disabled = i18nc("@item:intext Calendar status", "Disabled");
if (inactive || !writable)
return xi18nc("@info:tooltip",
"%1"
......
......@@ -478,25 +478,25 @@ void Resources::notifySettingsChanged(ResourceType* res, ResourceType::Changes c
switch (std)
{
case CalEvent::ACTIVE:
msg = xi18n("The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for active alarms.",
res->displayName());
msg = xi18nc("@info", "The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for active alarms.",
res->displayName());
break;
case CalEvent::ARCHIVED:
msg = xi18n("The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for archived alarms.",
res->displayName());
msg = xi18nc("@info", "The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for archived alarms.",
res->displayName());
break;
case CalEvent::TEMPLATE:
msg = xi18n("The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for alarm templates.",
res->displayName());
msg = xi18nc("@info", "The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for alarm templates.",
res->displayName());
break;
default:
msg = xi18nc("@info", "<para>The calendar <resource>%1</resource> has been made read-only. "
"This was the default calendar for:%2</para>"
"<para>Please select new default calendars.</para>",
res->displayName(), ResourceDataModelBase::typeListForDisplay(std));
"This was the default calendar for:%2</para>"
"<para>Please select new default calendars.</para>",
res->displayName(), ResourceDataModelBase::typeListForDisplay(std));
singleType = false;
break;
}
......
/*
* resourceselectdialog.cpp - Resource selection dialog
* Program: kalarm
* Copyright © 2019 David Jarvie <djarvie@kde.org>
* Copyright © 2019-2020 David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -45,7 +45,7 @@ ResourceSelectDialog::ResourceSelectDialog(ResourceListModel* model, QWidget* pa
QLineEdit* filterEdit = new QLineEdit(this);
filterEdit->setClearButtonEnabled(true);
filterEdit->setPlaceholderText(i18nc("@info A prompt for user to enter what to search for", "Search"));
filterEdit->setPlaceholderText(xi18nc("@info A prompt for user to enter what to search for", "<placeholder>Search</placeholder>"));
layout->addWidget(filterEdit);
mResourceList = new QListView(this);
......
......@@ -334,10 +334,10 @@ QString ResourceType::storageTypeString(StorageType type)
QString ResourceType::storageTypeStr(bool description, bool file, bool local)
{
if (description)
return file ? i18nc("@info", "KAlarm Calendar File") : i18nc("@info", "KAlarm Calendar Directory");
return (file && local) ? i18nc("@info", "File")
: (file && !local) ? i18nc("@info", "URL")
: (!file && local) ? i18nc("@info Directory in filesystem", "Directory")
return file ? i18nc("@item:inlistbox", "KAlarm Calendar File") : i18nc("@item:inlistbox", "KAlarm Calendar Directory");
return (file && local) ? i18nc("@item:intext What a resource is stored in", "File")
: (file && !local) ? i18nc("@item:intext What a resource is stored in", "URL")
: (!file && local) ? i18nc("@item:intext What a resource is stored in (directory in filesystem)", "Directory")
: QString();
}
......
......@@ -53,7 +53,6 @@ Q_DECLARE_METATYPE(QEventLoopLocker*)
namespace
{
const QString reloadMessage = i18n("Calendar '%1' has been reloaded.");
const int SAVE_TIMER_DELAY = 1000; // 1 second
}
......@@ -188,13 +187,13 @@ int SingleFileResource::doLoad(QHash<QString, KAEvent>& newEvents, bool readThro
if (mDownloadJob)
{
qCWarning(KALARM_LOG) << "SingleFileResource::load:" << displayId() << "Another download is still in progress";
errorMessage = i18n("A previous load is still in progress.");
errorMessage = i18nc("@info", "A previous load is still in progress.");
return -1;
}
if (mUploadJob)
{
qCWarning(KALARM_LOG) << "SingleFileResource::load:" << displayId() << "Another file upload is still in progress.";
errorMessage = i18n("A previous save is still in progress.");
errorMessage = i18nc("@info", "A previous save is still in progress.");
return -1;
}
......@@ -243,7 +242,7 @@ int SingleFileResource::doLoad(QHash<QString, KAEvent>& newEvents, bool readThro
{
const QString path = mSettings->displayLocation();
qCWarning(KALARM_LOG) << "SingleFileResource::load:" << displayId() << "Could not create file" << path;
errorMessage = i18n("Could not create calendar file '%1'.", path);
errorMessage = xi18nc("@info", "Could not create calendar file <filename>%1</filename>.", path);
mStatus = Status::Broken;
mSaveUrl.clear();
setLoadFailure();
......@@ -344,13 +343,13 @@ int SingleFileResource::doSave(bool writeThroughCache, bool force, QString& erro
if (mDownloadJob)
{
qCWarning(KALARM_LOG) << "SingleFileResource::save:" << displayId() << "A download is still in progress.";
errorMessage = i18n("A previous load is still in progress.");
errorMessage = i18nc("@info", "A previous load is still in progress.");
return -1;
}
if (mUploadJob)
{
qCWarning(KALARM_LOG) << "SingleFileResource::save:" << displayId() << "Another file upload is still in progress.";
errorMessage = i18n("A previous save is still in progress.");
errorMessage = i18nc("@info", "A previous save is still in progress.");
return -1;
}
localFileName = cacheFilePath();
......@@ -581,7 +580,7 @@ bool SingleFileResource::readFromFile(const QString& fileName, QString& errorMes
if (!result)
{
qCCritical(KALARM_LOG) << "SingleFileResource::readFromFile: Error loading file " << fileName;
errorMessage = i18n("Could not load file '%1'.", fileName);
errorMessage = xi18nc("@info", "Could not load file <filename>%1</filename>.", fileName);
return false;
}
if (mCalendar->incidences().isEmpty())
......@@ -613,7 +612,7 @@ bool SingleFileResource::writeToFile(const QString& fileName, QString& errorMess
if (!mCalendar)
{
qCCritical(KALARM_LOG) << "SingleFileResource::writeToFile:" << displayId() << "mCalendar is null!";
errorMessage = i18n("Calendar not open.");
errorMessage = i18nc("@info", "Calendar not open.");
return false;
}
KACalendar::setKAlarmVersion(mCalendar); // write the application ID into the calendar
......@@ -626,7 +625,7 @@ bool SingleFileResource::writeToFile(const QString& fileName, QString& errorMess
if (!fileStorage->save()) // this sets mCalendar->modified to false
{
qCCritical(KALARM_LOG) << "SingleFileResource::writeToFile:" << displayId() << "Failed to save calendar to file " << fileName;
errorMessage = i18n("Could not save file '%1'.", fileName);
errorMessage = xi18nc("@info", "Could not save file <filename>%1</filename>.", fileName);
success = false;
}
......@@ -717,7 +716,7 @@ void SingleFileResource::slotDownloadJobResult(KJob* job)
setLoadFailure();
const QString path = mSettings->displayLocation();
qCWarning(KALARM_LOG) << "SingleFileResource::slotDownloadJobResult:" << displayId() << "Could not load file" << path << job->errorString();
errorMessage = i18n("Could not load file '%1'. (%2)", path, job->errorString());
errorMessage = xi18nc("@info", "Could not load file <filename>%1</filename>. (%2)", path, job->errorString());
success = false;
}
else
......@@ -757,7 +756,7 @@ void SingleFileResource::slotUploadJobResult(KJob* job)
mStatus = Status::Broken;
const QString path = mSettings->displayLocation();
qCWarning(KALARM_LOG) << "SingleFileResource::slotDownloadJobResult:" << displayId() << "Could not save file" << path << job->errorString();
errorMessage = i18n("Could not save file '%1'. (%2)", path, job->errorString());
errorMessage = xi18nc("@info", "Could not save file <filename>%1</filename>. (%2)", path, job->errorString());
success = false;
}
else if (mStatus != Status::Closed)
......
......@@ -42,14 +42,14 @@ SingleFileResourceConfigDialog::SingleFileResourceConfigDialog(bool create, QWid
{
mUi = new Ui_SingleFileResourceConfigWidget;
mUi->setupUi(this);
setWindowTitle(i18n("Configure Calendar"));
setWindowTitle(i18nc("@title:window", "Configure Calendar"));