Again on runtime format 'strings'

After searching the forum about that topic and understanding pretty little of what I found (but most of it seems collateral to my main question), I keep needing them.

Sure,

  1. including in the code base only the formatting code actually needed is nice (even if code size in most cases is not the most pressing concern),

  2. having the correspondence between format codes and parameter types checked while compiling is even nicer, but

  3. not being able to do any formatting with format string known only at runtime is bad.

For instance, I have ready a small collection of Zig packages implementing a) locale detection, b) locale-driven GNU-gettext-like multi-language outputting with 26 pluraliser functions covering the needs of 220+ languages and c) PO/POT extraction from Zig sources, but I am stuck as it can be used only with fixed, non-formatting strings, making useless all the plural management and then partly useless the whole thing (I kind of knew this from the beginning, but I tried anyway, also as a way to familiarise myself with the language).

Am I missing something? Are there alternatives I am not aware of? Any hope the language will ‘soon’ support at least some form of runtime-known format strings or shall I ‘simply’ implement the missing parts myself within my packages? (Actually, I could do with just supporting “{d}” and “{d}”). Or shall I just rely on ‘C’ compatibility and resort to GNU-gettext itself?

Thanks for any suggestion, comment, criticism!

I believe the mechanisms to store anytype of arguments and any number of formatting ‘positions’ i.e all the ‘{d}’ requires some allocation/type erasure we don’t find anywhere else. Since your use case seems to be about localization, I guess you only need to store strings as argument, which could make your problem both easier to solve and less interesting to have in a standard library.