Repository navigation
Description
What package does this bug report belong to?
cupertino_ui
What target platforms are you seeing this bug on?
iOS
Have you already upgraded your packages?
No
Dependency versions
cupertino_ui:
dependency: "direct main"
description:
name: cupertino_ui
sha256: c23816577a1280cff409e989541767887011f8f1d8c1863a794ed308af46f2a9
url: "https://pub.dev"
source: hosted
version: "1.1.1"The same literal is still present in 1.1.4 (lib/src/dialog.dart, the Semantics wrapping the action sheet).
Steps to reproduce
- Create an app with
locale: Locale('pt')andGlobalCupertinoLocalizations.delegates. - Open a
CupertinoActionSheetwithshowCupertinoModalPopup. - Inspect the semantics tree (or open the sheet with VoiceOver on iOS).
Expected results
The node that names the route uses the localized label, like CupertinoAlertDialog already does (localizations.alertDialogLabel). For pt that is "Alerta".
Actual results
The node has label: "Alert", role: dialog, scopesRoute and namesRoute regardless of the locale. The value is a string literal in lib/src/dialog.dart:
child: Semantics(
namesRoute: true,
scopesRoute: true,
explicitChildNodes: true,
role: SemanticsRole.dialog,
label: 'Alert',CupertinoAlertDialog in the same file uses localizations.alertDialogLabel, and the ARB files already translate that key (e.g. cupertino_pt.arb: "alertDialogLabel": "Alerta"). Since the label is on the node that names the route, apps can't override it from outside, so localized apps get "Alert" announced in English.
Suggested fix:
label: CupertinoLocalizations.of(context).alertDialogLabel,Code sample
Code sample
A widget test that reproduces it (only cupertino_ui and flutter_test):
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('action sheet route label follows the locale', (tester) async {
final handle = tester.ensureSemantics();
await tester.pumpWidget(
CupertinoApp(
locale: const Locale('pt'),
localizationsDelegates: GlobalCupertinoLocalizations.delegates,
supportedLocales: const [Locale('pt')],
home: Builder(
builder: (context) => CupertinoButton(
child: const Text('open'),
onPressed: () => showCupertinoModalPopup<void>(
context: context,
builder: (_) => CupertinoActionSheet(
title: const Text('Tema'),
actions: [
CupertinoActionSheetAction(
onPressed: () {},
child: const Text('Claro'),
),
],
),
),
),
),
),
);
await tester.tap(find.text('open'));
await tester.pumpAndSettle();
// Passes: the localization exists.
expect(
CupertinoLocalizations.of(tester.element(find.text('Claro'))).alertDialogLabel,
'Alerta',
);
// Passes today: the hardcoded label is used.
expect(find.bySemanticsLabel('Alert'), findsOneWidget);
// Fails today: expected after the fix.
expect(find.bySemanticsLabel('Alerta'), findsOneWidget);
handle.dispose();
});
}Screenshots or Videos
N/A: the problem is in the semantics tree, not in the rendered pixels.
Logs
Logs
Expected: exactly one matching candidate
Actual: _ElementPredicateWidgetFinder:<Found 0 widgets with a semantics label named "Alerta": []>
Which: means none were found but one was expectedFlutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.47.2, on Debian GNU/Linux forky/sid 7.2.11+deb14-amd64, locale pt_BR.UTF-8)
• Flutter version 3.47.2 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d3b14c8769 (8 weeks ago), 2026-08-26 16:07:51 -0700
• Engine revision a804b26164
• Dart version 3.13.2
• DevTools version 2.60.0
[!] Android toolchain - develop for Android devices (Android SDK version 37.0.0)
• Platform android-37.2, build-tools 37.0.0
• Java version OpenJDK Runtime Environment (build 25.0.3+-15898627-b508.16)
✗ Android license status unknown.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Connected device (2 available)
[✓] Network resourcesThe bug is in Dart code and reproduces in flutter test; no Mac/iOS toolchain is involved.
Activity
suryaKommana2662 commentedon Oct 22, 2026
@alexandrembsb Thanks for the report and reproduction test. I reproduced the issue locally. The test passes when expecting the hardcoded "Alert" semantics label but fails when expecting the localized "Alerta" label. Routing this to the accessibility team for further investigation.
Flutter Doctor Output
[cupertino_ui] Localize CupertinoActionSheet semantics label (flutter…