1
General / Re: I hope FreePascal can support syntax like Python's f'string {variable}' or ...
« Last post by Fibonacci on Today at 04:45:25 am »Keep in mind also that if the substitutions are not runtime, how will you manage translation ?
One of the reasons format exists is that the strings can be translated.
These two concerns live in separate worlds.
Interpolation isn't a replacement for Format in user-facing translatable strings - it's a replacement for Format (and string concatenation) in the vast majority of strings that are never translated: log messages, exceptions, debug output, generated SQL, code generation, assertions, internal tooling, etc. If you want a translatable string, you still write it as a resourcestring and pass it to Format, exactly as today. Interpolation doesn't take that away.
And if anyone is worried about people accidentally interpolating a resourcestring, that's trivially solvable at the compiler level - forbid $'...' on a resourcestring, or warn on it.
Plenty of other languages have both interpolation and i18n side by side. Translation concerns never stopped any of them from adding interpolation - and they shouldn't here either.




Recent Posts
