Skip to content

Commit

Permalink
Make some new strings translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Riendeau committed Jul 21, 2013
1 parent c10557e commit 0fbe4d3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
38 changes: 26 additions & 12 deletions mythtv/libs/libmyth/storagegroupeditor.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"
Expand Down Expand Up @@ -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();

Expand All @@ -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())
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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";
}

Expand All @@ -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
{
Expand Down
16 changes: 8 additions & 8 deletions mythtv/libs/libmythbase/storagegroup.cpp
Expand Up @@ -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")
;

/****************************************************************************/
Expand Down

0 comments on commit 0fbe4d3

Please sign in to comment.