translate method
Translate a key and interpolate variables using params if provided.
Implementation
String translate(String key, [Map<String, String>? params]) {
final template = _localizedStrings[locale.languageCode]?[key] ?? key;
if (params == null || params.isEmpty) return template;
var result = template;
params.forEach((placeholder, value) {
result = result.replaceAll('{$placeholder}', value);
});
return result;
}