Questions tagged [flutter-localizations]

79 questions
1
vote
2 answers

Is there a way to get context inside getters?

I'm using flutter_localizations to internationalize my app. So i have this class final Article article; ArticleViewModel({required this.article}); String get name { return article.name; } String get isGood { return article.isGoods ? 'Goods' :…
Xavier Soh
  • 47
  • 5
1
vote
1 answer

easy_localization code generation process is not getting through from Android Studio Terminal

After setting up all the .json files, pubspec file and initialization in the main method when I am trying to create the codegen_loader.g.dart file from the terminal by invoking flutter pub run easy_localization:generate, it's not getting through.…
1
vote
1 answer

How to customize widgets with FlutterFire UI auth?

I want to customize my flutterfire ui auth screens using localization. With this link: https://firebase.flutter.dev/docs/ui/auth/localization/ , I managed to customize the email and password textfields's labels. Now I want to customize all the…
1
vote
1 answer

How to change the application language with BlockBuilder?

The application needs to implement language switching at runtime. Wrote a bloc with event and state and called BlocBuilder in main.dart. But I don't know how to implement the switch. How can I do that? In total, the application has two languages. My…
userName
  • 903
  • 2
  • 20
1
vote
1 answer

Flutter Locale property

Tryed to make the Provider LocaleProvider. But get the Error "Non-nullable instance field '_locale' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late'." making it "late" gets…
Noel Huibers
  • 109
  • 12
1
vote
0 answers

GlobalMaterialLocalizations.delegate Does not Support Chinese

It seems GlobalMaterialLocalizations.delegate does not support the zh Locale (Chinese). Is it really necessary adding GlobalCupertinoLocalizations.delegate before other locales works? I get this error each time I run the app without adding the…
1
vote
0 answers

Localize Google Sign in button in Flutter web

I'm following the official Firebase UI guide to localize Firebase UI Google Sign in button in a different language, but I'm already using Intl package as for the official Flutter guide, so I don't understand what is the custom delegate which should…
marcolav
  • 405
  • 1
  • 6
  • 17
1
vote
2 answers

Int placeholder on flutter localizations

I'm trying to add a text entry to "arb" file with an int placeholder but without success as I'm getting the follow error: Number format null for the times placeholder does not have a corresponding NumberFormat constructor. Check the intl library's…
ademar111190
  • 14,215
  • 14
  • 85
  • 114
1
vote
1 answer

Flutter Multilanguage Application

Hi I have used easy_localization package to add other languages to my application. but I want to know how we can translate api calls data. for example, imagine we have an e-commerce application and we want to translate products titles and other…
1
vote
1 answer

How to store and access JSON objects in arb file in flutter?

I am implementing localization in flutter. From what I read in docs I get that all the translations should be in root/lib/l10n/ folder. I have two files in it app_en.arb and app_hi.arb. I have followed this official doc on flutter localization. As I…
sg717
  • 53
  • 6
1
vote
0 answers

How to Change locale of Flutter Local Notifications within app?

In my code i am changing locale language within app without changing device language but when i change language from English to Arabic Flutter local notification still display notifications as Locale (en,US) but i want those notifications to be…
1
vote
1 answer

Flutter internationalization using dynamic value matches with arb file value

I want to get translations from locally saved .arb files. I have the below code in a loop. So if the dynamic value matches the value in the .arb files, I get the translation. Text(Translation.of(context).!filterTitle ), Unfortunately, I can't find…
Jestin
  • 578
  • 5
  • 10
1
vote
1 answer

Flutter manually change Language with flutter_localizations and intl

I'm creating a PopupMenuButton to change the language of the app locally but I don't know how to load a different language. This is the Widget that I'm creating to change the language and I want to set the app language to the value of the PopupMenu…
JonasLevin
  • 1,592
  • 1
  • 20
  • 50
0
votes
0 answers

Flutter arb file spacing in a select translation

I am trying to translate a list of countries like that: arb file: "countries": "{choice, select, United States {United States} Mexico {Mexico} other {None}}", The implementation should be like this: S.of(context).countries(countryName) but the…
Omar Fayad
  • 1,733
  • 3
  • 11
  • 27
0
votes
1 answer

How to use exactly plural in localization using flutter

I'm having the below pluralSample string in my app_en.arb file, based on the passed option we can pick the value "pluralSample" : "{count, plural, =0{no persons} =1{one person} =2{2 persons} few{few persons} many{many persons} other{{count}…
krishnaji
  • 1,605
  • 4
  • 14
  • 25