Permalink
Browse files

Make some new strings translatable

  • Loading branch information...
nriendeau committed Jul 21, 2013
1 parent c10557e commit 0fbe4d3887a7d95303bf0d5df580d5d286a8bab5
Showing with 34 additions and 20 deletions.
  1. +26 −12 mythtv/libs/libmyth/storagegroupeditor.cpp
  2. +8 −8 mythtv/libs/libmythbase/storagegroup.cpp
@@ -1,9 +1,12 @@
// Qt headers
#include <QDir>
#include <QFile>
#include <QRegExp>
#include <QUrl>
#include <QVector>
#include <QCoreApplication>
// MythTV headers
#include "storagegroupeditor.h"
#include "mythcorecontext.h"
#include "mythdb.h"
@@ -35,8 +38,10 @@ SGPopupResult StorageGroupPopup::showPopup(MythMainWindow *parent,
textEdit->setText(text);
popup->addWidget(textEdit);
popup->addButton(QObject::tr("OK"), popup, SLOT(accept()));
popup->addButton(QObject::tr("Cancel"), popup, SLOT(reject()));
popup->addButton(QCoreApplication::translate("(Common)", "OK"),
popup, SLOT(accept()));
popup->addButton(QCoreApplication::translate("(Common)", "Cancel"),
popup, SLOT(reject()));
textEdit->setFocus();
@@ -61,9 +66,10 @@ StorageGroupEditor::StorageGroupEditor(QString group) :
QString dispGroup = group;
if (group == "Default")
dispGroup = QObject::tr("Default");
dispGroup = tr("Default", "Default storage group");
else if (StorageGroup::kSpecialGroups.contains(group))
dispGroup = QObject::tr(group.toLatin1().constData());
dispGroup = QCoreApplication::translate("(StorageGroups)",
group.toLatin1().constData());
if (gCoreContext->IsMasterHost())
{
@@ -293,9 +299,10 @@ void StorageGroupListEditor::doDelete(void)
QString dispGroup = name;
if (name == "Default")
dispGroup = QObject::tr("Default");
dispGroup = tr("Default", "Default storage group");
else if (StorageGroup::kSpecialGroups.contains(name))
dispGroup = QObject::tr(name.toLatin1().constData());
dispGroup = QCoreApplication::translate("(StorageGroups)",
name.toLatin1().constData());
QString message = tr("Delete '%1' Storage Group?").arg(dispGroup);
if (is_master_host)
@@ -391,7 +398,8 @@ void StorageGroupListEditor::Load(void)
if (isMaster || names.contains("Default"))
{
listbox->addSelection(QObject::tr("Default"), "Default");
listbox->addSelection(tr("Default", "Default storage group"),
"Default");
lastValue = "Default";
}
else
@@ -405,7 +413,9 @@ void StorageGroupListEditor::Load(void)
if (names.contains(groupName))
{
listbox->addSelection(
QObject::tr(groupName.toLatin1().constData()), groupName);
QCoreApplication::translate("(StorageGroups)",
groupName.toLatin1().constData()),
groupName);
createAddSpecialGroupButton[curGroup] = false;
}
else
@@ -424,8 +434,9 @@ void StorageGroupListEditor::Load(void)
if (createAddDefaultButton)
{
listbox->addSelection(tr("(Create %1 group)").arg("Default"),
"Default");
listbox->addSelection(tr("(Create %1 group)")
.arg(tr("Default", "Default storage group")),
"Default");
lastValue = "Default";
}
@@ -434,13 +445,16 @@ void StorageGroupListEditor::Load(void)
{
groupName = StorageGroup::kSpecialGroups[curGroup];
if (createAddSpecialGroupButton[curGroup])
listbox->addSelection(tr("(Create %1 group)").arg(groupName),
listbox->addSelection(tr("(Create %1 group)")
.arg(QCoreApplication::translate("(StorageGroups)",
groupName.toLatin1().constData())),
QString("__CREATE_NEW_STORAGE_GROUP__%1").arg(groupName));
curGroup++;
}
if (isMaster)
listbox->addSelection(tr("(Create %1 group)").arg("new"),
listbox->addSelection(tr("(Create %1 group)")
.arg(tr("new", "New storage group")),
"__CREATE_NEW_STORAGE_GROUP__");
else
{
@@ -21,15 +21,15 @@ QMutex StorageGroup::s_groupToUseLock;
QHash<QString,QString> StorageGroup::s_groupToUseCache;
const QStringList StorageGroup::kSpecialGroups = QStringList()
<< "LiveTV"
<< QT_TRANSLATE_NOOP("(StorageGroups)", "LiveTV")
// << "Thumbnails"
<< "DB Backups"
<< "Videos"
<< "Trailers"
<< "Coverart"
<< "Fanart"
<< "Screenshots"
<< "Banners"
<< QT_TRANSLATE_NOOP("(StorageGroups)", "DB Backups")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Videos")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Trailers")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Coverart")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Fanart")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Screenshots")
<< QT_TRANSLATE_NOOP("(StorageGroups)", "Banners")
;
/****************************************************************************/

0 comments on commit 0fbe4d3

Please sign in to comment.