https://issues.dlang.org/show_bug.cgi?id=19776
Iain Buclaw <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Iain Buclaw <[email protected]> --- As well as making sure the format string of errors are translation-friendly, there's also a couple of functions - verror and vdeprecation - that have optional parameters. Incidentally, they are only ever set as `kind()` and `toPrettyChars()`. The former kind() function returns a string literal, such as declaration (déclaration), template (patron), function (fonction), etc... However these will never be translated unless the function kind() returns calling gettext(). A bare minimal example being: > // module dmd.errors; > nothrow @nogc > { > version (ENABLE_NLS) > { > extern (C) const(char)* gettext(scope const char* msgid); > } > else > { > const(char)* gettext(scope const char* msgid) > { > pragma(inline, true); > return msgid; > } > } > } > > alias _ = gettext; > > // module dmd.func; > extern (C++) class FuncDeclaration : Declaration > { > override const(char)* kind() const > { > return generated ? _("generated function") : _("function"); > } > } --
