Class I18NUtils
- Namespace
- JLChnToZ.VRC.Foundation.I18N.Editors
Editor utilities for I18N. For drawing localized content, dialogs, and language selection field.
public static class I18NUtils
- Inheritance
-
I18NUtils
- Inherited Members
Methods
DisplayLocalizedDialog1(EditorI18N, string)
Get localized dialog with one button.
public static void DisplayLocalizedDialog1(this EditorI18N i18n, string key)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
Remarks
The dialog should have three keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text.
DisplayLocalizedDialog1(EditorI18N, string, params object[])
Get localized dialog with one button.
public static void DisplayLocalizedDialog1(this EditorI18N i18n, string key, params object[] args)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
argsobject[]The format arguments.
Remarks
The dialog should have three keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text.
DisplayLocalizedDialog2(EditorI18N, string)
Get localized dialog with two buttons.
public static bool DisplayLocalizedDialog2(this EditorI18N i18n, string key)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
Returns
- bool
The result of the dialog.
Remarks
The dialog should have four keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text, which returns
true. - {key}:negativeThe negative button text, which returns
false.
DisplayLocalizedDialog2(EditorI18N, string, params object[])
Get localized dialog with two buttons.
public static bool DisplayLocalizedDialog2(this EditorI18N i18n, string key, params object[] args)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
argsobject[]
Returns
- bool
The result of the dialog.
Remarks
The dialog should have four keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text, which returns
true. - {key}:negativeThe negative button text, which returns
false.
DisplayLocalizedDialog3(EditorI18N, string)
Get localized dialog with three buttons.
public static int DisplayLocalizedDialog3(this EditorI18N i18n, string key)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
Returns
- int
The result of the dialog.
Remarks
The dialog should have five keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text, which returns
0. - {key}:negativeThe negative button text, which returns
1. - {key}:altThe alternative button text, which returns
2.
DisplayLocalizedDialog3(EditorI18N, string, params object[])
Get localized dialog with three buttons.
public static int DisplayLocalizedDialog3(this EditorI18N i18n, string key, params object[] args)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the dialog.
argsobject[]
Returns
- int
The result of the dialog.
Remarks
The dialog should have five keys:
- {key}:titleThe title of the dialog.
- {key}:contentThe content of the dialog.
- {key}:positiveThe positive button text, which returns
0. - {key}:negativeThe negative button text, which returns
1. - {key}:altThe alternative button text, which returns
2.
DrawLocaleField()
Draw a language selection field.
public static void DrawLocaleField()
GetLocalizedContent(EditorI18N, string)
Get localized content.
public static GUIContent GetLocalizedContent(this EditorI18N i18n, string key)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the content.
Returns
- GUIContent
The localized content.
Remarks
The content should have two keys:
- {key}The content of the key.
- {key}:tooltipOptional, the tooltip of the content.
GetLocalizedContent(EditorI18N, string, GUIContent)
Get localized content.
public static void GetLocalizedContent(this EditorI18N i18n, string key, GUIContent content)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the content.
contentGUIContentThe content to be filled with localized text and tooltip.
Remarks
The content should have two keys:
- {key}The content of the key.
- {key}:tooltipOptional, the tooltip of the content.
GetLocalizedContent(EditorI18N, string, params object[])
Get localized content.
public static GUIContent GetLocalizedContent(this EditorI18N i18n, string key, params object[] format)
Parameters
i18nEditorI18NThe I18N instance.
keystringThe key of the content.
formatobject[]The format arguments.
Returns
- GUIContent
The localized content.
Remarks
The content should have two keys:
- {key}The content of the key.
- {key}:tooltipOptional, the tooltip of the content.
GetLocalizedEnum(EditorI18N, Type, string)
public static I18NUtils.LocalizedEnum GetLocalizedEnum(this EditorI18N i18n, Type type, string key = null)
Parameters
i18nEditorI18NtypeTypekeystring