Skip to content

Commit

Permalink
Accessibility: add localizations (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
atsen-dev authored Mar 13, 2022
1 parent 55f286e commit 5940bbe
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 133 deletions.
144 changes: 111 additions & 33 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
"type": "Type",
"unknown": "Unknown",
"bluetoothOpenDeviceSettings": "Open device settings",
"bluetoothRemoveDevice" : "Remove device",
"removableMediaNeverAsk" : "Never ask or start a program for any removable media",
"removableMediaAudioCd" : "Audio CD",
"removableMediaDvdVideo" : "DVD-Videos",
"removableMediaMusicPlayer" : "Music Player",
"removableMediaPhotos" : "Photos",
"removableMediaApplications" : "Applications",
"removableMediaAudioDvd" : "AudioDVD",
"removableMediaBlankBd" : "Blank BD",
"removableMediaBlankCd" : "Blank CD",
"removableMediaBlankDvd" : "BlankDVD",
"removableMediaBlankHdDvd" : "Blank HD DVD",
"removableMediaEbookReader" : "Ebook Reader",
"removableMediaImagePictureCd" : "Image Picture CD",
"removableMediaOstreeRepository" : "Ostree Repository",
"removableMediaSoftware" : "Software",
"removableMediaVideoBlueray" : "Video Blueray",
"removableMediaVideoHdDvd" : "Video HD DVD",
"removableMediaVideoSvCd" : "Video SV CD",
"removableMediaVideoVCd" : "Video V CD",
"removableMediaWindowsSoftware" : "Windows Software",
"bluetoothRemoveDevice": "Remove device",
"removableMediaNeverAsk": "Never ask or start a program for any removable media",
"removableMediaAudioCd": "Audio CD",
"removableMediaDvdVideo": "DVD-Videos",
"removableMediaMusicPlayer": "Music Player",
"removableMediaPhotos": "Photos",
"removableMediaApplications": "Applications",
"removableMediaAudioDvd": "AudioDVD",
"removableMediaBlankBd": "Blank BD",
"removableMediaBlankCd": "Blank CD",
"removableMediaBlankDvd": "BlankDVD",
"removableMediaBlankHdDvd": "Blank HD DVD",
"removableMediaEbookReader": "Ebook Reader",
"removableMediaImagePictureCd": "Image Picture CD",
"removableMediaOstreeRepository": "Ostree Repository",
"removableMediaSoftware": "Software",
"removableMediaVideoBlueray": "Video Blueray",
"removableMediaVideoHdDvd": "Video HD DVD",
"removableMediaVideoSvCd": "Video SV CD",
"removableMediaVideoVCd": "Video V CD",
"removableMediaWindowsSoftware": "Windows Software",
"checkConnectivityLabel": "Check connectivity",
"checkConnectivityDescription": "The connectivity check is used to detect connection problems and help you stay online. If your network communications are monitored, they could be used to collect technical information about this computer.",
"screenSaverDescription": "The automatic screen lock protects your computer from being accessed by others while you are away.",
Expand Down Expand Up @@ -114,7 +114,7 @@
"keyboardShortCutsPageTitle": "Keyboard Shortcuts",
"printersPageTitle": "Printers",
"removableMediaPageTitle": "Removable Media",
"colorPageTitle": "Color",
"color": "Color",
"regionAndLanguagePageTitle": "Region and language",
"regionAndLanguagePageSelectLanguageAction": "Select your language",
"regionAndLanguagePageManageLanguageAction": "Manage and install languages",
Expand All @@ -130,24 +130,102 @@
"dateAndTimePageWeekdayInPanel": "Show weekday in panel",
"dateAndTimePageWeekNumberInCalendar": "Show week number in calendar",
"infoPageTitle": "Info",
"apply" : "Apply",
"apply": "Apply",
"displays": "Displays",
"nightMode": "Night Mode",
"orientation": "Orientation",
"resolution": "Resolution",
"refreshRate": "Refresh Rate",
"scale" : "Scale",
"fractionalScaling" : "Fractional Scaling",
"fractionalScaling_description" : "May increase power usage, lower speed, or reduce display sharpness",
"landscape" : "Landscape",
"portraitLeft" : "Portrait on the left",
"portraitRight" : "Portrait on the right",
"flippedLandscape" : "Flipped landscape",

"scale": "Scale",
"fractionalScaling": "Fractional Scaling",
"fractionalScaling_description": "May increase power usage, lower speed, or reduce display sharpness",
"landscape": "Landscape",
"portraitLeft": "Portrait on the left",
"portraitRight": "Portrait on the right",
"flippedLandscape": "Flipped landscape",
"scaleFormat": "{factor}x",
"@scaleFormat" : {
"@scaleFormat": {
"placeholders": {
"factor": {}
}
}
},
"global": "Global",
"alwaysShowUniversalAccessMenu": "Always Show Universal Access Menu",
"hearing": "Hearing",
"visualAlerts": "Visual Alerts",
"visualAlertsDescription": "Use a visual indication when an alert sound occurs",
"flashEntireWindow": "Flash the entire window",
"flashEntireScreen": "Flash the entire screen",
"pointingAndClicking": "Pointing & Clicking",
"mouseKeys": "Mouse Keys",
"locatePointer": "Locate Pointer",
"doubleClickDelay": "Double-Click Delay",
"clickAssist": "Click Assist",
"simulatedSecondaryClick": "Simulated Secondary Click",
"simulatedSecondaryClickDescription": "Trigger a secondary click by holding down the primary button.",
"delay": "Delay",
"hoverClick": "Hover Click",
"hoverClickDescription": "Trigger a click when the pointer hovers",
"motionThreshold": "Motion threshold",
"seeing": "Seeing",
"highContrast": "High Contrast",
"largeText": "Large Text",
"zoom": "Zoom",
"screenReader": "Screen Reader",
"screenReaderDescription": "The screen reader reads displayed text as you move the focus",
"soundKeys": "Sound Keys",
"soundKeysDescription": "Beep when Num Lock or Caps Lock are turned on or off'",
"cursorSize": "Cursor Size",
"cursorSizeDescription": "Cursor size can be combined with zoom to make it easier to see the cursor",
"zoomOptions": "Zoom Options",
"zoomOption_Magnifier": "Magnifier",
"zoomOption_Crosshairs": "Crosshairs",
"zoomOption_ColorEffects": "Color Effects",
"magnification": "Magnification",
"magnifierPosition": "Magnifier Position",
"followMouseCursor": "Follow mouse cursor",
"screenPart": "Screen part",
"magnifierExtendsOutsideScreen": "Magnifier extends outside of screen",
"keepMagnifierCursorCentered": "Keep magnifier cursor centered",
"magnifierCursorPushesContentsAround": "Magnifier cursor pushes contents around",
"magnifierCursorMovesWithContents": "Magnifier cursor moves with contents",
"overlapsMouseCursor": "Overlaps mouse cursor",
"thickness": "Thickness",
"length": "Length",
"selectCrossHairsColor": "Select crosshairs color",
"selectColorShade": "Select color shade",
"selectedColorsShade": "Selected color and its shades",
"whiteOnBlack": "White on black",
"brightness": "Brightness",
"contrast": "Contrast",
"saturation": "Saturation",
"typing": "Typing",
"screenKeyboard": "Screen Keyboard",
"repeatKeys": "Repeat Keys",
"repeatKeysDescription": "Key presses repeat when key is held down",
"repeatKeyDelayDescription": "Initial key repeat delay",
"interval": "Interval",
"intervalDelayDescription": "Delay between repeats",
"cursorBlinking": "Cursor Blinking",
"cursorBlinkingDescription": "Cursor blinks in text fields",
"cursorBlinkTime": "Cursor Blink Time",
"cursorBlinkTimeDescription": "Length of the cursor blink cycle",
"typingAssistAccessX": "Typing Assist (AccessX)",
"typingAssist": "Typing Assist",
"enableByKeyboard": "Enable by Keyboard",
"enableByKeyboardDescription": "Turn accessibility features on and off using the keyboard",
"stickyKeys": "Sticky Keys",
"stickyKeysDescription": "Treats a sequence of modifier keys as a key combination'",
"slowKeys": "Slow Keys",
"slowKeysDescription": "Puts a delay between when a key is pressed and when it is accepted",
"bounceKeys": "Bounce Keys",
"bounceKeysDescription": "Ignores fast duplicate keypresses",
"stickyKeysTwoKeysOption": "Disable if two keys are pressed at the same time",
"stickyKeysBeepModifierOption": "Beep when a modifier key is pressed",

"acceptanceDelay": "Acceptance delay",
"stickyKeysBeepKeyOption": "Beep when a key is pressed",
"stickyKeysBeepKeyAcceptedOption": "Beep when a key is accepted",
"stickyKeysBeepKeyRejectedOption": "Beep when a key is rejected"
}

