GetSmartFormatter()
Returns the Smart formatter used to format Smart String entries.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
public SmartFormatter GetSmartFormatter()
Returns
Type | Description |
|---|---|
| SmartFormatter | The Smart formatter that formats this project's entries. |
Remarks
Returns the formatter of LocalizationSettings.SmartStringsSettings when one is assigned, then the project's Smart Strings settings, and falls back to Smart.Default when the project has neither. The resource database uses this formatter when resolving Smart entries.
Additional Resources: LocalizationSettings.SmartStringsSettings
Formats a value with the active Smart formatter.
Examples
using Unity.Localization;using Unity.SmartStrings;using UnityEngine;namespace Unity.Localization.Samples{ public class GetSmartFormatterExample : MonoBehaviour { void Start() { SmartFormatter formatter = LocalizationSettings.Instance.GetSmartFormatter(); string result = formatter.Format("Hello {0}", "world"); Debug.Log(result); } }}