Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect l10n for CupertinoDatePicker in monthYear mode #130930

Closed
2 tasks done
AndreySuworow opened this issue Jul 19, 2023 · 5 comments
Closed
2 tasks done

Incorrect l10n for CupertinoDatePicker in monthYear mode #130930

AndreySuworow opened this issue Jul 19, 2023 · 5 comments
Assignees
Labels
a: internationalization Supporting other languages or locales. (aka i18n) f: cupertino flutter/packages/flutter/cupertino repository f: date/time picker Date or time picker widgets found in release: 3.13 Found to occur in 3.13 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@AndreySuworow
Copy link
Contributor

AndreySuworow commented Jul 19, 2023

Is there an existing issue for this?

Steps to reproduce

  1. Add CupertinoDatePicker with mode: CupertinoDatePickerMode.monthYear
  2. Add GlobalCupertinoLocalizations.delegate to CupertinoApp
  3. Add locale corresponding to any language with cases (e.g. Locale('ru') for Russian)

Expected results

The name of the month in CupertinoDatePicker should be in base form, for example: Январь, Февраль ...

Actual results

The name of the month is in the case, in which the day must be presented before the name of the month: января, февраля...

Code sample

Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      title: 'Flutter Demo',
      home: CupertinoPageScaffold(
        child: Center(
            child: CupertinoDatePicker(
          onDateTimeChanged: (_) {},
          mode: CupertinoDatePickerMode.monthYear,
        )),
      ),
      supportedLocales: const [Locale('ru')],
      localizationsDelegates: const [GlobalCupertinoLocalizations.delegate],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Снимок экрана 2023-07-19 в 22 10 18

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.13.0-7.0.pre.12, on macOS 13.4 22F66 darwin-arm64, locale ru-RU)
    • Flutter version 3.13.0-7.0.pre.12 on channel master at /Users/andrey/dev/tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8d3a5cf1a5 (40 minutes ago), 2023-07-19 14:38:56 -0400
    • Engine revision 2fab8ab5ff
    • Dart version 3.1.0 (build 3.1.0-326.0.dev)
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/andrey/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/andrey/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.10121639/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Users/andrey/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.10121639/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.3)
    • IntelliJ at /Users/andrey/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9161.38/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • iPhone 14 Pro Max (mobile) • FA8B4298-C114-40B3-8392-E949E954BB10 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 115.0.5790.98

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@huycozy huycozy added the in triage Presently being triaged by the triage team label Jul 20, 2023
@huycozy
Copy link
Member

huycozy commented Jul 20, 2023

Thanks for the report, @AndreySuworow
I'm seeing this issue when comparing the rendered month between Reminder iOS native app and Flutter app.

Demo
iOS native Flutter
flutter doctor -v (master)
```bash
[!] Flutter (Channel master, 3.13.0-7.0.pre.27, on macOS 13.4.1 22F770820d darwin-x64, locale en-VN)
    • Flutter version 3.13.0-7.0.pre.27 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 123413b052 (39 minutes ago), 2023-07-19 22:37:23 -0400
    • Engine revision 56e88e8b0e
    • Dart version 3.1.0 (build 3.1.0-328.0.dev)
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.80.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.68.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.4.1 22F770820d darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@huycozy huycozy added framework flutter/packages/flutter repository. See also f: labels. f: date/time picker Date or time picker widgets a: internationalization Supporting other languages or locales. (aka i18n) f: cupertino flutter/packages/flutter/cupertino repository has reproducible steps The issue has been confirmed reproducible and is ready to work on team-design Owned by Design Languages team found in release: 3.13 Found to occur in 3.13 and removed in triage Presently being triaged by the triage team labels Jul 20, 2023
@HansMuller HansMuller added P2 Important issues not at the top of the work list triaged-design Triaged by Design Languages team labels Jul 27, 2023
@HansMuller
Copy link
Contributor

@MitchellGoodwin - please work with @thkim1011 to get a TC request for an updated translation.

@MitchellGoodwin
Copy link
Contributor

@HansMuller #130934 was opened and it fixes this issue by using existing localizations that we already have, so I do not think a TC request would be necessary.

fluttermirroringbot pushed a commit that referenced this issue Aug 18, 2023
This PR fixes l10n issue when months names are being used in incorrect form in CupertinoDatePicker in CupertinoDatePickerMode.yearMonth (#130930).

The idea of this proposal is to add an optional parameter `standalone` for `CupertinoLocalizations.datePickerMonth` to be able to choose when to use months names in base form (intl DateSymbols.STANDALONEMONTHS) and when in day-dependent form (intl DateSymbols.MONTHS)

<details>
<summary>Before</summary>

<img width="366" alt="image" src="https://github.com/flutter/flutter/assets/32621121/1dd54fa7-6dd9-4053-889b-57134c145432">

<img width="387" alt="image" src="https://github.com/flutter/flutter/assets/32621121/c176070e-73e4-49d3-883b-ba31eca6d1d7">

</details>

<details>
<summary>After</summary>

<img width="369" alt="image" src="https://github.com/flutter/flutter/assets/32621121/255594f1-219d-4bd4-9b75-1012912f8ab0">

<img width="378" alt="image" src="https://github.com/flutter/flutter/assets/32621121/16bbb41f-3f62-4446-bf41-e27140b649a9">

</details>
@MitchellGoodwin
Copy link
Contributor

Closed as fixed with #130934

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: internationalization Supporting other languages or locales. (aka i18n) f: cupertino flutter/packages/flutter/cupertino repository f: date/time picker Date or time picker widgets found in release: 3.13 Found to occur in 3.13 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

4 participants