Show / Hide Table of Contents

    Class Rosetta

    Rosetta i18n management at run-time.

    Inheritance
    System.Object
    Rosetta
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Rosetta.Runtime
    Assembly: Rosetta.Runtime.dll
    Syntax
    public static class Rosetta

    Fields

    | Improve this Doc View Source

    DevLocale

    Default language for game development.

    Declaration
    public static LangFlag DevLocale
    Field Value
    Type Description
    LangFlag
    | Improve this Doc View Source

    I18NAudioCache

    The I18N AudioClip cache.Storage by space.

    Declaration
    public static Dictionary<string, Dictionary<string, AudioClip>> I18NAudioCache
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<System.String, UnityEngine.AudioClip>>
    | Improve this Doc View Source

    I18NFontCache

    The I18N Font cache.

    Declaration
    public static Dictionary<string, Font> I18NFontCache
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, UnityEngine.Font>
    | Improve this Doc View Source

    I18NSpriteCache

    The I18N Sprite cache.Storage by space.

    Declaration
    public static Dictionary<string, Dictionary<string, Sprite>> I18NSpriteCache
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<System.String, UnityEngine.Sprite>>
    | Improve this Doc View Source

    I18NTextCache

    The I18N String cache.Storage by space.

    Declaration
    public static Dictionary<string, Dictionary<string, string>> I18NTextCache
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<System.String, System.String>>
    | Improve this Doc View Source

    I18NTextFileType

    I18N File type of text file.

    Declaration
    public static I18NFileType I18NTextFileType
    Field Value
    Type Description
    I18NFileType
    | Improve this Doc View Source

    I18NTMPFontCache

    The I18N TMP_FontAsset cache.

    Declaration
    public static Dictionary<string, TMP_FontAsset> I18NTMPFontCache
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, TMPro.TMP_FontAsset>
    | Improve this Doc View Source

    LangNames

    The dictionary of language names.

    Declaration
    public static readonly Dictionary<LangFlag, string> LangNames
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<LangFlag, System.String>
    | Improve this Doc View Source

    Loaders

    All I18N File Loader.

    Declaration
    public static Dictionary<I18NFileType, LoaderBase> Loaders
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<I18NFileType, LoaderBase>
    | Improve this Doc View Source

    LoadPath

    ToDo: error I18N files load path.

    Declaration
    public static readonly List<string> LoadPath
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>
    | Improve this Doc View Source

    MultiMediaLoader

    Declaration
    public static MultiMediaLoader MultiMediaLoader
    Field Value
    Type Description
    MultiMediaLoader

    Properties

    | Improve this Doc View Source

    Locale

    Default language for game runtime.

    Declaration
    public static LangFlag Locale { get; set; }
    Property Value
    Type Description
    LangFlag

    Methods

    | Improve this Doc View Source

    ClearAllCache()

    Clean All I18N Resource Cache(Text\Sprite\Audio\Font).

    Declaration
    public static void ClearAllCache()
    | Improve this Doc View Source

    GetAudio(String, String)

    Returns the selected AudioClip resource for the current language.

    Declaration
    public static AudioClip GetAudio(string resName, string i18NSpace)
    Parameters
    Type Name Description
    System.String resName
    System.String i18NSpace
    Returns
    Type Description
    UnityEngine.AudioClip
    | Improve this Doc View Source

    GetFont(String)

    Returns the selected Font resource for the current language.

    Declaration
    public static Font GetFont(string resName)
    Parameters
    Type Name Description
    System.String resName
    Returns
    Type Description
    UnityEngine.Font
    | Improve this Doc View Source

    GetSprite(String, String)

    Returns the selected Sprite resource for the current language.

    Declaration
    public static Sprite GetSprite(string resName, string i18NSpace)
    Parameters
    Type Name Description
    System.String resName
    System.String i18NSpace
    Returns
    Type Description
    UnityEngine.Sprite
    | Improve this Doc View Source

    GetText(String, String)

    Returns the selected text for the current language.

    Declaration
    public static string GetText(string i18NString, string i18NSpace)
    Parameters
    Type Name Description
    System.String i18NString
    System.String i18NSpace
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetTMP_Font(String)

    Returns the selected TMP_FontAsset resource for the current language.

    Declaration
    public static TMP_FontAsset GetTMP_Font(string resName)
    Parameters
    Type Name Description
    System.String resName
    Returns
    Type Description
    TMPro.TMP_FontAsset
    | Improve this Doc View Source

    Init(LangFlag, LangFlag, List<String>, I18NFileType)

    Initialize the Rosetta.

    Declaration
    public static void Init(LangFlag devLocale, LangFlag locale, List<string> i18NSpaces, I18NFileType textFileType = I18NFileType.Po)
    Parameters
    Type Name Description
    LangFlag devLocale

    Default language for game development.

    LangFlag locale

    Default language for game runtime.

    System.Collections.Generic.List<System.String> i18NSpaces

    All Runtime default i18n space

    I18NFileType textFileType

    I18N File type of text file.

    | Improve this Doc View Source

    Init(Nullable<LangFlag>)

    Initialize the Rosetta by RosettaRuntimeSetting.

    Declaration
    public static void Init(LangFlag? locale = default(LangFlag? ))
    Parameters
    Type Name Description
    System.Nullable<LangFlag> locale

    Default language for game runtime.

    | Improve this Doc View Source

    IsDefault()

    Returns true if Locale equals DevLocale.

    Declaration
    public static bool IsDefault()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LoadI18NResSpace(String)

    Load given space I18N Resource.

    Declaration
    public static void LoadI18NResSpace(string space)
    Parameters
    Type Name Description
    System.String space

    Space to be unloaded

    | Improve this Doc View Source

    UnloadI18NResSpace(String)

    Destroys and removes all given space I18N resource cache.

    Declaration
    public static void UnloadI18NResSpace(string space)
    Parameters
    Type Name Description
    System.String space

    Space to be unloaded

    Events

    | Improve this Doc View Source

    I18NFileMissing

    Subscribe to this event to get notified when the I18N Files are missing.

    Declaration
    public static event Action<LangFlag, Exception> I18NFileMissing
    Event Type
    Type Description
    System.Action<LangFlag, System.Exception>
    | Improve this Doc View Source

    I18NStringMissing

    Subscribe to this event to get notified when the I18N strings are missing.

    Declaration
    public static event Action<LangFlag, string, string> I18NStringMissing
    Event Type
    Type Description
    System.Action<LangFlag, System.String, System.String>
    | Improve this Doc View Source

    LocaleChanged

    Subscribe to this event to get notified when the locale has changed.

    Declaration
    public static event Action<LangFlag> LocaleChanged
    Event Type
    Type Description
    System.Action<LangFlag>
    • Improve this Doc
    • View Source
    • 0 Comments
    Back to top Copyright © Shitake.
    Generated by DocFX