toCodeForLocale method

String toCodeForLocale(
  1. String locale,
  2. String name
)

Generate code for this message, expecting it to be part of a map keyed by name with values the function that calls Intl.message.

Implementation

String toCodeForLocale(String locale, String name) {
  var out = new StringBuffer()
    ..write('static $name(')
    ..write(arguments!.join(", "))
    ..write(') => "')
    ..write(translations[locale])
    ..write('";');
  return out.toString();
}