firebase / FirebaseUI-Flutter

Apache License 2.0
93 stars 81 forks source link

🐛 Localizations for profile screen are not happening #85

Closed SCarcalicea closed 10 months ago

SCarcalicea commented 10 months ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI Auth, Firebase UI Localizations

What platform(s) does this bug affect?

Android, iOS, Web, macOS, Linux, Windows

List of dependencies used.

flutter pub deps -s list
  Dart SDK 3.1.0
Flutter SDK 3.13.1
fire 1.0.0+1

dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
  - sky_engine any
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - path 1.8.3
  - vector_math 2.1.4
  - web 0.1.4-beta
- cupertino_icons 1.0.5
- firebase_core 2.15.1
  - firebase_core_platform_interface ^4.8.0
  - firebase_core_web ^2.7.0
  - flutter any
  - meta ^1.8.0
- firebase_auth 4.8.0
  - firebase_auth_platform_interface ^6.17.0
  - firebase_auth_web ^5.7.0
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- cloud_firestore 4.9.0
  - cloud_firestore_platform_interface ^5.16.0
  - cloud_firestore_web ^3.7.0
  - collection ^1.0.0
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- provider 6.0.5
  - collection ^1.15.0
  - flutter any
  - nested ^1.0.0
- firebase_ui_auth 1.6.5
  - email_validator ^2.0.1
  - firebase_auth ^4.8.0
  - firebase_core ^2.15.0
  - firebase_dynamic_links ^5.3.4
  - firebase_ui_localizations ^1.5.3
  - firebase_ui_oauth ^1.4.9
  - firebase_ui_shared ^1.3.1
  - flutter any
  - flutter_localizations any
- firebase_ui_localizations 1.5.3
  - flutter any
  - flutter_localizations any
  - path ^1.8.2
- go_router 10.1.1
  - collection ^1.15.0
  - flutter any
  - flutter_web_plugins any
  - logging ^1.0.0
  - meta ^1.7.0
- uuid 3.0.7
  - crypto ^3.0.0

dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.0
  - matcher 0.12.16
  - path 1.8.3
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.0
  - vector_math 2.1.4
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - source_span 1.10.0
  - stream_channel 2.1.1
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - web 0.1.4-beta
- flutter_lints 2.0.3
  - lints ^2.0.0

transitive dependencies:
- _flutterfire_internals 1.3.5
  - collection ^1.0.0
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - meta ^1.8.0
- args 2.4.2
- async 2.11.0
  - collection ^1.15.0
  - meta ^1.1.7
- boolean_selector 2.1.1
  - source_span ^1.8.0
  - string_scanner ^1.1.0
- characters 1.3.0
- clock 1.1.1
- cloud_firestore_platform_interface 5.16.0
  - _flutterfire_internals ^1.3.5
  - collection ^1.15.0
  - firebase_core ^2.15.1
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- cloud_firestore_web 3.7.0
  - _flutterfire_internals ^1.3.5
  - cloud_firestore_platform_interface ^5.16.0
  - collection ^1.0.0
  - firebase_core ^2.15.1
  - firebase_core_web ^2.7.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
- collection 1.17.2
- crypto 3.0.3
  - typed_data ^1.3.0
- desktop_webview_auth 0.0.13
  - crypto ^3.0.3
  - flutter any
  - http ^1.0.0
  - flutter_web_plugins any
  - plugin_platform_interface ^2.1.4
- email_validator 2.1.17
- fake_async 1.3.1
  - clock ^1.1.0
  - collection ^1.15.0
- firebase_auth_platform_interface 6.17.0
  - _flutterfire_internals ^1.3.5
  - collection ^1.16.0
  - firebase_core ^2.15.1
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.7.0
  - firebase_auth_platform_interface ^6.17.0
  - firebase_core ^2.15.1
  - firebase_core_web ^2.7.0
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - js ^0.6.3
  - meta ^1.8.0
- firebase_core_platform_interface 4.8.0
  - collection ^1.0.0
  - flutter any
  - flutter_test any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_core_web 2.7.0
  - firebase_core_platform_interface ^4.8.0
  - flutter any
  - flutter_web_plugins any
  - js ^0.6.3
  - meta ^1.8.0
- firebase_dynamic_links 5.3.5
  - firebase_core ^2.15.1
  - firebase_core_platform_interface ^4.8.0
  - firebase_dynamic_links_platform_interface ^0.2.6+5
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+5
  - _flutterfire_internals ^1.3.5
  - firebase_core ^2.15.1
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_oauth 1.4.9
  - desktop_webview_auth ^0.0.11
  - firebase_auth ^4.7.2
  - firebase_ui_auth ^1.6.5
  - firebase_ui_shared ^1.3.1
  - flutter_svg ^2.0.5
  - flutter any
