Plural formatter doesn't accept ObjectReference variables?

Hi there,

I can submit a proper bug report about this if it’s needed for tracking, but thought I’d post here first in case it it’s actually a configuration issue on my side. We’re on v1.0.1 of the package.

We have a string table entry with english contents like “{ComboValue:plural:hit|hits}” with “smart string” ticked, and then have a MonoBehaviour that exposes a ComboValue integer property. We then have a LocalizeStringEvent using that string reference, with an ObjectReference local variable for ComboValue pointing to that component.

In both the smart preview and at runtime, the string fails to be formatted. Tried using ordinal “0”, as well as named “ComboValue” selector, but neither worked. Also tried making the exposed value a field instead of a property but same issue.

Changing from an Object local variable to an Int local variable formatted just fine though, which makes me think it’s a bug with the plural/object reference and not with the format pattern?

Cheers,
Geordie

Looks like you need to do 0.ComboValue

The first picks the instance and the second picks the property inside the instance.

Hm I gave that a try but it still seems to complain?

Is that expected for that syntax to need to change between formatter types? Because the “cond” formatter did seem to accept it without the 0. prefix, it just left the questionmark at the start of the case. Although maybe I’m just misunderstanding the nuances + implicit behaviour of the selector process, and how that relates between the (indexed) arguments array passed programatically vs the named local/global variables you set up in the inspector.

Eg. I would have expected since there aren’t any arguments passed programatically, that the “0” ordinal wouldn’t even be available, and that you’d have to use named arguments that correspond to a variable name defined in the local or global variables list?

Ah yes you are right, 0 wont work. We did at one point set the first local variable as item 0 but that didn’t get into the release. So I think you want ComboValue.ComboValue:plural:
Assuming the property is also called ComboValue.
The first ComboValue to select the local variable and the 2nd to select the property inside the instance.