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
NoTranslationFoundFormat
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 NoTranslationFoundFormat { 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
GetLocalizedStringAsync(TableEntryReference)
Attempts to retrieve a string from the default StringTable. 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)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | tableEntryReference |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableEntryReference, Object[])
Attempts to retrieve a string from the default StringTable. 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, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | tableEntryReference | A reference to the entry in the DefaultTable |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableEntryReference, Locale)
Attempts to retrieve a string from the default StringTable. 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)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | tableEntryReference | |
Locale | locale | The Locale to use instead of the default SelectedLocale |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableEntryReference, Locale, Object[])
Attempts to retrieve a string from the default StringTable. 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, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
TableEntryReference | tableEntryReference | A reference to the entry in the DefaultTable |
Locale | locale | The Locale to use instead of the default SelectedLocale |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableReference, TableEntryReference)
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(TableReference tableReference, TableEntryReference tableEntryReference)
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 |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableReference, TableEntryReference, 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 AsyncOperationHandle<string> GetLocalizedStringAsync(TableReference tableReference, TableEntryReference tableEntryReference, 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 |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableReference, TableEntryReference, Locale)
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(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale)
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 |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsync(TableReference, TableEntryReference, Locale, 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 AsyncOperationHandle<string> GetLocalizedStringAsync(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale, 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 |
Object[] | arguments | Arguments passed to SmartFormat or String.Format. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringAsyncInternal(TableReference, TableEntryReference, Locale, Object[])
Attempts to retrieve a string from the default StringTable. 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
protected virtual AsyncOperationHandle<string> GetLocalizedStringAsyncInternal(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale, object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | |
TableEntryReference | tableEntryReference | |
Locale | locale | |
Object[] | arguments |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |
GetLocalizedStringProcessTableEntry(AsyncOperationHandle<LocalizedDatabase<StringTable, StringTableEntry>.TableEntryResult>, TableEntryReference, Locale, Object[])
Converts a StringTableEntry into a translated string. Any Smart Format or String.Format operations and pseudo-localization are performed here.
Declaration
protected virtual AsyncOperationHandle<string> GetLocalizedStringProcessTableEntry(AsyncOperationHandle<LocalizedDatabase<StringTable, StringTableEntry>.TableEntryResult> entryOp, TableEntryReference tableEntryReference, Locale locale, object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
AsyncOperationHandle<LocalizedDatabase.TableEntryResult<>> | entryOp | The handle generated from calling |
TableEntryReference | tableEntryReference | |
Locale | locale | |
Object[] | arguments | Arguments to be passed to Smart Format or String.Format. If null then no formatting will be performed. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<String> |