Component:LocaleStringDriver: Difference between revisions

From Resonite Wiki
Automated: update DeDuplicate
add info
Line 3: Line 3:
|Name=Locale String Driver
|Name=Locale String Driver
}}
}}
{{stub}}
The '''LocaleStringDriver''' component is used to turn a key into a translated string from a locale, and then fill its value arguments with field contents or values.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Target|{{RootFieldType|FieldDrive`1|[[Type:String|String]]}}|TypeAdv0=true|
|Target|{{RootFieldType|FieldDrive`1|[[Type:String|String]]}}|TypeAdv0=true| The string field to drive with the final locale translation.
|Key|String|
|Key|String| The locale key to get a translation with.
|Format|String|
|Format|String| How to format the output.
|Locale|{{RootFieldType|AssetRef`1|[[Type:LocaleResource|LocaleResource]]}}|TypeAdv3=true|
|Locale|{{RootFieldType|AssetRef`1|[[Type:LocaleResource|LocaleResource]]}}|TypeAdv3=true| The locale resource to use <code>Key</code> on to get the translated string for.
|ArgumentSources|{{RootFieldType|SyncDictionary`2|[[Type:String|String]], [[Type:RelayRef`1|RelayRef`1]]&lt;[[Type:IField|IField]]&gt;}}|TypeAdv4=true|
|ArgumentSources|{{RootFieldType|SyncDictionary`2|[[Type:String|String]], [[Type:RelayRef`1|RelayRef`1]]&lt;[[Type:IField|IField]]&gt;}}|TypeAdv4=true| A list of argument strings in a locale translation and their fields to get the values for them from.
|ArgumentValues|{{RootFieldType|SyncDictionary`2|[[Type:String|String]], [[Type:SyncVar|SyncVar]]}}|TypeAdv5=true|
|ArgumentValues|{{RootFieldType|SyncDictionary`2|[[Type:String|String]], [[Type:SyncVar|SyncVar]]}}|TypeAdv5=true| A list of argument strings in a locale translation and their values.
}}
}}


== Sync Delegates ==
== Sync Delegates ==
{{Table ComponentTriggers
{{Table ComponentTriggers
|SetArgumentSource()|[[Type:Action`2|Action`2]]&lt;[[Type:String|String]]: key, [[Type:IField|IField]]: field&gt;|
|SetArgumentSource()|[[Type:Action`2|Action`2]]&lt;[[Type:String|String]]: key, [[Type:IField|IField]]: field&gt;| Set a translation's argument key to use a certain field as the value source.
|SetArgumentValue()|[[Type:Func`3|Func`3]]&lt;[[Type:String|String]]: key, [[Type:Object|Object]]: value&gt;|
|SetArgumentValue()|[[Type:Func`3|Func`3]]&lt;[[Type:String|String]]: key, [[Type:Object|Object]]: value&gt;| Set a translation's argument key to use a certain value.
}}
}}
== Behavior ==
== Examples ==


== See Also ==
== See Also ==
Line 29: Line 25:
[[Category:Components:Localization{{#translation:}}|Locale String Driver]]
[[Category:Components:Localization{{#translation:}}|Locale String Driver]]
[[Category:Components{{#translation:}}|Locale String Driver]]
[[Category:Components{{#translation:}}|Locale String Driver]]
[[Category:ComponentStubs]]

Revision as of 18:07, 23 January 2025

Component image 
Locale String Driver component as seen in the Scene Inspector

The LocaleStringDriver component is used to turn a key into a translated string from a locale, and then fill its value arguments with field contents or values.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Target field drive of String The string field to drive with the final locale translation.
Key String The locale key to get a translation with.
Format String How to format the output.
Locale LocaleResource The locale resource to use Key on to get the translated string for.
ArgumentSources direct SyncDictionary`2<String, RelayRef`1<IField>> A list of argument strings in a locale translation and their fields to get the values for them from.
ArgumentValues direct SyncDictionary`2<String, SyncVar> A list of argument strings in a locale translation and their values.

Sync Delegates

Lua error in mw.text.lua at line 25: bad argument #1 to 'match' (string expected, got nil).
Triggers
Method Name Method type and Arguments. Is the method hidden? Description

See Also