localizedKey

Construct localized key name from key and locale.

  1. String localizedKey(String key, String locale)
    @safe pure nothrow
    String
    localizedKey
    (
    String
    )
    (
    String key
    ,
    String locale
    )
    if (
    isSomeString!String &&
    is(ElementEncodingType!String : char)
    )
  2. String localizedKey(String key, String lang, String country, String modifier)

Return Value

Type: String

localized key in form keylocale dropping encoding out if present.

Examples

string key = "Name";
assert(localizedKey(key, "") == key);
assert(localizedKey("Name", "ru_RU") == "Name[ru_RU]");
assert(localizedKey("Name", "ru_RU.UTF-8") == "Name[ru_RU]");

See Also

Meta