Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardLocalization Namespace Reference

Shared language metadata for localized card text and images. More...

Functions

QString displayLang ()
 The language code selected for localized card text and images.
QString displayName (const CardInfoPtr &card)
 Card name in the configured display language, falling back to English.
QString displayText (const CardInfoPtr &card)
 Card rules text in the configured display language, falling back to English.
QString displayName (const CardInfo &card)
 Card name in the configured display language, falling back to English.
QString displayText (const CardInfo &card)
 Card rules text in the configured display language, falling back to English.
QString displayNameFor (const QString &cardName)
 Looks a card up by its canonical name and returns its name in the configured display language.
const QStringList & supportedLanguages ()
 Language codes for which localized card data can be imported/displayed.
QString languageDisplayName (const QString &lang)
 Human-readable name for a language code.

Detailed Description

Shared language metadata for localized card text and images.

Lists the language codes Cockatrice can display localized card data for and provides human-readable names. The list is shared between Oracle (which imports the selected language's card data) and the client settings UI (which offers the language choice).

Function Documentation

◆ displayLang()

QString CardLocalization::displayLang ( )
inline

The language code selected for localized card text and images.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayName() [1/2]

QString CardLocalization::displayName ( const CardInfo & card)
inline

Card name in the configured display language, falling back to English.

Parameters
cardThe card to display.
Here is the call graph for this function:

◆ displayName() [2/2]

QString CardLocalization::displayName ( const CardInfoPtr & card)
inline

Card name in the configured display language, falling back to English.

Parameters
cardThe card to display.
Returns
The localized name, or an empty string for a null card.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayNameFor()

QString CardLocalization::displayNameFor ( const QString & cardName)
inline

Looks a card up by its canonical name and returns its name in the configured display language.

Use this where only the canonical name is known, such as the game log or [card] chat tags. Callers that already hold a resolved card and need to keep the canonical name around (as a link target, say) should use displayName() directly instead.

Parameters
cardNameThe canonical card name.
Returns
The localized name, or cardName unchanged when the card is unknown to the database.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayText() [1/2]

QString CardLocalization::displayText ( const CardInfo & card)
inline

Card rules text in the configured display language, falling back to English.

Parameters
cardThe card to display.
Here is the call graph for this function:

◆ displayText() [2/2]

QString CardLocalization::displayText ( const CardInfoPtr & card)
inline

Card rules text in the configured display language, falling back to English.

Parameters
cardThe card to display.
Returns
The localized text, or an empty string for a null card.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ languageDisplayName()

QString CardLocalization::languageDisplayName ( const QString & lang)
nodiscard

Human-readable name for a language code.

Follows the same "native name (English name)" format the UI language list uses (e.g. "日本語 (Japanese)"), so the English fallback is always visible.

Parameters
langLanguage code (e.g. "de", "ja", "zhs").
Returns
The language's native name with its English name in parentheses, or the code itself if it cannot be resolved.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ supportedLanguages()

const QStringList & CardLocalization::supportedLanguages ( )
nodiscard

Language codes for which localized card data can be imported/displayed.

Matches the languages Scryfall can serve localized card images for. "en" is always available as the default/fallback and is not listed here.

Returns
The list of supported language codes.
Here is the call graph for this function:
Here is the caller graph for this function: