ILocalizationManager

Interface to the Localization Manager. More...

#include

Public Types

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
}
typedef uint32 TLocalizationBitfield

Public Member Functions

virtual const char * LangNameFromPILID (const ILocalizationManager::EPlatformIndependentLanguageID id)=0
virtual ILocalizationManager::TLocalizationBitfield MaskSystemLanguagesFromSupportedLocalizations (const ILocalizationManager::TLocalizationBitfield systemLanguages)=0
virtual ILocalizationManager::TLocalizationBitfield IsLanguageSupported (const ILocalizationManager::EPlatformIndependentLanguageID id)=0
virtual bool SetLanguage (const char *sLanguage)=0
virtual const char * GetLanguage ()=0
virtual bool InitLocalizationData (const char *sFileName, bool bReload=false)=0
Load the descriptor file with tag information.
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 bool LoadLocalizationDataByTag (const char *sTag, bool bReload=false)=0
Direct load of loca data by tag.
virtual bool ReleaseLocalizationDataByTag (const char *sTag)=0
virtual void RegisterPostProcessor (ILocalizationPostProcessor *pPostProcessor)=0
virtual void UnregisterPostProcessor (ILocalizationPostProcessor *pPostProcessor)=0
virtual bool LoadExcelXmlSpreadsheet (const char *sFileName, bool bReload=false)=0
virtual void ReloadData ()=0
virtual void FreeData ()=0
Free localization data.
virtual bool LocalizeString (const char *sString, string &outLocalizedString, bool bEnglish=false)=0
virtual bool LocalizeString (const string &sString, string &outLocalizedString, bool bEnglish=false)=0
Same as LocalizeString( const char* sString, string& outLocalizedString, bool bEnglish=false ) but at the moment this is faster.
virtual bool LocalizeLabel (const char *sLabel, string &outLocalizedString, bool bEnglish=false)=0
virtual bool GetLocalizedInfoByKey (const char *sKey, SLocalizedInfoGame &outGameInfo)=0
virtual bool GetLocalizedInfoByKey (const char *sKey, SLocalizedSoundInfoGame *pOutSoundInfo)=0
virtual int GetLocalizedStringCount ()=0
Return number of localization entries.
virtual bool GetLocalizedInfoByIndex (int nIndex, SLocalizedInfoEditor &outEditorInfo)=0
virtual bool GetLocalizedInfoByIndex (int nIndex, SLocalizedInfoGame &outGameInfo)=0
virtual bool GetEnglishString (const char *sKey, string &sLocalizedString)=0
virtual bool GetSubtitle (const char *sKeyOrLabel, string &outSubtitle, bool bForceSubtitle=false)=0
virtual void FormatStringMessage (string &outString, const string &sString, const char **sParams, int nParams)=0
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 LocalizeTime (time_t t, bool bMakeLocalTime, bool bShowSeconds, string &outTimeString)=0
virtual void LocalizeDate (time_t t, bool bMakeLocalTime, bool bShort, bool bIncludeWeekday, string &outDateString)=0
virtual void LocalizeDuration (int seconds, string &outDurationString)=0
virtual void LocalizeNumber (int number, string &outNumberString)=0
virtual void LocalizeNumber (float number, int decimals, string &outNumberString)=0

Static Public Member Functions

static ILINE TLocalizationBitfield LocalizationBitfieldFromPILID (EPlatformIndependentLanguageID pilid)

Detailed Description

Interface to the Localization Manager.

Member Enumeration Documentation

◆ EPlatformIndependentLanguageID

Platform independent language IDs. Used to map the platform specific language codes 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.

Enumerator
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.

Member Function Documentation

◆ FormatStringMessage()

virtual void ILocalizationManager::FormatStringMessage ( string & outString,
const string & sString,
const char ** sParams,
int nParams
)
pure virtual

These methods format outString depending on sString with ordered arguments. FormatStringMessage(outString, "This is %2 and this is %1", "second", "first");

Parameters
[out]outStringThis is first and this is second.

◆ GetEnglishString()

