3 ms·
> Typical printf usage is imperative and additive: > if (enter) printf("Hello "); else printf("Goodbye "); printf("World!\n"); And unless you want your transl
by mananaysiempre 3y ago
> Typical printf usage is imperative and additive:
> if (enter) printf("Hello "); else printf("Goodbye "); printf("World!\n");
And unless you want your translator to hate your guts, you really, really mustn’t do this in user-facing output.
(OK, you can if you really want to and if you’re ready to give them the same tools[1], but it won’t be simple. Although I’m unaware of any professional translators supporting this either—most use a CAT, and this approach is deeply incompatible with all existing ones.)
[1] https://projectfluent.org/ https://projectfluent.org/
- yyyk 3y agoWell, the issue still exists if we used regular sentences ending with a newline, allowing nice stuff for translators like printf positional arguments. The problem is that you have implicit state - the layout of the console or the columns of a json/xml - and no decent way to maintain it in a format string (because C tooling is poor, because this interface isn't entirely typesafe, etc.).