fix(RD): correctly set the strings for the specific resource names

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-12-30 16:59:35 -03:00
parent 7d128c79a3
commit b3330cb0da
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
5 changed files with 14 additions and 11 deletions

View File

@ -64,7 +64,6 @@ ResourceDownloadDialog::ResourceDownloadDialog(QWidget* parent, const std::share
HelpButton->setAutoDefault(false);
setWindowModality(Qt::WindowModal);
setWindowTitle(dialogTitle());
}
void ResourceDownloadDialog::accept()
@ -206,6 +205,8 @@ void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* s
ModDownloadDialog::ModDownloadDialog(QWidget* parent, const std::shared_ptr<ModFolderModel>& mods, BaseInstance* instance)
: ResourceDownloadDialog(parent, mods), m_instance(instance)
{
setWindowTitle(dialogTitle());
initializeContainer();
connectButtons();

View File

@ -39,6 +39,9 @@ class ModPage : public ResourcePage {
~ModPage() override = default;
//: The plural version of 'mod'
[[nodiscard]] inline QString resourcesString() const override { return tr("mods"); }
//: The singular version of 'mods'
[[nodiscard]] inline QString resourceString() const override { return tr("mod"); }
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;

View File

@ -57,6 +57,10 @@ void ResourcePage::openedImpl()
if (!supportsFiltering())
m_ui->resourceFilterButton->setVisible(false);
//: String in the search bar of the mod downloading dialog
m_ui->searchEdit->setPlaceholderText(tr("Search for %1...").arg(resourcesString()));
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
updateSelectionButton();
triggerSearch();
}

View File

@ -36,6 +36,9 @@ class ResourcePage : public QWidget, public BasePage {
[[nodiscard]] virtual auto metaEntryBase() const -> QString = 0;
[[nodiscard]] virtual auto debugName() const -> QString = 0;
//: The plural version of 'resource'
[[nodiscard]] virtual inline QString resourcesString() const { return tr("resources"); }
//: The singular version of 'resources'
[[nodiscard]] virtual inline QString resourceString() const { return tr("resource"); }
/* Features this resource's page supports */

View File

@ -49,11 +49,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="searchEdit">
<property name="placeholderText">
<string>Search for resources...</string>
</property>
</widget>
<widget class="QLineEdit" name="searchEdit"/>
</item>
<item row="2" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0">
@ -74,11 +70,7 @@
<widget class="QComboBox" name="sortByBox"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="resourceSelectionButton">
<property name="text">
<string>Select resource for download</string>
</property>
</widget>
<widget class="QPushButton" name="resourceSelectionButton"/>
</item>
</layout>
</item>