translate method

String translate(
  1. String key
)

Retrieves a localized string by key, returning a default message if not found.

Implementation

String translate(String key) {
  return _localizedStrings[key] ?? 'Translation not found';
}