translateEntry method

String translateEntry(
  1. IntlLocale fromLocale,
  2. IntlLocale toLocale,
  3. String key,
  4. String message,
)

Implementation

String translateEntry(
    IntlLocale fromLocale, IntlLocale toLocale, String key, String message) {
  key = _normalizeKey(key);

  var from = _translations[fromLocale.code] ??= {};
  var to = from[toLocale.code] ??= {};
  var entries = to[key] ??= {};

  var m = _simplifyMessage(message);

  var t = entries[m];

  return t ??= message;
}