- firebase_ui_shared 1.3.1
  - flutter any
- flutter_svg 2.0.7
  - flutter any
  - vector_graphics ^1.1.7
  - vector_graphics_codec ^1.1.7
  - vector_graphics_compiler ^1.1.7
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.17.2
  - material_color_utilities 0.5.0
  - meta 1.9.1
  - vector_math 2.1.4
  - web 0.1.4-beta
- http 1.1.0
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- js 0.6.7
  - meta ^1.7.0
- lints 2.1.1
- logging 1.2.0
- matcher 0.12.16
  - async ^2.10.0
  - meta ^1.8.0
  - stack_trace ^1.10.0
  - term_glyph ^1.2.0
  - test_api >=0.5.0 <0.7.0
- material_color_utilities 0.5.0
  - collection ^1.15.0
- meta 1.9.1
- nested 1.0.0
  - flutter any
- path 1.8.3
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- petitparser 5.4.0
  - meta ^1.9.0
- plugin_platform_interface 2.1.5
  - meta ^1.3.0
- sky_engine 0.0.99
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.0
  - path ^1.8.0
- stream_channel 2.1.1
  - async ^2.5.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.6.0
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.3.0
  - source_span ^1.8.0
  - stack_trace ^1.10.0
  - stream_channel ^2.1.0
  - string_scanner ^1.1.0
  - term_glyph ^1.2.0
- typed_data 1.3.2
  - collection ^1.15.0
- vector_graphics 1.1.7
  - flutter any
  - vector_graphics_codec 1.1.7
- vector_graphics_codec 1.1.7
- vector_graphics_compiler 1.1.7
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.7
- vector_math 2.1.4
- web 0.1.4-beta
- xml 6.3.0
  - collection ^1.17.0
  - meta ^1.9.0
  - petitparser ^5.4.0

Steps to reproduce

Set the locale to anything else besides english and using the Firebase Authentication just navigate to profile screen.

Set the locale:

@override
  Widget build(BuildContext context) {
    return MaterialApp(
      onGenerateTitle: (context) => MainScreenLocalizations.of(context)!.translate(KeyWords.title),
      localizationsDelegates: [
        FlutterFireUIRoLocalizationsDelegate(),
        FirebaseUILocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate
      ],
      supportedLocales: const [
        Locale('en'),
        Locale('es')
      ],
      locale: const Locale('es'), // Set current locale for debug purposes
      theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
          useMaterial3: true,
          visualDensity: VisualDensity.adaptivePlatformDensity),
      home: Consumer<HomeState>(
        builder: (context, homeState, _) => const HomePage(),
      ),
    );
  }

Inside HomePage use this button:

IconButton(
        icon: const Icon(Icons.person),
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute<ProfileScreen>(
              builder: (context) => ProfileScreen(
                appBar: AppBar(
                  title: const Text('F.I.R.E. User Profile'),
                  centerTitle: true,
                  backgroundColor: Colors.blueAccent,
                ),
                actions: [
                  SignedOutAction((context) {
                    Navigator.of(context).pop();
                  })
                ],
                children: [
                  const Divider(),
                  Padding(
                    padding: const EdgeInsets.all(2),
                    child: AspectRatio(
                      aspectRatio: 1,
                      child: Image.asset('flutterfire_300x.png'),
                    ),
                  ),
                ],
              ),
            ),
          );
        },
      )

When you navigate to the profile screen you will see that most of the page is translated but not all of it. For example: "Email is not verified", "Dismiss" and "Send verification email".

Expected Behavior

If i set a supported locale such as es, it, etc, I would like to see all of the labels translated into their corresponding language. It looks like the default_localizations.dart does not contain the labels for those components in order to be able to translate them.

Actual Behavior

Half of the screen is translated and some of the components are not. Screenshot 2023-08-31 at 01 17 23

Additional Information

How can I translate Email is not verified, Dismiss and Send verification email when I am using Firebase authentication and as an authentication mechanism I am using email and password. Screenshot 2023-08-31 at 01 17 23

I think that looking into this: FirebaseUILocalizationLabels we can see that there is not option right now to translate those elements.

SCarcalicea commented 10 months ago

Found out that thre is another issue opened: https://github.com/firebase/FirebaseUI-Flutter/issues/54

Closing as this is a duplicate.