5 changes: 3 additions & 2 deletions lib/view/pages/accessibility/global_section.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/constants.dart';
import 'package:settings/l10n/l10n.dart';
import 'package:settings/view/pages/accessibility/accessibility_model.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

Expand All @@ -12,10 +13,10 @@ class GlobalSection extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruSection(
width: kDefaultWidth,
headline: 'Global',
headline: context.l10n.global,
children: [
YaruSwitchRow(
trailingWidget: const Text('Always Show Universal Access Menu'),
trailingWidget: Text(context.l10n.alwaysShowUniversalAccessMenu),
value: model.universalAccessStatus,
onChanged: (value) => model.setUniversalAccessStatus(value),
),
Expand Down
17 changes: 9 additions & 8 deletions lib/view/pages/accessibility/hearing_section.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/constants.dart';
import 'package:settings/l10n/l10n.dart';
import 'package:settings/view/pages/accessibility/accessibility_model.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
Expand All @@ -10,10 +11,10 @@ class HearingSection extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const YaruSection(
return YaruSection(
width: kDefaultWidth,
headline: 'Hearing',
children: [
headline: context.l10n.hearing,
children: const <Widget>[
_VisualAlerts(),
],
);
Expand All @@ -28,8 +29,8 @@ class _VisualAlerts extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruExtraOptionRow(
iconData: YaruIcons.settings,
actionLabel: 'Visual Alerts',
actionDescription: 'Use a visual indication when an alert sound occurs',
actionLabel: context.l10n.visualAlerts,
actionDescription: context.l10n.visualAlertsDescription,
value: model.visualAlerts,
onChanged: (value) => model.setVisualAlerts(value),
onPressed: () => showDialog(
Expand All @@ -51,17 +52,17 @@ class _VisualAlertsSettings extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruSimpleDialog(
width: kDefaultWidth,
title: 'Visual Alerts',
title: context.l10n.visualAlerts,
closeIconData: YaruIcons.window_close,
children: [
RadioListTile(
title: const Text('Flash the entire window'),
title: Text(context.l10n.flashEntireWindow),
value: 'frame-flash',
groupValue: model.visualAlertsType,
onChanged: (String? value) => model.setVisualAlertsType(value!),
),
RadioListTile(
title: const Text('Flash the entire screen'),
title: Text(context.l10n.flashEntireScreen),
value: 'fullscreen-flash',
groupValue: model.visualAlertsType,
onChanged: (String? value) => model.setVisualAlertsType(value!),
Expand Down
27 changes: 14 additions & 13 deletions lib/view/pages/accessibility/pointing_and_clicking_section.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/constants.dart';
import 'package:settings/l10n/l10n.dart';
import 'package:settings/view/pages/accessibility/accessibility_model.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

Expand All @@ -14,21 +15,21 @@ class PointingAndClickingSection extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruSection(
width: kDefaultWidth,
headline: 'Pointing & Clicking',
headline: context.l10n.pointingAndClicking,
children: [
YaruSwitchRow(
trailingWidget: const Text('Mouse Keys'),
trailingWidget: Text(context.l10n.mouseKeys),
value: model.mouseKeys,
onChanged: (value) => model.setMouseKeys(value),
),
YaruSwitchRow(
trailingWidget: const Text('Locate Pointer'),
trailingWidget: Text(context.l10n.locatePointer),
value: model.locatePointer,
onChanged: (value) => model.setLocatePointer(value),
),
const _ClickAssist(),
YaruSliderRow(
actionLabel: 'Double-Click Delay',
actionLabel: context.l10n.doubleClickDelay,
value: model.doubleClickDelay,
min: 100,
max: 1000,
Expand All @@ -48,7 +49,7 @@ class _ClickAssist extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruRow(
enabled: model.clickAssistAvailable,
trailingWidget: const Text('Click Assist'),
trailingWidget: Text(context.l10n.clickAssist),
actionWidget: Row(
children: [
Text(model.clickAssistString),
Expand Down Expand Up @@ -82,21 +83,21 @@ class _ClickAssistSettings extends StatelessWidget {
final model = context.watch<AccessibilityModel>();
return YaruSimpleDialog(
width: kDefaultWidth,
title: 'Click Assist',
title: context.l10n.clickAssist,
closeIconData: YaruIcons.window_close,
children: [
YaruSwitchRow(
trailingWidget: const Text('Simulated Secondary Click'),
trailingWidget: Text(context.l10n.simulatedSecondaryClick),
actionDescription:
'Trigger a secondary click by holding down the primary button.',
context.l10n.simulatedSecondaryClickDescription,
value: model.simulatedSecondaryClick,
onChanged: (value) => model.setSimulatedSecondaryClick(value),
),
Padding(
padding: const EdgeInsets.only(left: 16.0),
child: YaruSliderRow(
enabled: model.simulatedSecondaryClick ?? false,
actionLabel: 'Delay',
actionLabel: context.l10n.delay,
value: model.secondaryClickTime,
min: 0.5,
max: 3.0,
Expand All @@ -106,8 +107,8 @@ class _ClickAssistSettings extends StatelessWidget {
),
),
YaruSwitchRow(
trailingWidget: const Text('Hover Click'),
actionDescription: 'Trigger a click when the pointer hovers',
trailingWidget: Text(context.l10n.hoverClick),
actionDescription: context.l10n.hoverClickDescription,
value: model.dwellClick,
onChanged: (value) => model.setDwellClick(value),
),
Expand All @@ -120,7 +121,7 @@ class _ClickAssistSettings extends StatelessWidget {
height: 56,
child: YaruSliderRow(
enabled: model.dwellClick ?? false,
actionLabel: 'Delay',
actionLabel: context.l10n.delay,
value: model.dwellTime,
min: 0.2,
max: 3.0,
Expand All @@ -133,7 +134,7 @@ class _ClickAssistSettings extends StatelessWidget {
height: 56,
child: YaruSliderRow(
enabled: model.dwellClick ?? false,
actionLabel: 'Motion thresshold',
actionLabel: context.l10n.motionThreshold,
value: model.dwellThreshold,
min: 0.0,
max: 30.0,
Expand Down
Loading

0 comments on commit 5940bbe

Please sign in to comment.