Function separateFromLocale

Separate key name into non-localized key and locale name. If key is not localized returns original key and empty string.

auto auto separateFromLocale(String) (
  String key
) pure nothrow @nogc @trusted
if (isSomeString!String && is(ElementEncodingType!String : char));

Returns

tuple of key and locale name.

See Also

localizedKey

Example

assert(separateFromLocale("Name[ru_RU]") == tuple("Name", "ru_RU"));
assert(separateFromLocale("Name") == tuple("Name", string.init));

char[] mutableString = "Hello".dup;
assert(separateFromLocale(mutableString) == tuple(mutableString, typeof(mutableString).init));