Class LocalizedStringDatabase
Handles loading strings and their tables for the selected locale.
Inherited Members
Namespace: UnityEngine.Localization.Settings
Syntax
[Serializable]
public class LocalizedStringDatabase : LocalizedDatabase<StringTable, StringTableEntry>, IPreloadRequired
Properties
MissingTranslationState
Declaration
public MissingTranslationBehavior MissingTranslationState { get; set; }
Property Value
Type | Description |
---|---|
MissingTranslationBehavior |
NoTranslationFoundMessage
The message to display when a string can not be localized. The final string will be created using String.Format where format item 0 contains the original string.
Declaration
public string NoTranslationFoundMessage { get; set; }
Property Value
Type | Description |
---|---|
String |
SmartFormatter
The SmartFormatter that will be used for all smart string operations.
Declaration
public SmartFormatter SmartFormatter { get; set; }
Property Value
Type | Description |
---|---|
SmartFormatter |
Methods
GenerateLocalizedString(StringTable, StringTableEntry, TableReference, TableEntryReference, Locale, Object[])
Declaration
protected virtual string GenerateLocalizedString(StringTable table, StringTableEntry entry, TableReference tableReference, TableEntryReference tableEntryReference, Locale locale, object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
StringTable | table | |
StringTableEntry | entry | |
TableReference | tableReference | |
TableEntryReference | tableEntryReference | |
Locale | locale | |
Object[] | arguments |
Returns
Type | Description |
---|---|
String |
GetLocalizedStringAsync(TableEntryReference, Locale, FallbackBehavior, Object[])
Attempts to retrieve a string from the requested table. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public AsyncOperationHandle<string> GetLocalizedStringAsync(TableEntryReference tableEntryReference, Locale locale = null, FallbackBehavior fallbackBehavior = FallbackBehavior.UseProjectSettings, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | tableEntryReference | A reference to the entry in the StringTable |
Locale | locale | The Locale to use instead of the default SelectedLocale |
FallbackBehavior | fallbackBehavior | A Enum which determines if a Fallback should be used when no value could be found for the Locale. |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableReference, TableEntryReference, Locale, FallbackBehavior, Object[])
Attempts to retrieve a string from the requested table. The string will first be formatted with UnityEngine.Localization.SmartFormat if IsSmart is enabled otherwise it will use String.Format. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public virtual AsyncOperationHandle<string> GetLocalizedStringAsync(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale = null, FallbackBehavior fallbackBehavior = FallbackBehavior.UseProjectSettings, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | A reference to the table to check for the string. |
TableEntryReference | tableEntryReference | A reference to the entry in the StringTable |
Locale | locale | The Locale to use instead of the default SelectedLocale |
FallbackBehavior | fallbackBehavior | A Enum which determines if a Fallback should be used when no value could be found for the Locale. |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |