Skip to content

How to localize (eg. en, fr) text buttons (pause, resume and cancel) on iOS and on TaskNotification text (title and description) properly ? #461

Discussion options

You must be logged in to vote

No, you cannopt enter multiple entries under the same key, you have to set the value based on the locale, eg:

import 'package:flutter_localizations/flutter_localizations.dart';

locale = Localizations.localeOf(context); // get the current locale
FileDownloader().configure(iOSConfig: [
      (Config.localize, {'Cancel': switch (locale.languageCode) {
    'en' => 'Cancel',
    'fr' => 'Annuler',
    'de'=> 'Abbrechen',
    _ => 'Cancel'; // Default to English if locale is not supported
  }}),
    ]).then((result) => debugPrint('Configuration result = $result'));

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@itstiemoko
Comment options

Comment options

You must be logged in to vote
4 replies
@itstiemoko
Comment options

@itstiemoko
Comment options

@781flyingdutchman
Comment options

@itstiemoko
Comment options

Answer selected by itstiemoko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants