Hi! I’m getting to know Unity’s localization solution. So far so good, but I believe I’ve met a bug/strange behaviour.
Suppose I have following methods
code
private LocalizedString LocalizedString;
private void SetupWithArguments(IProperty<Int32> property)
{
var localizationVariable = new IntVariable();
property.ValueChanged += updatedValue =>
{
localizationVariable.Value = updatedValue;
LocalizedString.RefreshString();
};
LocalizedString.Arguments.Add(localizationVariable);
}
private void SetupWithAdd(IProperty<Int32> property)
{
var localizationVariable = new IntVariable();
property.ValueChanged += updatedValue =>
{
localizationVariable.Value = updatedValue;
};
LocalizedString.Add("0", localizationVariable);
}
No, I don’t really understand why do I have to manually invoke RefreshString when I’m adding localizationVariable via Arguments, while adding it using LocalizedString’s Add method updates string automatically when changed.
Is it an intented behaviour or bug?