Skip to content

Commit

Permalink
all strings localized
Browse files Browse the repository at this point in the history
  • Loading branch information
herzhenr committed Sep 23, 2023
1 parent 2a9e7b6 commit 6e3ec56
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AppConstants {
if (context != null) {
return chipsWolPorts
.map((e) => CustomChoiceChip<int>(
label: "${AppLocalizations.of(context)!.formPort} ${e.value}",
label: AppLocalizations.of(context)!.formPort(e.value),
value: e.value))
.toList();
} else {
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
"back": "Back",
"genericWarning": "Warning",
"@HOME": {},
"homeSortAlphabetical": "alphabetical",
"homeSortRecent": "recently",
"homeSortType": "type",
"homeAddDeviceButton": "Add Devices",
"homeNoDevices": "No devices yet. Add devices by clicking the + button below",
"homeFilterDevicesTitle": "Filter Devices",
"homeDeviceListTitle": "Devices",
"homeEditDeviceAlertTitle": "Edit Device",
"homeDeviceCardWakeButton": "Wake Up",
"homeDeviceCardEditButton": "Edit",
"homeDeviceCardOnline": "Device is online",
Expand Down Expand Up @@ -114,7 +118,15 @@
"formIconLabel": "Icon",
"formIconError": "no device type selected",
"formIconErrorTitle": "Wrong Format",
"formPort": "Port",
"formPort": "Port {port}",
"@formPort": {
"placeholders": {
"port": {
"type": "int",
"example": "9"
}
}
},
"formErrorMessageName": "device has no name",
"formErrorMessageIp": "invalid IP Address",
"formErrorMessageMac": "invalid MAC Address",
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ class _AboutPageState extends State<AboutPage> {
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _deviceData.keys.map((String property) {
return Text('${_deviceData[property]}');
return Text(_deviceData[property].toString());
}).toList(),
),
subtitle: Text(
"IP: $_wifiAddress",
"${AppConstants.ipText}: $_wifiAddress",
style: Theme.of(context).textTheme.bodySmall,
),
minLeadingWidth: 0,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/home/bottom_sheet_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class _ModularBottomFormPageState extends State<ModularBottomFormPage> {
TextSpan(text: AppLocalizations.of(context)!.formDeleteAlertText),
if (widget.controllerName.text.isNotEmpty)
TextSpan(
text: " ${widget.controllerName.text}",
text: widget.controllerName.text,
style: const TextStyle(fontWeight: FontWeight.bold)),
const TextSpan(text: '?'),
],
Expand Down
15 changes: 8 additions & 7 deletions lib/screens/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,17 @@ class _HomePageState extends State<HomePage> {
sortDevices();
},
itemBuilder: (BuildContext context) => <PopupMenuEntry<SortingOrder>>[
const PopupMenuItem<SortingOrder>(
PopupMenuItem<SortingOrder>(
value: SortingOrder.alphabetical,
child: Text('alphabetical'),
child: Text(AppLocalizations.of(context)!.homeSortAlphabetical),
),
const PopupMenuItem<SortingOrder>(
PopupMenuItem<SortingOrder>(
value: SortingOrder.recently,
child: Text('recently'),
child: Text(AppLocalizations.of(context)!.homeSortRecent),
),
const PopupMenuItem<SortingOrder>(
PopupMenuItem<SortingOrder>(
value: SortingOrder.type,
child: Text('type'),
child: Text(AppLocalizations.of(context)!.homeSortType),
),
],
),
Expand Down Expand Up @@ -458,7 +458,8 @@ class _HomePageState extends State<HomePage> {
showCustomBottomSheet(
context: context,
formPage: EditDeviceFormPage(
title: "Edit Device",
title: AppLocalizations.of(context)!
.homeEditDeviceAlertTitle,
device: device,
devices: _devices,
onSubmitDeviceCallback: updateDevicesList))
Expand Down

0 comments on commit 6e3ec56

Please sign in to comment.