Class LocalizedStringDatabase | Localization | 0.6.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalizedStringDatabase

    Handles loading strings and their tables for the selected locale.

    Inheritance
    Object
    LocalizedDatabase<StringTable, StringTableEntry>
    LocalizedStringDatabase
    Inherited Members
    LocalizedDatabase<StringTable, StringTableEntry>.PreloadOperation
    LocalizedDatabase<StringTable, StringTableEntry>.ResourceManager
    LocalizedDatabase<StringTable, StringTableEntry>.DefaultTable
    LocalizedDatabase<StringTable, StringTableEntry>.GetTableAsync(TableReference, Locale)
    LocalizedDatabase<StringTable, StringTableEntry>.GetTableAsync(TableReference)
    LocalizedDatabase<StringTable, StringTableEntry>.GetTableEntryAsync(TableReference, TableEntryReference, Locale)
    LocalizedDatabase<StringTable, StringTableEntry>.GetTableEntryAsync(TableReference, TableEntryReference)
    LocalizedDatabase<StringTable, StringTableEntry>.OnLocaleChanged(Locale)
    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[])

    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>
    In This Article
    • Properties
      • NoTranslationFoundFormat
      • SmartFormatter
    • Methods
      • GetLocalizedStringAsync(TableEntryReference)
      • GetLocalizedStringAsync(TableEntryReference, Object[])
      • GetLocalizedStringAsync(TableEntryReference, Locale)
      • GetLocalizedStringAsync(TableEntryReference, Locale, Object[])
      • GetLocalizedStringAsync(TableReference, TableEntryReference)
      • GetLocalizedStringAsync(TableReference, TableEntryReference, Object[])
      • GetLocalizedStringAsync(TableReference, TableEntryReference, Locale)
      • GetLocalizedStringAsync(TableReference, TableEntryReference, Locale, Object[])
      • GetLocalizedStringAsyncInternal(TableReference, TableEntryReference, Locale, Object[])
      • GetLocalizedStringProcessTableEntry(AsyncOperationHandle<LocalizedDatabase<StringTable, StringTableEntry>.TableEntryResult>, TableEntryReference, Locale, Object[])
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023