flutter-form-builder-ecosystem / flutter_form_builder

Simple form maker for Flutter Framework
https://pub.dev/packages/flutter_form_builder
MIT License
1.45k stars 526 forks source link

[Localizations]: Language code fow Swedish is wrong #1378

Closed oakstair closed 1 month ago

oakstair commented 3 months ago

Is there an existing issue for this?

Package/Plugin version

9.1.0

Platforms

Flutter doctor

Flutter doctor ```bash € flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.19.4, on macOS 14.2.1 23C71 darwin-x64, locale sv-SE) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] IntelliJ IDEA Ultimate Edition (version 2023.3.6) [✓] VS Code (version 1.52.1) [✓] Network resources • No issues found! ```

Minimal code example

Code sample ```dart Not code related ... ```

Current Behavior

My application is setting language to 'sv' as this is the correct language code for Swedish.

Since FormBuilder uses 'se' which is wrong this doe snot work.

Expected Behavior

Form texts should be localizes correctly wehren using the correct language code for Swesih = 'sv'

Steps To Reproduce

  1. Create a form
  2. Set language to 'sv'
  3. Checkthat error message are in Sweidsh

Aditional information

No response

oakstair commented 3 months ago
            return MaterialApp.router(
              // navigatorKey: _appRouter.navigatorKey,
              debugShowCheckedModeBanner: false,
              theme: PokerChampionTheme.dark(),
              title: 'PokerChampion',
              backButtonDispatcher: RootBackButtonDispatcher(),
              routeInformationParser: routeParser,
              routerDelegate: _appRouter,
              localizationsDelegates: [
                GlobalMaterialLocalizations.delegate,
                GlobalWidgetsLocalizations.delegate,
                GlobalCupertinoLocalizations.delegate,
                // FormBuilderLocalizations.delegate, 'sv' is currently not supported ....
              ],
              supportedLocales: [
                // const Locale('de'),
                const Locale('en'),
                // const Locale('es'),
                // const Locale('it'),
                // const Locale('pl'),
                // const Locale('ru'),
                const Locale('sv'),
              ],
            );
          },
deandreamatias commented 1 month ago

But this is related to flutter_form_builder or to form_builder_validators ?