Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
card_localization.h
Go to the documentation of this file.
1#ifndef CARD_LOCALIZATION_H
2#define CARD_LOCALIZATION_H
3
4#include <QLatin1String>
5#include <QSharedPointer>
6#include <QString>
7#include <QStringList>
8
18
27{
28 QString language;
30
36 [[nodiscard]] bool isEnglishOnly() const
37 {
38 return language.isEmpty() || language == QLatin1String("en");
39 }
40
41 bool operator==(const CardSearchLanguage &) const = default;
42 bool operator!=(const CardSearchLanguage &) const = default;
43};
44
56namespace CardLocalization
57{
66[[nodiscard]] const QStringList &supportedLanguages();
67
78[[nodiscard]] QString languageDisplayName(const QString &lang);
79} // namespace CardLocalization
80
81#endif // CARD_LOCALIZATION_H
@ Selected
Definition deck_preview_tag_display_widget.h:20
SearchLanguageMode
The card languages card search should run against.
Definition card_localization.h:13
@ Both
Search both the English and the selected card language names and texts.
Definition card_localization.h:16
@ English
Only search the English card names and texts.
Definition card_localization.h:14
Shared language metadata for localized card text and images.
Definition card_localization.h:13
const QStringList & supportedLanguages()
Language codes for which localized card data can be imported/displayed.
Definition card_localization.cpp:11
QString languageDisplayName(const QString &lang)
Human-readable name for a language code.
Definition card_localization.cpp:17
The card language and matching mode searches run against.
Definition card_localization.h:27
QString language
Card language code (e.g. "de"); empty means the English fallback.
Definition card_localization.h:28
SearchLanguageMode mode
How the language participates in the search.
Definition card_localization.h:29
bool operator==(const CardSearchLanguage &) const =default
bool isEnglishOnly() const
Whether only the English card data is searched.
Definition card_localization.h:36
bool operator!=(const CardSearchLanguage &) const =default