Skip to main content

Using Globalization in Applications

Requirements for Multi Language Support

  • CMake setting CANDERA_GLOBALIZATION_ENABLED is enabled
  • Sources of CanderaGlobalization available

Example: Set Culture in the Player

The Player provides, if Globalization is enabled in Candera, a checkbox to select all cultures, which are available as language packs in the loaded asset.

  1. Open the asset containing language packs (MultiLanguagePack_Asset_Host.bin) and load the scene in the Player.
  2. Select the desired language in the drop down list next to the globe icon in the top left corner
drawing-4-1677042956.png


Candera Globalization API

The following table explains the usage of Globalization interfaces and how they are used in application code.

Candera::Globalization::Culture Represents a language, region, and text direction
Candera::Globalization::CultureManager

Access to cultures and changing of current culture
Singleton: Candera::Globalization::CultureManager::GetInstance()

Retrieve available cultures:

    return CultureManager::GetInstance().GetCultureCount();

Get current culture:

    Culture::SharedPointer culture = CultureManager::GetInstance().GetCurrentCulture();

Get culture name:

    Culture::SharedPointer culture = CultureManager::GetInstance().GetCulture(index);
    return culture->GetDisplayName();

Set new culture:

    Culture::SharedPointer culture = CultureManager::GetInstance().GetCulture(index);
    FEATSTD_LOG_INFO(" -> Select culture '%s'", culture->GetDisplayName());
    rc = CultureManager::GetInstance().SetCurrentCulture(culture->GetLocale());
Candera::Globalization::CultureChangeListener

Base class for listeners to culture change events

Notification of CultureChangeEvents

FeatStd::String and FeatStd::TextId

Point of access to a text in currently active language

Non-translatable String

Translatable String