Interface to the Localization Manager.
struct ILocalizationManager { enum EPlatformIndependentLanguageID { ePILID_Japanese, ePILID_English, ePILID_French, ePILID_Spanish, ePILID_German, ePILID_Italian, ePILID_Dutch, ePILID_Portuguese, ePILID_Russian, ePILID_Korean, ePILID_ChineseT, ePILID_ChineseS, ePILID_Finnish, ePILID_Swedish, ePILID_Danish, ePILID_Norwegian, ePILID_Polish, ePILID_Arabic, ePILID_Czech, ePILID_Turkish, ePILID_MAX_OR_INVALID }; };
ILocalizationManager.h
enum EPlatformIndependentLanguageID { ePILID_Japanese, ePILID_English, ePILID_French, ePILID_Spanish, ePILID_German, ePILID_Italian, ePILID_Dutch, ePILID_Portuguese, ePILID_Russian, ePILID_Korean, ePILID_ChineseT, ePILID_ChineseS, ePILID_Finnish, ePILID_Swedish, ePILID_Danish, ePILID_Norwegian, ePILID_Polish, ePILID_Arabic, ePILID_Czech, ePILID_Turkish, ePILID_MAX_OR_INVALID };
ILocalizationManager.h
Members |
Description |
ePILID_ChineseT |
Traditional Chinese |
ePILID_ChineseS |
Simplified Chinese |
ePILID_Arabic |
Test value for PS3. Not currently supported by Sony on the PS3 as a system language |
ePILID_MAX_OR_INVALID |
Not a language, denotes the maximum number of languages or an unknown language |
Platform independent language IDs. These are used to map the platform specific language codes on the PS3 and 360 to localization pakfiles Please ensure that each entry in this enum has a corresponding entry in the PLATFORM_INDEPENDENT_LANGUAGE_NAMES array which is defined in LocalizedStringManager.cpp currently.
virtual ~ILocalizationManager();
virtual void FormatStringMessage(string& outString, const string& sString, const char* param1, const char* param2 = 0, const char* param3 = 0, const char* param4 = 0) = 0;
virtual void FormatStringMessage(string& outString, const string& sString, const char** sParams, int nParams) = 0;
Parameters |
Description |
string& outString |
This is first and this is second. |
These methods format outString depending on sString with ordered arguments FormatStringMessage(outString, "This is %2 and this is %1", "second", "first");
virtual void FormatStringMessage(wstring& outString, const wstring& sString, const wchar_t* param1, const wchar_t* param2 = 0, const wchar_t* param3 = 0, const wchar_t* param4 = 0) = 0;
virtual void FormatStringMessage(wstring& outString, const wstring& sString, const wchar_t** sParams, int nParams) = 0;
Free localization data.
virtual void FreeData() = 0;
Get the english localization info structure corresponding to a key.
virtual bool GetEnglishString(const char * sKey, string & sLocalizedString) = 0;
Parameters |
Description |
const char * sKey |
Key to be looked up. Key = Label without '@' sign. |
string & sLocalizedString |
Corresponding english language string. |
True if successful, false otherwise (key not found).
virtual const char* GetLanguage() = 0;
Get the localization info structure at index nIndex.
virtual bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoEditor& outEditorInfo) = 0;
Parameters |
Description |
int nIndex |
Index. |
SLocalizedInfoEditor& outEditorInfo |
Reference to localization info structure to be filled in. |
True if successful, false otherwise (out of bounds).
Get the localization info structure at index nIndex.
virtual bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoGame& outGameInfo) = 0;
Parameters |
Description |
int nIndex |
Index. |
SLocalizedInfoGame& outGameInfo |
Reference to localization info structure to be filled in. |
True if successful, false otherwise (out of bounds).
Get localization info structure corresponding to a key (key=label without the '@' sign).
virtual bool GetLocalizedInfoByKey(const char* sKey, SLocalizedInfoGame& outGameInfo) = 0;
Parameters |
Description |
const char* sKey |
Key to be looked up. Key = Label without '@' sign. |
SLocalizedInfoGame& outGameInfo |
Reference to localization info structure to be filled in. |
True if info for key was found, false otherwise.
Get the sound localization info structure corresponding to a key.
virtual bool GetLocalizedInfoByKey(const char* sKey, SLocalizedSoundInfoGame* pOutSoundInfo) = 0;
Parameters |
Description |
const char* sKey |
Key to be looked up. Key = Label without '@' sign. |
outSoundInfo |
reference to sound info structure to be filled in pSoundMoods requires nNumSoundMoods-times allocated memory on return nNumSoundMoods will hold how many SoundsMood entries are needed pEventParameters requires nNumEventParameters-times allocated memory on return nNumEventParameters will hold how many EventParameter entries are needed Passing 0 in the Num fields will make the query ignore checking for allocated memory |
True if successful, false otherwise (key not found, or not enough memory provided to write additional info).
Return number of localization entries.
virtual int GetLocalizedStringCount() = 0;
Get Subtitle for Key or Label .
virtual bool GetSubtitle(const char* sKeyOrLabel, wstring& outSubtitle, bool bForceSubtitle = false) = 0;
Parameters |
Description |
const char* sKeyOrLabel |
Key or Label to be used for subtitle lookup. Key = Label without '@' sign. |
wstring& outSubtitle |
Subtitle (untouched if Key/Label not found). |
bool bForceSubtitle = false |
If true, get subtitle (sLocalized or sEnglish) even if not specified in Data file. |
True if subtitle found (and outSubtitle filled in), false otherwise.
virtual bool InitLocalizationData(const char* sFileName, bool bReload = false) = 0;
load the descriptor file with tag information
virtual ILocalizationManager::TLocalizatonBitfield IsLanguageSupported(const ILocalizationManager::EPlatformIndependentLanguageID id) = 0;
virtual const char* LangNameFromPILID(const ILocalizationManager::EPlatformIndependentLanguageID id) = 0;
virtual bool LoadExcelXmlSpreadsheet(const char* sFileName, bool bReload = false) = 0;
virtual bool LoadLocalizationDataByTag(const char* sTag, bool bReload = false) = 0;
direct load of loca data by tag
static TLocalizatonBitfield LocalizationBitfieldFromPILID(EPlatformIndependentLanguageID pilid);
virtual void LocalizeDate(time_t t, bool bMakeLocalTime, bool bShort, bool bIncludeWeekday, wstring& outDateString) = 0;
virtual void LocalizeDuration(int seconds, wstring& outDurationString) = 0;
Return the localized version corresponding to a label.
virtual bool LocalizeLabel(const char* sLabel, wstring& outLocalizedString, bool bEnglish = false, ITempLocStringStorage** ppTmpStorage = 0) = 0;
Parameters |
Description |
const char* sLabel |
Label to be translated, must start with '@' sign. |
wstring& outLocalizedString |
Localized version of the label. |
bool bEnglish = false |
if true, returns the always present English version of the label. |
True if localization was successful, false otherwise.
A label has to start with '@' sign.
virtual void LocalizeNumber(float number, int decimals, wstring& outNumberString) = 0;
virtual void LocalizeNumber(int number, wstring& outNumberString) = 0;
Translate a string into the currently selected language.
virtual bool LocalizeString(const char* sString, wstring& outLocalizedString, bool bEnglish = false) = 0;
Parameters |
Description |
const char* sString |
String to be translated. |
wstring& outLocalizedString |
Translated version of the string. |
bool bEnglish = false |
if true, translates the string into the always present English language. |
true if localization was successful, false otherwise
Processes the input string and translates all labels contained into the currently selected language.
Same as LocalizeString( const char* sString, wstring& outLocalizedString, bool bEnglish=false ) but at the moment this is faster.
virtual bool LocalizeString(const string& sString, wstring& outLocalizedString, bool bEnglish = false) = 0;
virtual void LocalizeTime(time_t t, bool bMakeLocalTime, bool bShowSeconds, wstring& outTimeString) = 0;
virtual ILocalizationManager::TLocalizatonBitfield MaskSystemLanguagesFromSupportedLocalizations(const ILocalizationManager::TLocalizatonBitfield systemLanguages) = 0;
virtual bool ReleaseLocalizationDataByTag(const char* sTag) = 0;
virtual void ReloadData() = 0;
virtual bool RequestLoadLocalizationDataByTag(const char* sTag) = 0;
request to load loca data by tag. Actual loading will happen during next level load begin event.
virtual void SetAvailableLocalizationsBitField(const ILocalizationManager::TLocalizatonBitfield availableLocalizations) = 0;
virtual void SetAvailableLocalizationsCSVString(const char * sAvailableLocalizations) = 0;
virtual bool SetLanguage(const char* sLanguage) = 0;
virtual wchar_t ToLowerCase(wchar_t c) = 0;
virtual wchar_t ToUpperCase(wchar_t c) = 0;
typedef uint32 TLocalizatonBitfield;