trParams method

String trParams([
  1. Map<String, String> params = const {}
])

Returns a translated string with parameters replaced.

params is a map where keys represent parameter placeholders in the translated string (e.g., '@key') and values represent the replacement strings.

Implementation

String trParams([Map<String, String> params = const {}]) {
  var trans = tr;
  if (params.isNotEmpty) {
    params.forEach((key, value) {
      trans = trans.replaceAll('@$key', value);
    });
  }
  return trans;
}