virtual bool ILocalizationManager::GetEnglishString ( const char * sKey,
string & sLocalizedString
)
pure virtual

Get the english localization info structure corresponding to a key.

Parameters
[in]sKeyKey to be looked up. Key = Label without '@' sign.
[out]sLocalizedStringCorresponding english language string.
Returns
true if successful, false otherwise (key not found).

◆ GetLocalizedInfoByIndex() [1/2]

virtual bool ILocalizationManager::GetLocalizedInfoByIndex ( int nIndex,
SLocalizedInfoEditor & outEditorInfo
)
pure virtual

Get the localization info structure at index nIndex.

Parameters
[in]nIndexIndex.
[out]outEditorInfoReference to localization info structure to be filled in.
Returns
true if successful, false otherwise (out of bounds).

◆ GetLocalizedInfoByIndex() [2/2]

virtual bool ILocalizationManager::GetLocalizedInfoByIndex ( int nIndex,
SLocalizedInfoGame & outGameInfo
)
pure virtual

Get the localization info structure at index nIndex.

Parameters
[in]nIndexIndex.
[out]outGameInfoReference to localization info structure to be filled in.
Returns
true if successful, false otherwise (out of bounds).

◆ GetLocalizedInfoByKey() [1/2]

virtual bool ILocalizationManager::GetLocalizedInfoByKey ( const char * sKey,
SLocalizedInfoGame & outGameInfo
)
pure virtual

Get localization info structure corresponding to a key (key=label without the '@' sign).

Parameters
[in]sKeyKey to be looked up. Key = Label without '@' sign.
[out]outGameInfoReference to localization info structure to be filled in.
Returns
true if info for key was found, false otherwise.

◆ GetLocalizedInfoByKey() [2/2]

virtual bool ILocalizationManager::GetLocalizedInfoByKey ( const char * sKey,
SLocalizedSoundInfoGame * pOutSoundInfo
)
pure virtual

Get the sound localization info structure corresponding to a key.

Parameters
[in]sKeyKey to be looked up. Key = Label without '@' sign.
[out]outSoundInfoReference to sound info structure to be filled in. outSoundInfo.pSoundMoods requires nNumSoundMoods-times allocated memory. On return outSoundInfo.nNumSoundMoods will hold how many SoundsMood entries are needed. On return outSoundInfo.nNumEventParameters will hold how many EventParameter entries are needed. outSoundInfo.pEventParameters requires nNumEventParameters-times allocated memory. Passing 0 in either the Num fields will make the query ignore checking for allocated memory.
Returns
true if successful, false otherwise (key not found, or not enough memory provided to write additional info).

◆ GetSubtitle()

virtual bool ILocalizationManager::GetSubtitle ( const char * sKeyOrLabel,
string & outSubtitle,
bool bForceSubtitle = false
)
pure virtual

Get Subtitle for Key or Label.

Parameters
[in]sKeyOrLabelKey or Label to be used for subtitle lookup. Key = Label without '@' sign.
[out]outSubtitleSubtitle (untouched if Key/Label not found).
[in]bForceSubtitleIf true, get subtitle (sLocalized or sEnglish) even if not specified in Data file.
Returns
true if subtitle found (and outSubtitle filled in), false otherwise.

◆ LocalizeLabel()

virtual bool ILocalizationManager::LocalizeLabel ( const char * sLabel,
string & outLocalizedString,
bool bEnglish = false
)
pure virtual

Provides the localized version corresponding to a label. A label has to start with '@' sign.

Parameters
[in]sLabelLabel to be translated, must start with '@' sign.
[out]

◆ LocalizeString()

virtual bool ILocalizationManager::LocalizeString ( const char * sString,
string & outLocalizedString,
bool bEnglish = false
)
pure virtual

Translate a string into the currently selected language. Processes the input string and translates all labels contained into the currently selected language.

Parameters
[in]sStringString to be translated.
[out]outLocalizedStringTranslated version of the string.
[in]bEnglishIf true, translates the string into the always present English language.
Returns
true if localization was successful, false otherwise.