Cannot substitute multiple values

c# - System.Collections.Generic.List`1[System.String] instead of data - Stack Overflow got same result while trying to fill smart string with multiple values (tried strings and enum values).
String:
Excellent. We are moving, but too slow. This is good for maneuvers, but to get anywhere faster, you need to accelerate. Press {0} to increase speed. You can also decrease speed with {0} and switch speeds with the mouse
Code to display text:

_replicText.text = Smart.Format(result, keyCodes);

where keycodes is List of KeyCode objects. But with list of string I got same result. With smart library list formatting Create new page · axuno/SmartFormat Wiki · GitHub all works fine, but what can I do if I want to insert array elements into different parts of string?

Did you try passing the list as an argument in a list?
Like the example:

_replicText.text = Smart.Format(result,  new object[] { keyCodes });

no effect:
6427043--718658--upload_2020-10-17_9-0-41.png

The walkaround is to pass array elements individual, but not whole array as argument:
Text:
Excellent. We are moving, but too slow. This is good for maneuvers, but to get anywhere faster, you need to accelerate. Pressing will increase {0}, {1} will decrease the speed. You can also switch speeds with the mouse

if (keyCodes.Count == 0)
                {
                    _replicText.text = result;
                }
                //TODO: rewrite this
                else if(keyCodes.Count == 1)
                {

                    _replicText.text = Smart.Format(result, keyCodes[0]);
                }
                else if(keyCodes.Count == 2)
                {

                    _replicText.text = Smart.Format(result, keyCodes[0], keyCodes[1]);
                }
                else {
                    _replicText.text = Smart.Format(result, keyCodes);
                }

Maybe, this is not related to localization, but for Smart library itself. Maybe, I just using it wrongly, and there are proper way for use array elements in multiple places on the string exists

Oh I see. You want the individual elements from the array. Doing {0} etc will treat it like a normal String.Format argument.

I’ll have a closer look on Monday to see if it’s possible. You can always create a custom source if it’s not.

Edit: I just noticed you are using Smart. How are you fetching the strings? Have you tried passing the arguments in when you get the values instead of directly using Smart?

LocalizationSettings.StringDatabase.GetLocalizedStringAsync("General Test Data", "Test", new object[] { KeyCode.A, KeyCode.LeftShift });