Commit 1eccfcb7 authored by Michael Pyne's avatar Michael Pyne

Fix Krazy issues with localization. No new strings, but many more strings have context

added where requested by the translators and recommended by Krazy in situations where
the right translation would be unclear.

Only major code change is in tagrenameroptions.cpp which I don't like in the version
either now or before.  Now it is more verbose but less of a hack.

Also trackpickerdialogbase.ui required hand editing since Designer doesn't support
changing K3ListView columns.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=753622
parent e63ee1b3
......@@ -111,7 +111,7 @@ AdvancedSearchDialog::AdvancedSearchDialog(const QString &defaultName,
l->addStretch(1);
m_moreButton = new KPushButton(i18n("More"), buttons);
m_moreButton = new KPushButton(i18nc("additional search options", "More"), buttons);
connect(m_moreButton, SIGNAL(clicked()), SLOT(more()));
l->addWidget(m_moreButton);
......
......@@ -35,7 +35,7 @@ class AllArtistsListViewItem : public K3ListViewItem
{
public:
AllArtistsListViewItem(Q3ListView *parent) :
K3ListViewItem(parent, i18n("<All Artists>"))
K3ListViewItem(parent, i18n("&lt;All Artists&gt;"))
{
}
......
......@@ -13,10 +13,22 @@
<string>Example</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="spacing" >
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
......@@ -25,12 +37,21 @@
<string>Example Tag Selection</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QRadioButton" name="m_fileTagsButton" >
<property name="text" >
......@@ -47,9 +68,7 @@
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -75,24 +94,45 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="spacing" >
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Title:</string>
<string comment="song title" >Title:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
......@@ -153,16 +193,25 @@
</item>
<item row="0" column="1" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="m_exampleTitle" >
<property name="text" >
<string>Title</string>
<string comment="example song title" >Title</string>
</property>
</widget>
</item>
......@@ -196,14 +245,14 @@
</item>
<item>
<widget class="QSpinBox" name="m_exampleYear" >
<property name="maximum" >
<number>2006</number>
</property>
<property name="minimum" >
<number>1901</number>
<number>1000</number>
</property>
<property name="maximum" >
<number>2999</number>
</property>
<property name="value" >
<number>2004</number>
<number>2007</number>
</property>
</widget>
</item>
......
......@@ -66,7 +66,7 @@ public:
{
setObjectName(name);
setModal(true);
setCaption(i18n("Warning"));
setCaption(i18nc("warning about mass file rename", "Warning"));
setButtons(Ok | Cancel);
KVBox *vbox = new KVBox(this);
......
......@@ -10,24 +10,42 @@
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QGroupBox" name="m_tagFormatGroup" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QLabel" name="m_description" >
<property name="textFormat" >
<property name="textFormat" >
<enum>Qt::RichText</enum>
</property>
<property name="alignment" >
......@@ -37,12 +55,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
......@@ -67,8 +94,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="m_tagLabel" >
</widget>
<widget class="QLabel" name="m_tagLabel" />
</item>
<item>
<widget class="QLineEdit" name="m_suffixText" >
......@@ -122,12 +148,21 @@
<item>
<widget class="QGroupBox" name="m_emptyTagGroup" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QRadioButton" name="m_includeEmptyButton" >
<property name="text" >
......@@ -147,12 +182,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="m_useValueButton" >
<property name="text" >
......@@ -166,7 +210,7 @@
<bool>false</bool>
</property>
<property name="text" >
<string>Empty</string>
<string comment="value to use in replacement when source tag empty" >Empty</string>
</property>
</widget>
</item>
......@@ -181,12 +225,21 @@
<string>GroupBox</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QLabel" name="textLabel10" >
<property name="text" >
......@@ -202,20 +255,38 @@
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel5" >
<property name="text" >
......@@ -233,10 +304,22 @@
</item>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="spacing" >
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="1" column="1" >
......
......@@ -213,7 +213,7 @@ void JuK::setupActions()
// the following are not visible by default
act = new KAction(KIcon("mute"), i18n("Mute"), collection);
act = new KAction(KIcon("mute"), i18nc("silence playback", "Mute"), collection);
collection->addAction("mute", act);
connect(act, SIGNAL(triggered(bool)), m_player, SLOT(mute()));
......
......@@ -57,7 +57,7 @@ QStringList MediaFiles::openDialog(QWidget *parent)
dialog->setOperationMode(KFileDialog::Opening);
dialog->setCaption(i18n("Open"));
dialog->setCaption(i18nc("open audio file", "Open"));
dialog->setMode(KFile::Files | KFile::LocalOnly);
// dialog.ops->clearHistory();
dialog->setMimeFilter(mimeTypes());
......
......@@ -1517,7 +1517,7 @@ void Playlist::slotInitialize()
addColumn(i18n("Artist"));
addColumn(i18n("Album"));
addColumn(i18n("Cover"));
addColumn(i18n("Track"));
addColumn(i18nc("cd track number", "Track"));
addColumn(i18n("Genre"));
addColumn(i18n("Year"));
addColumn(i18n("Length"));
......
......@@ -212,7 +212,7 @@ void PlaylistBox::duplicate()
if(!item || !item->playlist())
return;
QString name = playlistNameDialog(i18n("Duplicate"), item->text(0));
QString name = playlistNameDialog(i18nc("verb, copy the playlist", "Duplicate"), item->text(0));
if(name.isNull())
return;
......
......@@ -333,7 +333,7 @@ void PlaylistCollection::open(const QStringList &l)
JuK::JuKInstance(),
i18n("Do you want to add these items to the current list or to the collection list?"),
QString(),
KGuiItem(i18n("Current")),
KGuiItem(i18nc("current playlist", "Current")),
KGuiItem(i18n("Collection"))) == KMessageBox::No)
{
CollectionList::instance()->addFiles(files);
......@@ -405,7 +405,8 @@ void PlaylistCollection::rename()
void PlaylistCollection::duplicate()
{
QString name = playlistNameDialog(i18n("Duplicate"), visiblePlaylist()->name());
QString name = playlistNameDialog(i18nc("verb, copy the playlist", "Duplicate"),
visiblePlaylist()->name());
if(name.isEmpty())
return;
raise(new Playlist(this, visiblePlaylist()->items(), name));
......@@ -852,7 +853,7 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
// "New" menu
menu = new KActionMenu(KIcon("document-new"), i18n("&New"), actions());
menu = new KActionMenu(KIcon("document-new"), i18nc("new playlist", "&New"), actions());
actions()->addAction("file_new", menu);
menu->addAction(createAction(i18n("&Empty Playlist..."), SLOT(slotCreatePlaylist()),
......@@ -883,12 +884,14 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
createAction(i18n("Play First Track"),SLOT(slotPlayFirst()), "playFirst");
createAction(i18n("Play Next Album"), SLOT(slotPlayNextAlbum()), "forwardAlbum", "edit-find-next");
createAction(i18n("Open..."), SLOT(slotOpen()), "file_open", "document-open", KShortcut(Qt::CTRL + Qt::Key_O));
KStandardAction::open(this, SLOT(slotOpen()), actions());
KStandardAction::save(this, SLOT(slotSave()), actions());
KStandardAction::saveAs(this, SLOT(slotSaveAs()), actions());
createAction(i18n("Add &Folder..."), SLOT(slotAddFolder()), "openDirectory", "folder-new");
createAction(i18n("&Rename..."), SLOT(slotRename()), "renamePlaylist", "edit-rename");
createAction(i18n("D&uplicate..."), SLOT(slotDuplicate()), "duplicatePlaylist", "edit-copy");
createAction(i18n("Save"), SLOT(slotSave()), "file_save", "document-save", KShortcut(Qt::CTRL + Qt::Key_S));
createAction(i18n("Save As..."), SLOT(slotSaveAs()), "file_save_as", "document-save-as");
createAction(i18nc("verb, copy the playlist", "D&uplicate..."),
SLOT(slotDuplicate()), "duplicatePlaylist", "edit-copy");
createAction(i18n("R&emove"), SLOT(slotRemove()), "deleteItemPlaylist", "user-trash");
createAction(i18n("Reload"), SLOT(slotReload()), "reloadPlaylist", "view-refresh");
createAction(i18n("Edit Search..."), SLOT(slotEditSearch()), "editSearch");
......
......@@ -578,7 +578,7 @@ void TagEditor::setupLayout()
m_trackSpin = new KIntSpinBox(0, 9999, 1, 0, this);
m_trackSpin->setObjectName( "trackSpin" );
addItem(i18n("T&rack:"), m_trackSpin, trackRowLayout);
addItem(i18nc("cd track number", "T&rack:"), m_trackSpin, trackRowLayout);
m_trackSpin->installEventFilter(this);
trackRowLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding,
......
......@@ -88,22 +88,46 @@ TagRenamerOptions::TagRenamerOptions(const CategoryID &category)
QString TagRenamerOptions::tagTypeText(TagType type, bool translate)
{
// These must be declared in the same order that they are defined in
// the TagType enum in test.h. We can dynamically translate these strings,
// so make sure that I18N_NOOP() is used instead of i18n().
const char *tags[] = {
I18N_NOOP("Title"), I18N_NOOP("Artist"), I18N_NOOP("Album"),
I18N_NOOP("Track"), I18N_NOOP("Genre"), I18N_NOOP("Year")
};
if(type < StartTag || type >= NumTypes) {
kWarning() << "I don't know what category we're looking up, this is a problem.";
kWarning() << "The category ID is " << (unsigned) type;
return translate ? i18n("Unknown") : "Unknown";
const char *msg = 0, *context = 0;
switch(type) {
case Title:
msg = I18N_NOOP2("song title", "Title");
context = "song title";
break;
case Artist:
msg = I18N_NOOP("Artist");
break;
case Album:
msg = I18N_NOOP("Album");
break;
case Track:
msg = I18N_NOOP2("cd track number", "Track");
context = "cd track number";
break;
case Genre:
msg = I18N_NOOP("Genre");
break;
case Year:
msg = I18N_NOOP("Year");
break;
default:
kWarning() << "I don't know what category we're looking up, this is a problem.";
kWarning() << "The category ID is " << (unsigned) type;
msg = I18N_NOOP2("unknown renamer category", "Unknown");
context = "unknown renamer category";
}
return translate ? i18n(tags[type]) : tags[type];
if(translate)
return context ? i18n(msg) : i18nc(context, msg);
else
return msg;
}
void TagRenamerOptions::saveConfig(unsigned categoryNum) const
......
......@@ -130,7 +130,7 @@
</column>
<column>
<property name="text" >
<string>Track</string>
<string comment="cd track number" >Track</string>
</property>
<property name="clickable" >
<bool>true</bool>
......
......@@ -119,7 +119,7 @@ bool ViewMode::eventFilter(QObject *watched, QEvent *e)
QString ViewMode::name() const
{
return i18n("Default");
return i18nc("the normal viewing mode", "Default");
}
void ViewMode::setShown(bool shown)
......@@ -240,7 +240,7 @@ void CompactViewMode::paintCell(PlaylistBox::Item *item,
QString CompactViewMode::name() const
{
return i18n("Compact");
return i18nc("compact viewing mode", "Compact");
}
void CompactViewMode::setShown(bool shown)
......
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