News for hackers. Stuff that matters.
Re:F-strings for C++26 proposal [pdf] by puffybuf on Sunday February 02, 2025 @06:59PM (#42913187)
how would this work with internationalized strings? especially if you have to change the order of things? You'd still need a string version with object ordering I would think
Re:F-strings for C++26 proposal [pdf] by mkoubaa on Sunday February 02, 2025 @07:19PM (#42913346)
I'm skeptical that people would want to do this in a single expression.
Re:F-strings for C++26 proposal [pdf] by rerdavies on Monday February 03, 2025 @03:32AM (#42916149)
Do what? Allow translators to reorder the appearance of arguments in a translated format string? It's a completely routine (and completely necessary) feature when doing translations.
Re:F-strings for C++26 proposal [pdf] by edflsafoiewq on Sunday February 02, 2025 @07:24PM (#42913383)
f-strings are not an internationalization library.
Re:F-strings for C++26 proposal [pdf] by wakawaka28 on Sunday February 02, 2025 @08:16PM (#42913809)
The question was, how would you use this if you have i18n requirements. Format strings are normally part of a translation. I think the bad answer is to embed the entire f-string for a translation as usual. The better answer is, don't use f-strings for this because you don't want translators to monkey around with code.
Re:F-strings for C++26 proposal [pdf] by mkoubaa on Monday February 03, 2025 @08:24AM (#42917960)
C++ is such a narrow skillset that I'd rather not roll the dice on translators knowing what to do
Re:F-strings for C++26 proposal [pdf] by wakawaka28 on Monday February 03, 2025 @08:42AM (#42918124)
Even if you told them, "just copy the names from the original string" it's still asking for trouble, and maybe even security holes if they don't follow instructions. But the biggest problem with the idea is surely that the strings need to be compiled.