1#ifndef COCKATRICE_CARD_LOCALIZATION_H
2#define COCKATRICE_CARD_LOCALIZATION_H
29 return card.isNull() ? QString() : card->getLocalizedName(
displayLang());
39 return card.isNull() ? QString() : card->getLocalizedText(
displayLang());
72 if (cardName.isEmpty()) {
76 return localizedName.isEmpty() ? cardName : localizedName;
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:15
static CardDatabaseQuerier * query()
Returns the CardDatabaseQuerier of the singleton database.
Definition card_database_manager.cpp:39
Represents a card and its associated metadata, properties, and relationships.
Definition card_info.h:54
const QString & getLocalizedText(const QString &lang) const
Returns the rules text in the given language, falling back to the English text when no localization i...
Definition card_info.h:317
const QString & getLocalizedName(const QString &lang) const
Returns the card name in the given language, falling back to the English name when no localization is...
Definition card_info.h:304
QString getCardLang() const override
Definition cards_display_settings.cpp:116
CardsDisplaySettings & cardsDisplay() const
Definition cache_settings.cpp:443
static SettingsCache & instance()
Definition cache_settings.cpp:48
Shared language metadata for localized card text and images.
Definition card_localization.h:13
QString displayLang()
The language code selected for localized card text and images.
Definition card_localization.h:17
QString displayText(const CardInfoPtr &card)
Card rules text in the configured display language, falling back to English.
Definition card_localization.h:37
QString displayNameFor(const QString &cardName)
Looks a card up by its canonical name and returns its name in the configured display language.
Definition card_localization.h:70
QString displayName(const CardInfoPtr &card)
Card name in the configured display language, falling back to English.
Definition card_localization.h:27