FeedbackStrings.forLanguage constructor

FeedbackStrings.forLanguage(
  1. String languageCode
)

Create FeedbackStrings for a specific language

Supported language codes:

  • en: English
  • ar: Arabic
  • es: Spanish
  • fr: French
  • de: German
  • zh: Chinese (Simplified)
  • ja: Japanese
  • ko: Korean
  • pt: Portuguese
  • ru: Russian
  • it: Italian
  • nl: Dutch
  • tr: Turkish
  • pl: Polish
  • sv: Swedish
  • da: Danish
  • no: Norwegian
  • fi: Finnish
  • el: Greek
  • cs: Czech
  • hu: Hungarian
  • ro: Romanian
  • uk: Ukrainian
  • th: Thai
  • vi: Vietnamese
  • id: Indonesian
  • he: Hebrew
  • hi: Hindi
  • bn: Bengali
  • ms: Malay
  • ur: Urdu

Implementation

factory FeedbackStrings.forLanguage(String languageCode) {
  final translations = LocalizationService.getTranslations(languageCode);
  return FeedbackStrings(
    pageTitle: translations['pageTitle']!,
    feedbackInputLabel: translations['feedbackInputLabel']!,
    feedbackInputHint: translations['feedbackInputHint']!,
    feedbackInputValidationError: translations['feedbackInputValidationError']!,
    submitButtonLabel: translations['submitButtonLabel']!,
    sentSuccessfully: translations['sentSuccessfully']!,
    sendError: translations['sendError']!,
  );
}