Andrei Alexandrescu wrote:
The localized version will look like this:

auto format = "File `%s' not found, system error is %s.";
auto localFormat = currentLocale ? currentLocale.peek(format) : null;
if (!localFormat) localFormat = format;
throw Exception(localFormat, filename, errnomsg);

This short example suggests:
Locale.peek(T)(char[] key, T ifNotFound = T.init)

auto localFormat = currentLocale ? currentLocale.peek(format, format) : format;
throw new Exception(localFormat);

Reply via email to