From a990a3c2ea6eb46fa64c17e1ab40b13df018a3db Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 09:50:48 +0200 Subject: [PATCH 01/19] feat: move all texts to l10n file --- .../lib/core/modals/add_quota_dialog.dart | 36 +++--- .../lib/core/modals/confirmation_dialog.dart | 6 +- .../lib/core/modals/settings_dialog.dart | 15 +-- .../admin_ui/lib/core/widgets/app_title.dart | 5 +- .../identities_data_table.dart | 23 ++-- .../identities_filter.dart | 21 ++-- .../lib/core/widgets/quotas_button_group.dart | 13 ++- .../home/clients_overview/clients_filter.dart | 12 +- .../clients_overview/clients_overview.dart | 32 +++--- .../modals/change_client_secret_dialog.dart | 12 +- .../modals/create_client_dialog.dart | 44 +++---- .../identities_overview.dart | 2 +- .../identity_details/identity_details.dart | 18 +-- .../identity_quotas_table.dart | 24 ++-- .../identity_details/modals/change_tier.dart | 14 +-- .../lib/home/tier_detail/tier_detail.dart | 25 ++-- .../modals/show_create_tier_dialog.dart | 10 +- .../home/tiers_overview/tiers_overview.dart | 13 ++- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 107 +++++++++++++++++- 19 files changed, 268 insertions(+), 164 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index c8e021a0ac..a031635339 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -13,8 +13,8 @@ Future showAddQuotaDialog({ String? tierId, String? identityAddress, }) async { - assert(tierId != null || identityAddress != null, 'Either tierId or address must be provided'); - assert(tierId == null || identityAddress == null, 'Only one of tierId or address can be provided'); + assert(tierId != null || identityAddress != null, context.l10n.requirementOfTierIdOrAddress); + assert(tierId == null || identityAddress == null, context.l10n.exclusiveTierIdOrAddress); final metrics = await GetIt.I.get().quotas.getMetrics(); @@ -82,7 +82,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: const Text('Add Quota'), + title: Text(context.l10n.addQuota), content: SizedBox( width: 500, child: Column( @@ -92,19 +92,19 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { value: _selectedMetric, items: widget.availableMetrics.map((metric) => DropdownMenuItem(value: metric.key, child: Text(metric.displayName))).toList(), onChanged: _saving ? null : (String? selected) => setState(() => _selectedMetric = selected), - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Metric*', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.metric, ), ), Gaps.h24, TextField( controller: _maxAmountController, enabled: !_saving, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Max Amount*', - helperText: 'Only numbers greater or equal to 0 are valid.', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.maxAmount, + helperText: context.l10n.helperMaxAmount, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, @@ -112,12 +112,12 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { Gaps.h24, DropdownButtonFormField( value: _selectedPeriod, - items: const [ - DropdownMenuItem(value: 'Hour', child: Text('Hour')), - DropdownMenuItem(value: 'Day', child: Text('Day')), - DropdownMenuItem(value: 'Week', child: Text('Week')), - DropdownMenuItem(value: 'Month', child: Text('Month')), - DropdownMenuItem(value: 'Year', child: Text('Year')), + items: [ + DropdownMenuItem(value: 'Hour', child: Text(context.l10n.hour)), + DropdownMenuItem(value: 'Day', child: Text(context.l10n.day)), + DropdownMenuItem(value: 'Week', child: Text(context.l10n.week)), + DropdownMenuItem(value: 'Month', child: Text(context.l10n.month)), + DropdownMenuItem(value: 'Year', child: Text(context.l10n.year)), ], onChanged: _saving ? null : (String? selected) => setState(() => _selectedPeriod = selected), decoration: const InputDecoration( @@ -143,7 +143,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { ), FilledButton( onPressed: _isValid && !_saving ? _addQuota : null, - child: const Text('Add'), + child: Text(context.l10n.add), ), ], ), @@ -153,7 +153,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { Future _addQuota() async { setState(() => _saving = true); - assert(_selectedMetric != null && _maxAmount != null && _selectedPeriod != null, 'Invalid state'); + assert(_selectedMetric != null && _maxAmount != null && _selectedPeriod != null, context.l10n.invalidState); final response = await widget.addQuota( metricKey: _selectedMetric!, diff --git a/AdminUi/apps/admin_ui/lib/core/modals/confirmation_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/confirmation_dialog.dart index c0ec4518d5..32e88a12dd 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/confirmation_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/confirmation_dialog.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import '../extensions.dart'; + Future showConfirmationDialog({ required BuildContext context, required String title, @@ -27,11 +29,11 @@ class _ConfirmationDialog extends StatelessWidget { actions: [ OutlinedButton( onPressed: () => Navigator.of(context).pop(false), - child: const Text('Cancel'), + child: Text(context.l10n.cancel), ), FilledButton( onPressed: () => Navigator.of(context).pop(true), - child: const Text('Confirm'), + child: Text(context.l10n.confirm), ), ], ); diff --git a/AdminUi/apps/admin_ui/lib/core/modals/settings_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/settings_dialog.dart index 863f5fe865..f765bec3c4 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/settings_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/settings_dialog.dart @@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart'; import 'package:watch_it/watch_it.dart'; import '../constants.dart'; +import '../extensions.dart'; import '../models/models.dart'; Future openSettingsDialog(BuildContext context) async { @@ -17,26 +18,26 @@ class _SettingsDialog extends StatelessWidget with WatchItMixin { final themeMode = watchValue((ThemeModeModel x) => x.themeMode); return AlertDialog( - title: const Text('Settings'), + title: Text(context.l10n.settings), content: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('Theme', style: Theme.of(context).textTheme.bodyLarge), + Text(context.l10n.theme, style: Theme.of(context).textTheme.bodyLarge), Gaps.h4, SegmentedButton( showSelectedIcon: false, - segments: const [ - ButtonSegment(value: ThemeMode.light, icon: Icon(Icons.light_mode), label: Text('Light')), - ButtonSegment(value: ThemeMode.system, icon: Icon(Icons.settings), label: Text('System')), - ButtonSegment(value: ThemeMode.dark, icon: Icon(Icons.dark_mode), label: Text('Dark')), + segments: [ + ButtonSegment(value: ThemeMode.light, icon: const Icon(Icons.light_mode), label: Text(context.l10n.light)), + ButtonSegment(value: ThemeMode.system, icon: const Icon(Icons.settings), label: Text(context.l10n.system)), + ButtonSegment(value: ThemeMode.dark, icon: const Icon(Icons.dark_mode), label: Text(context.l10n.dark)), ], selected: {themeMode}, onSelectionChanged: (selected) => GetIt.I().setThemeMode(selected.first), ), ], ), - actions: [FilledButton(onPressed: () => context.pop(), child: const Text('Close'))], + actions: [FilledButton(onPressed: () => context.pop(), child: Text(context.l10n.close))], ); } } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart index 505ba42002..2db171f987 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import '../constants.dart'; +import '../extensions.dart'; class AppTitle extends StatelessWidget { final EdgeInsetsGeometry? padding; @@ -20,8 +21,8 @@ class AppTitle extends StatelessWidget { Text.rich( TextSpan( children: [ - TextSpan(text: 'enmeshed', style: textStyle.copyWith(fontWeight: FontWeight.bold)), - const TextSpan(text: ' Backbone Admin UI', style: textStyle), + TextSpan(text: context.l10n.enmeshed, style: textStyle.copyWith(fontWeight: FontWeight.bold)), + TextSpan(text: context.l10n.backboneAdminUI, style: textStyle), ], ), ), diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index cb946037cb..9bdd21f869 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -2,6 +2,7 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import '../../constants.dart'; +import '../../extensions.dart'; import 'identities_data_table_source.dart'; export 'identities_data_table_source.dart'; @@ -36,26 +37,26 @@ class _IdentitiesDataTableState extends State { isVerticalScrollBarVisible: true, renderEmptyRowsInTheEnd: false, availableRowsPerPage: const [5, 10, 25, 50, 100], - empty: const Text('No identities found.'), + empty: Text(context.l10n.cancel), errorBuilder: (error) => Center( child: Column( mainAxisSize: MainAxisSize.min, children: [ - const Text('An error occurred loading the data.'), + Text(context.l10n.dataLoadingError), Gaps.h16, - FilledButton(onPressed: widget.dataSource.refreshDatasource, child: const Text('Retry')), + FilledButton(onPressed: widget.dataSource.refreshDatasource, child: Text(context.l10n.retry)), ], ), ), columns: [ - DataColumn2(label: const Text('Address'), size: ColumnSize.L, onSort: _sort), - if (!widget.hideTierColumn) const DataColumn2(label: Text('Tier'), size: ColumnSize.S), - DataColumn2(label: const Text('Created with Client'), onSort: _sort), - DataColumn2(label: const Text('Number of Devices'), onSort: _sort), - DataColumn2(label: const Text('Created at'), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: const Text('Last Login at'), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: const Text('Datawallet version'), onSort: _sort), - DataColumn2(label: const Text('Identity Version'), onSort: _sort), + DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), + if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), + DataColumn2(label: Text(context.l10n.createdWithClient), onSort: _sort), + DataColumn2(label: Text(context.l10n.numberOfDevices), onSort: _sort), + DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), + DataColumn2(label: Text(context.l10n.lastLoginAt), size: ColumnSize.S, onSort: _sort), + DataColumn2(label: Text(context.l10n.datawalletVersion), onSort: _sort), + DataColumn2(label: Text(context.l10n.identityVersion), onSort: _sort), ], ); } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index f88740fa07..71af57bce4 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -5,6 +5,7 @@ import 'package:intl/intl.dart'; import 'package:multi_dropdown/multiselect_dropdown.dart'; import '../../constants.dart'; +import '../../extensions.dart'; import '../filters/filters.dart'; class IdentitiesFilter extends StatefulWidget { @@ -60,7 +61,7 @@ class _IdentitiesFilterState extends State { mainAxisSize: MainAxisSize.min, children: [ InputField( - label: 'Address', + label: context.l10n.address, onEnteredText: (String enteredText) { _filter = _filter.copyWith(address: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); widget.onFilterChanged(filter: _filter); @@ -69,8 +70,8 @@ class _IdentitiesFilterState extends State { if (widget.fixedTierId == null) ...[ Gaps.w16, MultiSelectFilter( - label: 'Tiers', - searchLabel: 'Search Tiers', + label: context.l10n.tiers, + searchLabel: context.l10n.searchTiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { final selectedTiers = selectedOptions.map((item) => item.value!).toList(); @@ -81,8 +82,8 @@ class _IdentitiesFilterState extends State { ], Gaps.w16, MultiSelectFilter( - label: 'Clients', - searchLabel: 'Search Clients', + label: context.l10n.clients, + searchLabel: context.l10n.searchClients, controller: _clientController, onOptionSelected: (List> selectedOptions) { final selectedClients = selectedOptions.map((item) => item.value!).toList(); @@ -92,7 +93,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: 'Number of Devices', + label: context.l10n.numberOfDevices, onNumberSelected: (FilterOperator operator, String enteredValue) { final numberOfDevices = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(numberOfDevices: numberOfDevices.value.isEmpty ? const Optional.absent() : Optional(numberOfDevices)); @@ -101,7 +102,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, DateFilter( - label: 'Created At', + label: context.l10n.createdAt, onFilterSelected: (FilterOperator operator, DateTime? selectedDate) { final createdAt = FilterOperatorValue(operator, selectedDate != null ? DateFormat('yyyy-MM-dd').format(selectedDate) : ''); _filter = _filter.copyWith(createdAt: createdAt.value.isEmpty ? const Optional.absent() : Optional(createdAt)); @@ -110,7 +111,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, DateFilter( - label: 'Last Login At', + label: context.l10n.lastLoginAt, onFilterSelected: (FilterOperator operator, DateTime? selectedDate) { final lastLoginAt = FilterOperatorValue(operator, selectedDate != null ? DateFormat('yyyy-MM-dd').format(selectedDate) : ''); _filter = _filter.copyWith(lastLoginAt: lastLoginAt.value.isEmpty ? const Optional.absent() : Optional(lastLoginAt)); @@ -119,7 +120,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: 'Datawallet Version', + label: context.l10n.datawalletVersion, onNumberSelected: (FilterOperator operator, String enteredValue) { final datawalletVersion = FilterOperatorValue(operator, enteredValue); _filter = @@ -129,7 +130,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: 'Identity Version', + label: context.l10n.identityVersion, onNumberSelected: (FilterOperator operator, String enteredValue) { final identityVersion = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(identityVersion: identityVersion.value.isEmpty ? const Optional.absent() : Optional(identityVersion)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index 9c86397c3e..9186bc9ed8 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import '../constants.dart'; +import '../extensions.dart'; import '../modals/modals.dart'; class QuotasButtonGroup extends StatefulWidget { @@ -62,9 +63,9 @@ class _QuotasButtonGroupState extends State { Future _removeSelectedQuotas() async { final confirmed = await showConfirmationDialog( context: context, - title: 'Remove Quotas', + title: context.l10n.removeQuota, message: - 'Are you sure you want to remove the selected quotas from ${widget.identityAddress != null ? 'the identity "${widget.identityAddress}"' : 'the tier "${widget.tierId}"'}?', + '${context.l10n.deletionOfQuotaMessage} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.theTier} "${widget.tierId}"'}?', ); if (!confirmed) return; @@ -73,8 +74,8 @@ class _QuotasButtonGroupState extends State { final result = await _deleteQuota(quota); if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('An error occurred while deleting the quota(s). Please try again.'), + SnackBar( + content: Text(context.l10n.errorOccurrence), showCloseIcon: true, ), ); @@ -87,8 +88,8 @@ class _QuotasButtonGroupState extends State { widget.selectedQuotas.clear(); if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Selected quota(s) have been removed.'), + SnackBar( + content: Text(context.l10n.selectedQuotaWasRemoved), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index 4181beb0d7..af19ed8874 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -123,7 +123,7 @@ class _ClientsFilterRowState extends State { mainAxisSize: MainAxisSize.min, children: [ InputField( - label: 'Client ID', + label: context.l10n.clientID, onEnteredText: (String enteredText) { filter = filter.copyWith(clientId: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -132,7 +132,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, InputField( - label: 'Display Name', + label: context.l10n.displayName, onEnteredText: (String enteredText) { filter = filter.copyWith(displayName: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -141,8 +141,8 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, MultiSelectFilter( - label: 'Default Tier', - searchLabel: 'Search Tiers', + label: context.l10n.defaultTier, + searchLabel: context.l10n.searchTiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { filter = filter.copyWith( @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, NumberFilter( - label: 'Number of Identitites', + label: context.l10n.numberOfIdentities, onNumberSelected: (FilterOperator operator, String enteredValue) { filter = filter.copyWith( numberOfIdentities: enteredValue.isEmpty ? const Optional.absent() : Optional((operator, int.parse(enteredValue))), @@ -165,7 +165,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, DateFilter( - label: 'Created At', + label: context.l10n.createdAt, onFilterSelected: (FilterOperator operator, DateTime? selectedDate) { filter = filter.copyWith( createdAt: selectedDate == null ? const Optional.absent() : Optional((operator, selectedDate)), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 4679c22052..09298589d9 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('A list of existing Clients')), + appBar: AppBar(title: Text(context.l10n.listOfExistingClients)), body: Card( child: Padding( padding: const EdgeInsets.all(8), @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State { Expanded( child: DataTable2( isVerticalScrollBarVisible: true, - empty: const Text('No clients found.'), + empty: Text(context.l10n.noClientsFound), onSelectAll: (selected) { if (selected == null) return; @@ -80,13 +80,13 @@ class _ClientsOverviewState extends State { } }); }, - columns: const [ - DataColumn2(label: Text('Client ID'), size: ColumnSize.L), - DataColumn2(label: Text('Display Name'), size: ColumnSize.L), - DataColumn2(label: Text('Default Tier')), - DataColumn2(label: Text('Number of Identities'), size: ColumnSize.L), - DataColumn2(label: Text('Created At')), - DataColumn2(label: Text(''), size: ColumnSize.L), + columns: [ + DataColumn2(label: Text(context.l10n.clientID), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.displayName), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.defaultTier)), + DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.createdAt)), + const DataColumn2(label: Text(''), size: ColumnSize.L), ], rows: _originalClients .where((e) => _filter.matches(e)) @@ -121,7 +121,7 @@ class _ClientsOverviewState extends State { style: ButtonStyle(backgroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.primary)), onPressed: () => showChangeClientSecretDialog(context: context, clientId: client.clientId), child: Text( - 'Change Client Secret', + context.l10n.changeClientSecret, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary), textAlign: TextAlign.center, ), @@ -153,8 +153,8 @@ class _ClientsOverviewState extends State { Future _removeSelectedClients() async { final confirmed = await showConfirmationDialog( context: context, - title: 'Remove Clients', - message: 'Are you sure you want to remove the selected clients?', + title: context.l10n.removeClients, + message: context.l10n.removeClientsMessage, ); if (!confirmed) return; @@ -163,8 +163,8 @@ class _ClientsOverviewState extends State { final result = await GetIt.I.get().clients.deleteClient(clientId); if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('An error occurred while deleting the client(s). Please try again.'), + SnackBar( + content: Text(context.l10n.errorOccurredDeletingClient), showCloseIcon: true, ), ); @@ -178,8 +178,8 @@ class _ClientsOverviewState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Selected clients have been removed.'), + SnackBar( + content: Text(context.l10n.selectedClientsWereRemovedMessage), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index cd5e4a2f9a..c0c0feea63 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -55,7 +55,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: const Text('Change Client Secret', textAlign: TextAlign.center), + title: Text(context.l10n.changeClientSecret, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -68,8 +68,8 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: 'Client Secret', - helperText: 'A Client Secret will be generated if this field is left blank.', + labelText: context.l10n.clientSecret, + helperText: context.l10n.clientSecretMessage, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -81,9 +81,9 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: 'Copy to clipboard.', + tooltip: context.l10n.copyToClipboard, clipboardText: _newClientSecretController.text, - successMessage: 'Client Secret copied to clipboard.', + successMessage: context.l10n.copyToClipboardMessage, ), ], ), @@ -94,7 +94,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { Padding( padding: const EdgeInsets.symmetric(vertical: 8), child: Text( - 'Please save the Client Secret since it will be inaccessible after exiting.', + context.l10n.saveTheClientSecretMessage, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index 75d5de3feb..4ddce0efce 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -63,7 +63,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: const Text('Create Client', textAlign: TextAlign.center), + title: Text(context.l10n.createClient, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -72,20 +72,20 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { TextField( controller: _clientIdController, readOnly: _saveSucceeded, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Client ID', - helperText: 'A Client ID will be generated if this field is left blank.', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.clientID, + helperText: context.l10n.clientIDMessage, ), ), Gaps.h24, TextField( controller: _displayNameController, readOnly: _saveSucceeded, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Display Name', - helperText: 'Client ID will be used as a Display Name if no value is provided.', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.displayName, + helperText: context.l10n.displayNameMessage, ), ), Gaps.h24, @@ -95,8 +95,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: 'Client Secret', - helperText: 'A Client Secret will be generated if this field is left blank.', + labelText: context.l10n.clientSecret, + helperText: context.l10n.clientSecretMessage, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -108,9 +108,9 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: 'Copy to clipboard.', + tooltip: context.l10n.copyToClipboard, clipboardText: _clientSecretController.text, - successMessage: 'Client Secret copied to clipboard.', + successMessage: context.l10n.copyToClipboardMessage, ), ], ), @@ -120,7 +120,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { if (_saveSucceeded) ...[ Gaps.h16, Text( - 'Please save the Client Secret since it will be inaccessible after exiting.', + context.l10n.saveTheClientSecretMessage, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ], @@ -128,11 +128,11 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { TextField( controller: _maxIdentitiesController, readOnly: _saveSucceeded, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Max Identities', - helperText: 'The maximum number of Identities that can be created with this Client.' - '\nNo Identity limit will be assigned if this field is left blank.', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.maxIdentities, + helperText: '${context.l10n.maxIdentitiesMessage}' + '\n${context.l10n.noIdentityLimitMessage}', ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, @@ -140,9 +140,9 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { Gaps.h24, DropdownButtonFormField( isExpanded: true, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Default Tier*', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: context.l10n.defaultTier, ), value: _chosenDefaultTier, onChanged: _saveSucceeded ? null : (tier) => setState(() => _chosenDefaultTier = tier), diff --git a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart index c02da15765..052f1de7be 100644 --- a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('A list of existing Identities')), + appBar: AppBar(title: Text(context.l10n.listOfExistingIdentities)), body: Card( child: Padding( padding: const EdgeInsets.all(8), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart index 43f3ed5f1f..09709fbf15 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart @@ -127,7 +127,7 @@ class _IdentityDetailsCard extends StatelessWidget { Gaps.w16, CopyToClipboardButton( clipboardText: identityDetails.address, - successMessage: 'Identity address copied to clipboard.', + successMessage: context.l10n.identityCopiedToClipboardMessage, ), ], ), @@ -138,26 +138,26 @@ class _IdentityDetailsCard extends StatelessWidget { runSpacing: 8, children: [ _IdentityDetails( - title: 'Client ID', + title: context.l10n.clientID, value: identityDetails.clientId, ), _IdentityDetails( - title: 'Public Key', + title: context.l10n.publicKey, value: identityDetails.publicKey.ellipsize(20), onIconPressed: () => context.setClipboardDataWithSuccessNotification( clipboardText: identityDetails.publicKey, - successMessage: 'Public key copied to clipboard.', + successMessage: context.l10n.publicKeyCopiedToClipboardMessage, ), icon: Icons.copy, - tooltipMessage: 'Copy public key', + tooltipMessage: context.l10n.copyPublicKey, ), _IdentityDetails( - title: 'Created at', + title: context.l10n.createdAt, value: '${DateFormat.yMd(Localizations.localeOf(context).languageCode).format(identityDetails.createdAt)} ${DateFormat.Hms().format(identityDetails.createdAt)}', ), _IdentityDetails( - title: 'Tier', + title: context.l10n.tier, value: currentTier.name, onIconPressed: currentTier.canBeManuallyAssigned ? () => showChangeTierDialog( @@ -168,7 +168,7 @@ class _IdentityDetailsCard extends StatelessWidget { ) : null, icon: Icons.edit, - tooltipMessage: 'Change tier', + tooltipMessage: context.l10n.changeTier, ), ], ), @@ -201,7 +201,7 @@ class _IdentityDetails extends StatelessWidget { Widget build(BuildContext context) { assert( onIconPressed == null || (onIconPressed != null && icon != null || tooltipMessage != null), - 'If edit is provided, icon and tooltipMessage must be provided too.', + context.l10n.editProvidedMessage, ); return RawChip( diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index 1256aa1833..bfce672e34 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -26,8 +26,8 @@ class IdentityQuotaListState extends State { return Theme( data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( - title: const Text('Quotas'), - subtitle: const Text('View and assign quotas for this identity.'), + title: Text(context.l10n.quotas), + subtitle: Text(context.l10n.viewAndAssignQuotasForIdentity), children: [ Card( child: Column( @@ -42,19 +42,19 @@ class IdentityQuotaListState extends State { width: double.infinity, height: 500, child: DataTable2( - columns: const [ - DataColumn2(label: Text('Metric')), - DataColumn2(label: Text('Source'), size: ColumnSize.S), - DataColumn2(label: Text('Usage (Used/Max)'), size: ColumnSize.L), - DataColumn2(label: Text('Period'), size: ColumnSize.S), - DataColumn2(label: Text(''), size: ColumnSize.S), + columns: [ + DataColumn2(label: Text(context.l10n.metric)), + DataColumn2(label: Text(context.l10n.source), size: ColumnSize.S), + DataColumn2(label: Text(context.l10n.usage), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.period), size: ColumnSize.S), + const DataColumn2(label: Text(''), size: ColumnSize.S), ], - empty: const Text('No quotas applied for this identity.'), + empty: Text(context.l10n.noQuotasAppliedForIdentity), rows: groupedQuotas.entries.expand((entry) { final metricName = entry.key; final quotas = entry.value; - final hasIndividualQuota = quotas.any((quota) => quota.source == 'Individual'); + final hasIndividualQuota = quotas.any((quota) => quota.source == context.l10n.individual); return [ DataRow2( @@ -69,9 +69,9 @@ class IdentityQuotaListState extends State { ), ...quotas.map( (quota) { - final isTierQuota = quota.source == 'Tier'; + final isTierQuota = quota.source == context.l10n.tier; final shouldDisable = isTierQuota && hasIndividualQuota; - final tooltipMessage = shouldDisable ? 'Tier quotas do not take effect if there is an individual quota.' : null; + final tooltipMessage = shouldDisable ? context.l10n.tierQuotaEffectMessage : null; return DataRow2( selected: _selectedQuotas.contains(quota.id), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart index 12b3ea9981..ecf304958c 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart @@ -52,7 +52,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: const Text('Change Tier', textAlign: TextAlign.center), + title: Text(context.l10n.changeTier, textAlign: TextAlign.center), content: DropdownButtonFormField( value: selectedTier, decoration: const InputDecoration(border: OutlineInputBorder()), @@ -87,9 +87,9 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { if (response.hasError) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Failed to update identity. Please try again.'), - duration: Duration(seconds: 3), + SnackBar( + content: Text(context.l10n.failedToUpdateIdentityMessage), + duration: const Duration(seconds: 3), ), ); @@ -99,9 +99,9 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { } ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Identity updated successfully.'), - duration: Duration(seconds: 3), + SnackBar( + content: Text(context.l10n.identityUpdatedMessage), + duration: const Duration(seconds: 3), ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 33b47ab0a6..2b2b882771 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -63,7 +63,7 @@ class _TierDetailState extends State { Text.rich( TextSpan( children: [ - TextSpan(text: 'ID: ', style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), + TextSpan(text: context.l10n.id, style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), TextSpan(text: tierDetails.id, style: Theme.of(context).textTheme.bodyLarge), ], ), @@ -71,7 +71,8 @@ class _TierDetailState extends State { Text.rich( TextSpan( children: [ - TextSpan(text: 'Name: ', style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), + TextSpan( + text: context.l10n.name, style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), TextSpan(text: tierDetails.name, style: Theme.of(context).textTheme.bodyLarge), ], ), @@ -119,10 +120,8 @@ class _QuotaListState extends State<_QuotaList> { return Theme( data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( - title: const Text('Quotas'), - subtitle: isQueuedForDeletionTier - ? const Text('View quotas for this tier. This tier is managed by the system and therefore read-only.') - : const Text('View and assign quotas for this tier.'), + title: Text(context.l10n.quotas), + subtitle: isQueuedForDeletionTier ? Text(context.l10n.viewQuotasForTheTier) : Text(context.l10n.viewAndAssignQuotasForTier), children: [ Card( child: Column( @@ -137,12 +136,12 @@ class _QuotaListState extends State<_QuotaList> { width: double.infinity, height: 500, child: DataTable2( - columns: const [ - DataColumn(label: Text('Metric')), - DataColumn(label: Text('Max')), - DataColumn(label: Text('Period')), + columns: [ + DataColumn(label: Text(context.l10n.metric)), + DataColumn(label: Text(context.l10n.max)), + DataColumn(label: Text(context.l10n.period)), ], - empty: const Text('No quotas added to this tier.'), + empty: Text(context.l10n.noQuotasAddedForTier), rows: widget.tierDetails.quotas .map( (quota) => DataRow2( @@ -215,8 +214,8 @@ class _IdentitiesListState extends State<_IdentitiesList> { return Theme( data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( - title: const Text('Identities'), - subtitle: const Text('View Identities associated with this Tier.'), + title: Text(context.l10n.identities), + subtitle: Text(context.l10n.viewIdentitiesAssociatedWithTier), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index 73f92de7de..28c705af17 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -44,7 +44,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { return PopScope( canPop: !_isLoading, child: AlertDialog( - title: const Text('Create Tier'), + title: Text(context.l10n.createTier), content: _isLoading ? const Padding( padding: EdgeInsets.all(16), @@ -53,7 +53,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { : Column( mainAxisSize: MainAxisSize.min, children: [ - const Text('Please fill the form below to create your Tier'), + Text(context.l10n.formMessageForTier), Gaps.h16, TextField( controller: _tierNameController, @@ -65,7 +65,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { onSubmitted: _onSubmitted, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: 'Name', + labelText: context.l10n.name, error: _errorMessage != null ? Text( _errorMessage!, @@ -84,7 +84,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { ), FilledButton( onPressed: _isLoading ? null : () => _onSubmitted(_tierNameController.text), - child: const Text('Create'), + child: Text(context.l10n.create), ), ], ), @@ -93,7 +93,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { Future _onSubmitted(String name) async { if (name.isEmpty) { - _setErrorMessage('Name cannot be empty.'); + _setErrorMessage(context.l10n.nameCannotBeEmptyMessage); _focusNode.requestFocus(); return; } diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index dc9311c1fd..a003ce3329 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:go_router/go_router.dart'; +import '/core/core.dart'; import 'modals/show_create_tier_dialog.dart'; class TiersOverview extends StatefulWidget { @@ -50,11 +51,11 @@ class _TiersOverviewState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Tiers', + context.l10n.tiers, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 30), ), Text( - 'A list of all Tiers', + context.l10n.listOfAllTiers, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 13), ), ], @@ -87,10 +88,10 @@ class _TiersOverviewState extends State { child: DataTable2( isVerticalScrollBarVisible: true, showCheckboxColumn: false, - empty: const Text('No tiers found.'), - columns: const [ - DataColumn2(label: Text('Name'), size: ColumnSize.L), - DataColumn2(label: Text('Number of Identities'), size: ColumnSize.L), + empty: Text(context.l10n.noTiersFound), + columns: [ + DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), ], rows: _tiers! .map( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index d170ca5ee4..4662221ff4 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -1,7 +1,104 @@ { - "@@locale": "en", - "cancel": "Cancel", - "close": "Close", - "save": "Save", - "yes": "Yes" + "@@locale": "en", + "add": "Add", + "addQuota": "Add Quota", + "address": "Address", + "listOfExistingClients": "A list of existing Clients", + "listOfExistingIdentities": "A list of existing Identities", + "listOfAllTiers": "A list of all Tiers", + "backboneAdminUI": " Backbone AdminUI", + "cancel": "Cancel", + "close": "Close", + "confirm": "Confirm", + "createdWithClient": "Created with Client", + "createdAt": "Created At", + "clients": "Clients", + "changeClientSecret": "Change Client Secret", + "clientSecret": "Client Secret", + "clientSecretMessage": "A Client Secret will be generated if this field is left blank.", + "copyToClipboard": "Copy to clipboard", + "copyToClipboardMessage": "Client Secret copied to clipboard.", + "createClient": "Create Client", + "clientID": "Client ID", + "clientIDMessage": "A Client ID will be generated if this field is left blank.", + "changeTier": "Change Tier", + "copyPublicKey": "Copy public key", + "createTier": "Create Tier", + "create": "Create", + "day": "Day", + "dark": "Dark", + "dataException": "Failed to load data", + "dataLoadingError": "An error occurred loading the data.", + "datawalletVersion": "Datawallet Version", + "deletionOfQuotaMessage": "Are you sure you want to remove the selected quotas from", + "displayName": "Display Name", + "displayNameMessage": "Client ID will be used as a Display Name if no value is provided.", + "defaultTier": "Default Tier", + "exclusiveTierIdOrAddress": "Only one of tierId or address can be provided", + "emptyIdentityMessage": "No identities found.", + "enmeshed": "enmeshed", + "errorOccurrence": "An error occurred while deleting the quota(s). Please try again.", + "errorOccurredDeletingClient": "An error occurred while deleting the client(s). Please try again.", + "editProvidedMessage": "If edit is provided, icon and tooltipMessage must be provided too.", + "failedToUpdateIdentityMessage": "Failed to update identity. Please try again.", + "formMessageForTier": "Please fill the form below to create your Tier", + "helperMaxAmount": "Only numbers greater or equal to 0 are valid.", + "hour": "Hour", + "invalidState": "Invalid State", + "identityVersion": "Identity Version", + "individual": "Individual", + "identityUpdatedMessage": "Identity updated successfully.", + "identityCopiedToClipboardMessage": "Identity address copied to clipboard.", + "id": "ID: ", + "identities": "Identities", + "light": "Light", + "lastLoginAt": "Last Login at", + "metric": "Metric*", + "maxAmount": "Max Amount", + "month": "Month", + "maxIdentities": "Max Identities", + "maxIdentitiesMessage": "The maximum number of Identities that can be created with this Client.", + "max": "Max", + "numberOfDevices": "Number of Devices", + "noIdentityLimitMessage": "No Identity limit will be assigned if this field is left blank.", + "numberOfIdentities": "Number of Identities", + "noClientsFound": "No clients found.", + "noTiersFound": "No tiers found.", + "noQuotasAppliedForIdentity": "No quotas applied for this identity.", + "noQuotasAddedForTier": "No quotas added to this tier.", + "name": "Name: ", + "nameCannotBeEmptyMessage": "Name cannot be empty.", + "period": "Period", + "publicKey": "Public Key", + "publicKeyCopiedToClipboardMessage": "Public key copied to clipboard.", + "quotas": "Quotas", + "requirementOfTierIdOrAddress": "Either tierId or address must be provided", + "retry": "Retry", + "removeQuota": "Remove Quota", + "removeClients": "Remove Clients", + "removeClientsMessage": "Are you sure you want to remove the selected clients?", + "settings": "Settings", + "system": "System", + "searchTiers": "Search Tiers", + "searchClients": "Search Clients", + "save": "Save", + "selectedQuotaWasRemoved": "Selected quota(s) have been removed.", + "selectedClientsWereRemovedMessage": "Selected clients have been removed.", + "source": "Source", + "saveTheClientSecretMessage": "Please save the Client Secret since it will be inaccessible after exiting.", + "theme": "Theme", + "tiers": "Tiers", + "tier": "Tier", + "theIdentity": "the identity", + "theTier": "the tier", + "tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", + "tierCreatedSuccessfullyMessage": "Tier was created successfully.", + "usage": "Usage (Used/Max)", + "viewAndAssignQuotasForIdentity": "View and assign quotas for this identity.", + "viewQuotasForTheTier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", + "viewAndAssignQuotasForTier": "View and assign quotas for this tier.", + "viewIdentitiesAssociatedWithTier": "View Identities associated with this Tier.", + "week": "Week", + "yes": "Yes", + "year": "Year" } From 76fa31028ebc252bee607467a22f5d64af5dc25e Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 09:55:39 +0200 Subject: [PATCH 02/19] fix: add trailing comma --- AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 2b2b882771..46d81d1313 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -72,7 +72,9 @@ class _TierDetailState extends State { TextSpan( children: [ TextSpan( - text: context.l10n.name, style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), + text: context.l10n.name, + style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold), + ), TextSpan(text: tierDetails.name, style: Theme.of(context).textTheme.bodyLarge), ], ), From c1dc59eee92095434fb9bdf82cec6ca20de8f0a8 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 12:31:15 +0200 Subject: [PATCH 03/19] fix: remove fixed names --- AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart | 5 ++--- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart index 2db171f987..a38c18b6d8 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import '../constants.dart'; -import '../extensions.dart'; class AppTitle extends StatelessWidget { final EdgeInsetsGeometry? padding; @@ -21,8 +20,8 @@ class AppTitle extends StatelessWidget { Text.rich( TextSpan( children: [ - TextSpan(text: context.l10n.enmeshed, style: textStyle.copyWith(fontWeight: FontWeight.bold)), - TextSpan(text: context.l10n.backboneAdminUI, style: textStyle), + TextSpan(text: 'enmeshed', style: textStyle.copyWith(fontWeight: FontWeight.bold)), + const TextSpan(text: ' Backbone AdminUI', style: textStyle), ], ), ), diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 4662221ff4..c399400403 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -6,7 +6,6 @@ "listOfExistingClients": "A list of existing Clients", "listOfExistingIdentities": "A list of existing Identities", "listOfAllTiers": "A list of all Tiers", - "backboneAdminUI": " Backbone AdminUI", "cancel": "Cancel", "close": "Close", "confirm": "Confirm", @@ -36,7 +35,6 @@ "defaultTier": "Default Tier", "exclusiveTierIdOrAddress": "Only one of tierId or address can be provided", "emptyIdentityMessage": "No identities found.", - "enmeshed": "enmeshed", "errorOccurrence": "An error occurred while deleting the quota(s). Please try again.", "errorOccurredDeletingClient": "An error occurred while deleting the client(s). Please try again.", "editProvidedMessage": "If edit is provided, icon and tooltipMessage must be provided too.", From 4f3bddce6c7c429f63571885d00107982a96be3f Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 13:45:34 +0200 Subject: [PATCH 04/19] fix: localization structure and add context translation keys --- .../lib/core/modals/add_quota_dialog.dart | 8 +- .../identities_data_table.dart | 10 +- .../identities_filter.dart | 10 +- .../lib/core/widgets/quotas_button_group.dart | 6 +- .../home/clients_overview/clients_filter.dart | 4 +- .../clients_overview/clients_overview.dart | 12 +- .../modals/create_client_dialog.dart | 4 +- .../identities_overview.dart | 2 +- .../identity_details/identity_details.dart | 2 +- .../modals/show_create_tier_dialog.dart | 2 +- .../home/tiers_overview/tiers_overview.dart | 6 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 197 +++++++++++------- 12 files changed, 159 insertions(+), 104 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index a031635339..5330665575 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -13,8 +13,8 @@ Future showAddQuotaDialog({ String? tierId, String? identityAddress, }) async { - assert(tierId != null || identityAddress != null, context.l10n.requirementOfTierIdOrAddress); - assert(tierId == null || identityAddress == null, context.l10n.exclusiveTierIdOrAddress); + assert(tierId != null || identityAddress != null, 'Either tierId or address must be provided'); + assert(tierId == null || identityAddress == null, 'Only one of tierId or address can be provided'); final metrics = await GetIt.I.get().quotas.getMetrics(); @@ -103,8 +103,8 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { enabled: !_saving, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.maxAmount, - helperText: context.l10n.helperMaxAmount, + labelText: context.l10n.maxEntities('Amount'), + helperText: context.l10n.maxAmountMessage, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index 9bdd21f869..f6851375d7 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -37,12 +37,12 @@ class _IdentitiesDataTableState extends State { isVerticalScrollBarVisible: true, renderEmptyRowsInTheEnd: false, availableRowsPerPage: const [5, 10, 25, 50, 100], - empty: Text(context.l10n.cancel), + empty: Text(context.l10n.noEntitiesFound('identities')), errorBuilder: (error) => Center( child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text(context.l10n.dataLoadingError), + Text(context.l10n.error_data_load_failed), Gaps.h16, FilledButton(onPressed: widget.dataSource.refreshDatasource, child: Text(context.l10n.retry)), ], @@ -52,11 +52,11 @@ class _IdentitiesDataTableState extends State { DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), DataColumn2(label: Text(context.l10n.createdWithClient), onSort: _sort), - DataColumn2(label: Text(context.l10n.numberOfDevices), onSort: _sort), + DataColumn2(label: Text(context.l10n.numberOfEntities('Devices')), onSort: _sort), DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), DataColumn2(label: Text(context.l10n.lastLoginAt), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.datawalletVersion), onSort: _sort), - DataColumn2(label: Text(context.l10n.identityVersion), onSort: _sort), + DataColumn2(label: Text(context.l10n.entityVersion('Datawallet')), onSort: _sort), + DataColumn2(label: Text(context.l10n.entityVersion('Identity')), onSort: _sort), ], ); } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index 71af57bce4..07116fe273 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -71,7 +71,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.tiers, - searchLabel: context.l10n.searchTiers, + searchLabel: context.l10n.searchEntities('Tiers'), controller: _tierController, onOptionSelected: (List> selectedOptions) { final selectedTiers = selectedOptions.map((item) => item.value!).toList(); @@ -83,7 +83,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.clients, - searchLabel: context.l10n.searchClients, + searchLabel: context.l10n.searchEntities('Clients'), controller: _clientController, onOptionSelected: (List> selectedOptions) { final selectedClients = selectedOptions.map((item) => item.value!).toList(); @@ -93,7 +93,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfDevices, + label: context.l10n.numberOfEntities('Devices'), onNumberSelected: (FilterOperator operator, String enteredValue) { final numberOfDevices = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(numberOfDevices: numberOfDevices.value.isEmpty ? const Optional.absent() : Optional(numberOfDevices)); @@ -120,7 +120,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.datawalletVersion, + label: context.l10n.entityVersion('Datawallet'), onNumberSelected: (FilterOperator operator, String enteredValue) { final datawalletVersion = FilterOperatorValue(operator, enteredValue); _filter = @@ -130,7 +130,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.identityVersion, + label: context.l10n.entityVersion('Identity'), onNumberSelected: (FilterOperator operator, String enteredValue) { final identityVersion = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(identityVersion: identityVersion.value.isEmpty ? const Optional.absent() : Optional(identityVersion)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index 9186bc9ed8..7b0ea3f37c 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -63,7 +63,7 @@ class _QuotasButtonGroupState extends State { Future _removeSelectedQuotas() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeQuota, + title: context.l10n.removeEntities('Quotas'), message: '${context.l10n.deletionOfQuotaMessage} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.theTier} "${widget.tierId}"'}?', ); @@ -75,7 +75,7 @@ class _QuotasButtonGroupState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.errorOccurrence), + content: Text(context.l10n.errorOccurredWhileDeletingEntities('quota(s)')), showCloseIcon: true, ), ); @@ -89,7 +89,7 @@ class _QuotasButtonGroupState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selectedQuotaWasRemoved), + content: Text(context.l10n.selectedEntityWasRemoved('quota(s)')), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index af19ed8874..43648265ea 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -142,7 +142,7 @@ class _ClientsFilterRowState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.defaultTier, - searchLabel: context.l10n.searchTiers, + searchLabel: context.l10n.searchEntities('Tiers'), controller: _tierController, onOptionSelected: (List> selectedOptions) { filter = filter.copyWith( @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfIdentities, + label: context.l10n.numberOfEntities('Identities'), onNumberSelected: (FilterOperator operator, String enteredValue) { filter = filter.copyWith( numberOfIdentities: enteredValue.isEmpty ? const Optional.absent() : Optional((operator, int.parse(enteredValue))), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 09298589d9..80e141a8be 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingClients)), + appBar: AppBar(title: Text(context.l10n.listOfExistingEntities('Clients'))), body: Card( child: Padding( padding: const EdgeInsets.all(8), @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State { Expanded( child: DataTable2( isVerticalScrollBarVisible: true, - empty: Text(context.l10n.noClientsFound), + empty: Text(context.l10n.noEntitiesFound('clients')), onSelectAll: (selected) { if (selected == null) return; @@ -84,7 +84,7 @@ class _ClientsOverviewState extends State { DataColumn2(label: Text(context.l10n.clientID), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.displayName), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.defaultTier)), - DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfEntities('Identities')), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.createdAt)), const DataColumn2(label: Text(''), size: ColumnSize.L), ], @@ -153,7 +153,7 @@ class _ClientsOverviewState extends State { Future _removeSelectedClients() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeClients, + title: context.l10n.removeEntities('Clients'), message: context.l10n.removeClientsMessage, ); @@ -164,7 +164,7 @@ class _ClientsOverviewState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.errorOccurredDeletingClient), + content: Text(context.l10n.errorOccurredWhileDeletingEntities('client(s)')), showCloseIcon: true, ), ); @@ -179,7 +179,7 @@ class _ClientsOverviewState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selectedClientsWereRemovedMessage), + content: Text(context.l10n.selectedEntityWasRemoved('clients')), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index 4ddce0efce..80d7606b4a 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -63,7 +63,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.createClient, textAlign: TextAlign.center), + title: Text(context.l10n.createEntity('Client'), textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -130,7 +130,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.maxIdentities, + labelText: context.l10n.maxEntities('Identities'), helperText: '${context.l10n.maxIdentitiesMessage}' '\n${context.l10n.noIdentityLimitMessage}', ), diff --git a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart index 052f1de7be..23f92bde1d 100644 --- a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingIdentities)), + appBar: AppBar(title: Text(context.l10n.listOfExistingEntities('Identities'))), body: Card( child: Padding( padding: const EdgeInsets.all(8), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart index 09709fbf15..b79e5f1ca4 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart @@ -201,7 +201,7 @@ class _IdentityDetails extends StatelessWidget { Widget build(BuildContext context) { assert( onIconPressed == null || (onIconPressed != null && icon != null || tooltipMessage != null), - context.l10n.editProvidedMessage, + 'If edit is provided, icon and tooltipMessage must be provided too.', ); return RawChip( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index 28c705af17..b241a9dd38 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -44,7 +44,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { return PopScope( canPop: !_isLoading, child: AlertDialog( - title: Text(context.l10n.createTier), + title: Text(context.l10n.createEntity('Tier')), content: _isLoading ? const Padding( padding: EdgeInsets.all(16), diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index a003ce3329..4e764e61cc 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -55,7 +55,7 @@ class _TiersOverviewState extends State { style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 30), ), Text( - context.l10n.listOfAllTiers, + context.l10n.listOfExistingEntities('Tiers'), style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 13), ), ], @@ -88,10 +88,10 @@ class _TiersOverviewState extends State { child: DataTable2( isVerticalScrollBarVisible: true, showCheckboxColumn: false, - empty: Text(context.l10n.noTiersFound), + empty: Text(context.l10n.noEntitiesFound('tiers')), columns: [ DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfEntities('Identities')), size: ColumnSize.L), ], rows: _tiers! .map( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index c399400403..39f275b5de 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -1,102 +1,157 @@ { "@@locale": "en", - "add": "Add", + "add": "Add", "addQuota": "Add Quota", "address": "Address", - "listOfExistingClients": "A list of existing Clients", - "listOfExistingIdentities": "A list of existing Identities", - "listOfAllTiers": "A list of all Tiers", "cancel": "Cancel", - "close": "Close", - "confirm": "Confirm", - "createdWithClient": "Created with Client", - "createdAt": "Created At", - "clients": "Clients", "changeClientSecret": "Change Client Secret", - "clientSecret": "Client Secret", - "clientSecretMessage": "A Client Secret will be generated if this field is left blank.", - "copyToClipboard": "Copy to clipboard", - "copyToClipboardMessage": "Client Secret copied to clipboard.", - "createClient": "Create Client", - "clientID": "Client ID", - "clientIDMessage": "A Client ID will be generated if this field is left blank.", "changeTier": "Change Tier", + "clientID": "Client ID", + "clientSecret": "Client Secret", + "clients": "Clients", + "close": "Close", + "confirm": "Confirm", "copyPublicKey": "Copy public key", - "createTier": "Create Tier", + "copyToClipboard": "Copy to clipboard", "create": "Create", - "day": "Day", + "createdAt": "Created At", + "createdWithClient": "Created with Client", "dark": "Dark", - "dataException": "Failed to load data", - "dataLoadingError": "An error occurred loading the data.", - "datawalletVersion": "Datawallet Version", - "deletionOfQuotaMessage": "Are you sure you want to remove the selected quotas from", - "displayName": "Display Name", - "displayNameMessage": "Client ID will be used as a Display Name if no value is provided.", + "day": "Day", "defaultTier": "Default Tier", - "exclusiveTierIdOrAddress": "Only one of tierId or address can be provided", - "emptyIdentityMessage": "No identities found.", - "errorOccurrence": "An error occurred while deleting the quota(s). Please try again.", - "errorOccurredDeletingClient": "An error occurred while deleting the client(s). Please try again.", - "editProvidedMessage": "If edit is provided, icon and tooltipMessage must be provided too.", - "failedToUpdateIdentityMessage": "Failed to update identity. Please try again.", - "formMessageForTier": "Please fill the form below to create your Tier", - "helperMaxAmount": "Only numbers greater or equal to 0 are valid.", + "displayName": "Display Name", "hour": "Hour", - "invalidState": "Invalid State", - "identityVersion": "Identity Version", - "individual": "Individual", - "identityUpdatedMessage": "Identity updated successfully.", - "identityCopiedToClipboardMessage": "Identity address copied to clipboard.", "id": "ID: ", "identities": "Identities", - "light": "Light", + "individual": "Individual", + "invalidState": "Invalid State", "lastLoginAt": "Last Login at", + "light": "Light", + "max": "Max", "metric": "Metric*", - "maxAmount": "Max Amount", "month": "Month", - "maxIdentities": "Max Identities", - "maxIdentitiesMessage": "The maximum number of Identities that can be created with this Client.", - "max": "Max", - "numberOfDevices": "Number of Devices", - "noIdentityLimitMessage": "No Identity limit will be assigned if this field is left blank.", - "numberOfIdentities": "Number of Identities", - "noClientsFound": "No clients found.", - "noTiersFound": "No tiers found.", - "noQuotasAppliedForIdentity": "No quotas applied for this identity.", - "noQuotasAddedForTier": "No quotas added to this tier.", "name": "Name: ", - "nameCannotBeEmptyMessage": "Name cannot be empty.", "period": "Period", "publicKey": "Public Key", - "publicKeyCopiedToClipboardMessage": "Public key copied to clipboard.", "quotas": "Quotas", - "requirementOfTierIdOrAddress": "Either tierId or address must be provided", "retry": "Retry", - "removeQuota": "Remove Quota", - "removeClients": "Remove Clients", - "removeClientsMessage": "Are you sure you want to remove the selected clients?", - "settings": "Settings", - "system": "System", - "searchTiers": "Search Tiers", - "searchClients": "Search Clients", "save": "Save", - "selectedQuotaWasRemoved": "Selected quota(s) have been removed.", - "selectedClientsWereRemovedMessage": "Selected clients have been removed.", + "settings": "Settings", "source": "Source", - "saveTheClientSecretMessage": "Please save the Client Secret since it will be inaccessible after exiting.", - "theme": "Theme", - "tiers": "Tiers", - "tier": "Tier", + "system": "System", "theIdentity": "the identity", "theTier": "the tier", - "tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", - "tierCreatedSuccessfullyMessage": "Tier was created successfully.", + "theme": "Theme", + "tier": "Tier", + "tiers": "Tiers", "usage": "Usage (Used/Max)", - "viewAndAssignQuotasForIdentity": "View and assign quotas for this identity.", + "week": "Week", + "year": "Year", + "yes": "Yes", + "error_data_load_failed": "Failed to load data", + "error_loading_data": "An error occurred loading the data.", + "noQuotasAppliedForIdentity": "No quotas applied for this identity.", + "noQuotasAddedForTier": "No quotas added to this tier.", + "clientIDMessage": "A Client ID will be generated if this field is left blank.", + "clientSecretMessage": "A Client Secret will be generated if this field is left blank.", + "copyToClipboardMessage": "Client Secret copied to clipboard.", + "deletionOfQuotaMessage": "Are you sure you want to remove the selected quotas from", + "displayNameMessage": "Client ID will be used as a Display Name if no value is provided.", + "failedToUpdateIdentityMessage": "Failed to update identity. Please try again.", + "formMessageForTier": "Please fill the form below to create your Tier", + "identityCopiedToClipboardMessage": "Identity address copied to clipboard.", + "identityUpdatedMessage": "Identity updated successfully.", + "maxIdentitiesMessage": "The maximum number of Identities that can be created with this Client.", + "maxAmountMessage": "Only numbers greater or equal to 0 are valid.", + "nameCannotBeEmptyMessage": "Name cannot be empty.", + "noIdentityLimitMessage": "No Identity limit will be assigned if this field is left blank.", + "publicKeyCopiedToClipboardMessage": "Public key copied to clipboard.", + "removeClientsMessage": "Are you sure you want to remove the selected clients?", + "saveTheClientSecretMessage": "Please save the Client Secret since it will be inaccessible after exiting.", + "tierCreatedSuccessfullyMessage": "Tier was created successfully.", + "tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", "viewQuotasForTheTier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", + "viewAndAssignQuotasForIdentity": "View and assign quotas for this identity.", "viewAndAssignQuotasForTier": "View and assign quotas for this tier.", "viewIdentitiesAssociatedWithTier": "View Identities associated with this Tier.", - "week": "Week", - "yes": "Yes", - "year": "Year" + "createEntity": "Create {entityName}", + "@createEntity": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "removeEntities": "Remove {entityName}", + "@removeEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "entityVersion": "{entityName} Version", + "@entityVersion": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "numberOfEntities": "Number of {entityName}", + "@numberOfEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "searchEntities": "Search {entityName}", + "@searchEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "errorOccurredWhileDeletingEntities": "An error occurred while deleting the {entityName}. Please try again.", + "@errorOccurredWhileDeletingEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "maxEntities": "Max {entityName}", + "@maxEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "noEntitiesFound": "No {entityName} found.", + "@noEntitiesFound": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "listOfExistingEntities": "A list of existing {entityName}", + "@listOfExistingEntities": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, + "selectedEntityWasRemoved": "Selected {entityName} have been removed.", + "@selectedEntityWasRemoved": { + "placeholders": { + "entityName": { + "type": "String" + } + } + } } From 9b3ae28d672f6163027f2449505c472d19cf6ce7 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 16:26:53 +0200 Subject: [PATCH 05/19] chore: extract more context text --- .../modals/change_client_secret_dialog.dart | 2 +- .../modals/create_client_dialog.dart | 4 ++-- .../identity_quotas_table.dart | 2 +- .../lib/home/tier_detail/tier_detail.dart | 2 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 20 +++++++++++++++---- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index c0c0feea63..ee71c7f339 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -69,7 +69,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.clientSecret, - helperText: context.l10n.clientSecretMessage, + helperText: context.l10n.clientDataMessage(context.l10n.clientSecret), suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index 80d7606b4a..c77de37966 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -75,7 +75,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.clientID, - helperText: context.l10n.clientIDMessage, + helperText: context.l10n.clientDataMessage(context.l10n.clientID), ), ), Gaps.h24, @@ -96,7 +96,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.clientSecret, - helperText: context.l10n.clientSecretMessage, + helperText: context.l10n.clientDataMessage(context.l10n.clientSecret), suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index bfce672e34..c32195d5eb 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -27,7 +27,7 @@ class IdentityQuotaListState extends State { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: Text(context.l10n.viewAndAssignQuotasForIdentity), + subtitle: Text(context.l10n.viewAndAssignQuotasForEntity('identity')), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 46d81d1313..670745fadd 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -123,7 +123,7 @@ class _QuotaListState extends State<_QuotaList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: isQueuedForDeletionTier ? Text(context.l10n.viewQuotasForTheTier) : Text(context.l10n.viewAndAssignQuotasForTier), + subtitle: isQueuedForDeletionTier ? Text(context.l10n.viewQuotasForTheTier) : Text(context.l10n.viewAndAssignQuotasForEntity('tier')), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 39f275b5de..dfc4e9c7f4 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -52,8 +52,6 @@ "error_loading_data": "An error occurred loading the data.", "noQuotasAppliedForIdentity": "No quotas applied for this identity.", "noQuotasAddedForTier": "No quotas added to this tier.", - "clientIDMessage": "A Client ID will be generated if this field is left blank.", - "clientSecretMessage": "A Client Secret will be generated if this field is left blank.", "copyToClipboardMessage": "Client Secret copied to clipboard.", "deletionOfQuotaMessage": "Are you sure you want to remove the selected quotas from", "displayNameMessage": "Client ID will be used as a Display Name if no value is provided.", @@ -71,8 +69,6 @@ "tierCreatedSuccessfullyMessage": "Tier was created successfully.", "tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", "viewQuotasForTheTier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", - "viewAndAssignQuotasForIdentity": "View and assign quotas for this identity.", - "viewAndAssignQuotasForTier": "View and assign quotas for this tier.", "viewIdentitiesAssociatedWithTier": "View Identities associated with this Tier.", "createEntity": "Create {entityName}", "@createEntity": { @@ -106,6 +102,14 @@ } } }, + "clientDataMessage": "A {entityName} will be generated if this field is left blank.", + "@clientDataMessage": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, "searchEntities": "Search {entityName}", "@searchEntities": { "placeholders": { @@ -122,6 +126,14 @@ } } }, + "viewAndAssignQuotasForEntity": "View and assign quotas for this {entityName}.", + "@viewAndAssignQuotasForEntity": { + "placeholders": { + "entityName": { + "type": "String" + } + } + }, "maxEntities": "Max {entityName}", "@maxEntities": { "placeholders": { From 45c083a42801c5b5c50afb6c27f493a272dfe7af Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 11 Jun 2024 16:28:57 +0200 Subject: [PATCH 06/19] chore: add space --- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index dfc4e9c7f4..1a2baab1c2 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -1,6 +1,6 @@ { "@@locale": "en", - "add": "Add", + "add": "Add", "addQuota": "Add Quota", "address": "Address", "cancel": "Cancel", From 172cbe5a2960c1c218339af20cb01809138b48e4 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 20 Jun 2024 10:13:42 +0200 Subject: [PATCH 07/19] fix: change from camel case to underscore notation --- .../identities_data_table.dart | 4 +- .../identities_filter.dart | 2 +- .../lib/core/widgets/quotas_button_group.dart | 2 +- .../home/clients_overview/clients_filter.dart | 6 +- .../clients_overview/clients_overview.dart | 8 +-- .../modals/change_client_secret_dialog.dart | 10 +-- .../modals/create_client_dialog.dart | 24 +++---- .../identity_quotas_table.dart | 4 +- .../identity_details/modals/change_tier.dart | 4 +- .../lib/home/tier_detail/tier_detail.dart | 6 +- .../modals/show_create_tier_dialog.dart | 4 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 62 +++++++++---------- 12 files changed, 68 insertions(+), 68 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index f6851375d7..0342b3a456 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -51,10 +51,10 @@ class _IdentitiesDataTableState extends State { columns: [ DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), - DataColumn2(label: Text(context.l10n.createdWithClient), onSort: _sort), + DataColumn2(label: Text(context.l10n.created_with_client), onSort: _sort), DataColumn2(label: Text(context.l10n.numberOfEntities('Devices')), onSort: _sort), DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.lastLoginAt), size: ColumnSize.S, onSort: _sort), + DataColumn2(label: Text(context.l10n.last_login_at), size: ColumnSize.S, onSort: _sort), DataColumn2(label: Text(context.l10n.entityVersion('Datawallet')), onSort: _sort), DataColumn2(label: Text(context.l10n.entityVersion('Identity')), onSort: _sort), ], diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index 07116fe273..1c56f35740 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -111,7 +111,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, DateFilter( - label: context.l10n.lastLoginAt, + label: context.l10n.last_login_at, onFilterSelected: (FilterOperator operator, DateTime? selectedDate) { final lastLoginAt = FilterOperatorValue(operator, selectedDate != null ? DateFormat('yyyy-MM-dd').format(selectedDate) : ''); _filter = _filter.copyWith(lastLoginAt: lastLoginAt.value.isEmpty ? const Optional.absent() : Optional(lastLoginAt)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index 7b0ea3f37c..5f5158afb2 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -65,7 +65,7 @@ class _QuotasButtonGroupState extends State { context: context, title: context.l10n.removeEntities('Quotas'), message: - '${context.l10n.deletionOfQuotaMessage} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.theTier} "${widget.tierId}"'}?', + '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', ); if (!confirmed) return; diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index 43648265ea..dccc6d3d53 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -123,7 +123,7 @@ class _ClientsFilterRowState extends State { mainAxisSize: MainAxisSize.min, children: [ InputField( - label: context.l10n.clientID, + label: context.l10n.client_ID, onEnteredText: (String enteredText) { filter = filter.copyWith(clientId: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -132,7 +132,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, InputField( - label: context.l10n.displayName, + label: context.l10n.display_name, onEnteredText: (String enteredText) { filter = filter.copyWith(displayName: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -141,7 +141,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, MultiSelectFilter( - label: context.l10n.defaultTier, + label: context.l10n.default_tier, searchLabel: context.l10n.searchEntities('Tiers'), controller: _tierController, onOptionSelected: (List> selectedOptions) { diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 80e141a8be..03f1c10db7 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -81,9 +81,9 @@ class _ClientsOverviewState extends State { }); }, columns: [ - DataColumn2(label: Text(context.l10n.clientID), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.displayName), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.defaultTier)), + DataColumn2(label: Text(context.l10n.client_ID), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.display_name), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.default_tier)), DataColumn2(label: Text(context.l10n.numberOfEntities('Identities')), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.createdAt)), const DataColumn2(label: Text(''), size: ColumnSize.L), @@ -154,7 +154,7 @@ class _ClientsOverviewState extends State { final confirmed = await showConfirmationDialog( context: context, title: context.l10n.removeEntities('Clients'), - message: context.l10n.removeClientsMessage, + message: context.l10n.remove_clients_message, ); if (!confirmed) return; diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index ee71c7f339..a2cb1a579f 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -68,8 +68,8 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.clientSecret, - helperText: context.l10n.clientDataMessage(context.l10n.clientSecret), + labelText: context.l10n.client_secret, + helperText: context.l10n.clientDataMessage(context.l10n.client_secret), suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -81,9 +81,9 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: context.l10n.copyToClipboard, + tooltip: context.l10n.copy_to_clipboard, clipboardText: _newClientSecretController.text, - successMessage: context.l10n.copyToClipboardMessage, + successMessage: context.l10n.copy_to_clipboard_message, ), ], ), @@ -94,7 +94,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { Padding( padding: const EdgeInsets.symmetric(vertical: 8), child: Text( - context.l10n.saveTheClientSecretMessage, + context.l10n.save_the_client_secret_message, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index c77de37966..b85eacd7af 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -74,8 +74,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.clientID, - helperText: context.l10n.clientDataMessage(context.l10n.clientID), + labelText: context.l10n.client_ID, + helperText: context.l10n.clientDataMessage(context.l10n.client_ID), ), ), Gaps.h24, @@ -84,8 +84,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.displayName, - helperText: context.l10n.displayNameMessage, + labelText: context.l10n.display_name, + helperText: context.l10n.display_name_message, ), ), Gaps.h24, @@ -95,8 +95,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.clientSecret, - helperText: context.l10n.clientDataMessage(context.l10n.clientSecret), + labelText: context.l10n.client_secret, + helperText: context.l10n.clientDataMessage(context.l10n.client_secret), suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -108,9 +108,9 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: context.l10n.copyToClipboard, + tooltip: context.l10n.copy_to_clipboard, clipboardText: _clientSecretController.text, - successMessage: context.l10n.copyToClipboardMessage, + successMessage: context.l10n.copy_to_clipboard_message, ), ], ), @@ -120,7 +120,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { if (_saveSucceeded) ...[ Gaps.h16, Text( - context.l10n.saveTheClientSecretMessage, + context.l10n.save_the_client_secret_message, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ], @@ -131,8 +131,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.maxEntities('Identities'), - helperText: '${context.l10n.maxIdentitiesMessage}' - '\n${context.l10n.noIdentityLimitMessage}', + helperText: '${context.l10n.max_identities_message}' + '\n${context.l10n.no_identity_limit_message}', ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, @@ -142,7 +142,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { isExpanded: true, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.defaultTier, + labelText: context.l10n.default_tier, ), value: _chosenDefaultTier, onChanged: _saveSucceeded ? null : (tier) => setState(() => _chosenDefaultTier = tier), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index c32195d5eb..2964386767 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -49,7 +49,7 @@ class IdentityQuotaListState extends State { DataColumn2(label: Text(context.l10n.period), size: ColumnSize.S), const DataColumn2(label: Text(''), size: ColumnSize.S), ], - empty: Text(context.l10n.noQuotasAppliedForIdentity), + empty: Text(context.l10n.no_quotas_applied_for_identity), rows: groupedQuotas.entries.expand((entry) { final metricName = entry.key; final quotas = entry.value; @@ -71,7 +71,7 @@ class IdentityQuotaListState extends State { (quota) { final isTierQuota = quota.source == context.l10n.tier; final shouldDisable = isTierQuota && hasIndividualQuota; - final tooltipMessage = shouldDisable ? context.l10n.tierQuotaEffectMessage : null; + final tooltipMessage = shouldDisable ? context.l10n.tier_quota_effect_message : null; return DataRow2( selected: _selectedQuotas.contains(quota.id), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart index ecf304958c..11cee40055 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart @@ -88,7 +88,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { if (response.hasError) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.failedToUpdateIdentityMessage), + content: Text(context.l10n.failed_to_update_identity_message), duration: const Duration(seconds: 3), ), ); @@ -100,7 +100,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.identityUpdatedMessage), + content: Text(context.l10n.identity_updated_message), duration: const Duration(seconds: 3), ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 670745fadd..ca99f618fa 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -123,7 +123,7 @@ class _QuotaListState extends State<_QuotaList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: isQueuedForDeletionTier ? Text(context.l10n.viewQuotasForTheTier) : Text(context.l10n.viewAndAssignQuotasForEntity('tier')), + subtitle: isQueuedForDeletionTier ? Text(context.l10n.view_quotas_for_the_tier) : Text(context.l10n.viewAndAssignQuotasForEntity('tier')), children: [ Card( child: Column( @@ -143,7 +143,7 @@ class _QuotaListState extends State<_QuotaList> { DataColumn(label: Text(context.l10n.max)), DataColumn(label: Text(context.l10n.period)), ], - empty: Text(context.l10n.noQuotasAddedForTier), + empty: Text(context.l10n.no_quotas_added_for_tier), rows: widget.tierDetails.quotas .map( (quota) => DataRow2( @@ -217,7 +217,7 @@ class _IdentitiesListState extends State<_IdentitiesList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.identities), - subtitle: Text(context.l10n.viewIdentitiesAssociatedWithTier), + subtitle: Text(context.l10n.view_identities_associated_with_tier), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index b241a9dd38..f7ca16e681 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -53,7 +53,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { : Column( mainAxisSize: MainAxisSize.min, children: [ - Text(context.l10n.formMessageForTier), + Text(context.l10n.form_message_for_tier), Gaps.h16, TextField( controller: _tierNameController, @@ -93,7 +93,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { Future _onSubmitted(String name) async { if (name.isEmpty) { - _setErrorMessage(context.l10n.nameCannotBeEmptyMessage); + _setErrorMessage(context.l10n.name_cannot_be_empty_message); _focusNode.requestFocus(); return; } diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 1a2baab1c2..903fe63f7b 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -6,33 +6,33 @@ "cancel": "Cancel", "changeClientSecret": "Change Client Secret", "changeTier": "Change Tier", - "clientID": "Client ID", - "clientSecret": "Client Secret", + "client_ID": "Client ID", + "client_secret": "Client Secret", "clients": "Clients", "close": "Close", "confirm": "Confirm", - "copyPublicKey": "Copy public key", - "copyToClipboard": "Copy to clipboard", + "copy_public_key": "Copy public key", + "copy_to_clipboard": "Copy to clipboard", "create": "Create", "createdAt": "Created At", - "createdWithClient": "Created with Client", + "created_with_client": "Created with Client", "dark": "Dark", "day": "Day", - "defaultTier": "Default Tier", - "displayName": "Display Name", + "default_tier": "Default Tier", + "display_name": "Display Name", "hour": "Hour", "id": "ID: ", "identities": "Identities", "individual": "Individual", - "invalidState": "Invalid State", - "lastLoginAt": "Last Login at", + "invalid_state": "Invalid State", + "last_login_at": "Last Login at", "light": "Light", "max": "Max", "metric": "Metric*", "month": "Month", "name": "Name: ", "period": "Period", - "publicKey": "Public Key", + "public_key": "Public Key", "quotas": "Quotas", "retry": "Retry", "save": "Save", @@ -40,7 +40,7 @@ "source": "Source", "system": "System", "theIdentity": "the identity", - "theTier": "the tier", + "the_tier": "the tier", "theme": "Theme", "tier": "Tier", "tiers": "Tiers", @@ -50,26 +50,26 @@ "yes": "Yes", "error_data_load_failed": "Failed to load data", "error_loading_data": "An error occurred loading the data.", - "noQuotasAppliedForIdentity": "No quotas applied for this identity.", - "noQuotasAddedForTier": "No quotas added to this tier.", - "copyToClipboardMessage": "Client Secret copied to clipboard.", - "deletionOfQuotaMessage": "Are you sure you want to remove the selected quotas from", - "displayNameMessage": "Client ID will be used as a Display Name if no value is provided.", - "failedToUpdateIdentityMessage": "Failed to update identity. Please try again.", - "formMessageForTier": "Please fill the form below to create your Tier", - "identityCopiedToClipboardMessage": "Identity address copied to clipboard.", - "identityUpdatedMessage": "Identity updated successfully.", - "maxIdentitiesMessage": "The maximum number of Identities that can be created with this Client.", - "maxAmountMessage": "Only numbers greater or equal to 0 are valid.", - "nameCannotBeEmptyMessage": "Name cannot be empty.", - "noIdentityLimitMessage": "No Identity limit will be assigned if this field is left blank.", - "publicKeyCopiedToClipboardMessage": "Public key copied to clipboard.", - "removeClientsMessage": "Are you sure you want to remove the selected clients?", - "saveTheClientSecretMessage": "Please save the Client Secret since it will be inaccessible after exiting.", - "tierCreatedSuccessfullyMessage": "Tier was created successfully.", - "tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", - "viewQuotasForTheTier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", - "viewIdentitiesAssociatedWithTier": "View Identities associated with this Tier.", + "no_quotas_applied_for_identity": "No quotas applied for this identity.", + "no_quotas_added_for_tier": "No quotas added to this tier.", + "copy_to_clipboard_message": "Client Secret copied to clipboard.", + "deletion_of_quota_message": "Are you sure you want to remove the selected quotas from", + "display_name_message": "Client ID will be used as a Display Name if no value is provided.", + "failed_to_update_identity_message": "Failed to update identity. Please try again.", + "form_message_for_tier": "Please fill the form below to create your Tier", + "identity_copied_to_clipboard_message": "Identity address copied to clipboard.", + "identity_updated_message": "Identity updated successfully.", + "max_identities_message": "The maximum number of Identities that can be created with this Client.", + "max_amount_message": "Only numbers greater or equal to 0 are valid.", + "name_cannot_be_empty_message": "Name cannot be empty.", + "no_identity_limit_message": "No Identity limit will be assigned if this field is left blank.", + "public_key_copied_to_clipboard_message": "Public key copied to clipboard.", + "remove_clients_message": "Are you sure you want to remove the selected clients?", + "save_the_client_secret_message": "Please save the Client Secret since it will be inaccessible after exiting.", + "tier_created_successfully_message": "Tier was created successfully.", + "tier_quota_effect_message": "Tier quotas do not take effect if there is an individual quota.", + "view_quotas_for_the_tier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", + "view_identities_associated_with_tier": "View Identities associated with this Tier.", "createEntity": "Create {entityName}", "@createEntity": { "placeholders": { From cee6d7795089e366d6d5c61d6184d8739a152939 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 20 Jun 2024 10:23:21 +0200 Subject: [PATCH 08/19] chore: addition to camel case to underscore fix --- .../lib/home/identity_details/identity_details.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart index b79e5f1ca4..a6ae4561d6 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart @@ -127,7 +127,7 @@ class _IdentityDetailsCard extends StatelessWidget { Gaps.w16, CopyToClipboardButton( clipboardText: identityDetails.address, - successMessage: context.l10n.identityCopiedToClipboardMessage, + successMessage: context.l10n.identity_copied_to_clipboard_message, ), ], ), @@ -138,18 +138,18 @@ class _IdentityDetailsCard extends StatelessWidget { runSpacing: 8, children: [ _IdentityDetails( - title: context.l10n.clientID, + title: context.l10n.client_ID, value: identityDetails.clientId, ), _IdentityDetails( - title: context.l10n.publicKey, + title: context.l10n.public_key, value: identityDetails.publicKey.ellipsize(20), onIconPressed: () => context.setClipboardDataWithSuccessNotification( clipboardText: identityDetails.publicKey, - successMessage: context.l10n.publicKeyCopiedToClipboardMessage, + successMessage: context.l10n.public_key_copied_to_clipboard_message, ), icon: Icons.copy, - tooltipMessage: context.l10n.copyPublicKey, + tooltipMessage: context.l10n.copy_public_key, ), _IdentityDetails( title: context.l10n.createdAt, From 5bf549732f887d0b9ed60f0188fb1daf9d01716e Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 20 Jun 2024 10:24:52 +0200 Subject: [PATCH 09/19] fix: remove localization from assert --- AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index 5330665575..5e23ed859b 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -104,7 +104,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.maxEntities('Amount'), - helperText: context.l10n.maxAmountMessage, + helperText: context.l10n.max_amount_message, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, @@ -153,7 +153,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { Future _addQuota() async { setState(() => _saving = true); - assert(_selectedMetric != null && _maxAmount != null && _selectedPeriod != null, context.l10n.invalidState); + assert(_selectedMetric != null && _maxAmount != null && _selectedPeriod != null, 'Invalid State'); final response = await widget.addQuota( metricKey: _selectedMetric!, From e3b3a6ab2b0bf36ff9d9dfd77339ebe343b107f6 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Fri, 21 Jun 2024 09:53:22 +0200 Subject: [PATCH 10/19] fix: remove invalid state --- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 1 - 1 file changed, 1 deletion(-) diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 903fe63f7b..cbb4044a73 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -24,7 +24,6 @@ "id": "ID: ", "identities": "Identities", "individual": "Individual", - "invalid_state": "Invalid State", "last_login_at": "Last Login at", "light": "Light", "max": "Max", From 5164ca12cf7e5fb0fc872ba72f905c638c7238f2 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 25 Jun 2024 11:07:50 +0200 Subject: [PATCH 11/19] fix: remove signs from translation --- .../admin_ui/lib/core/modals/add_quota_dialog.dart | 10 +++++----- .../admin_ui/lib/home/tier_detail/tier_detail.dart | 6 ++++-- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index 5e23ed859b..149b7b3c76 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -94,7 +94,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { onChanged: _saving ? null : (String? selected) => setState(() => _selectedMetric = selected), decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.metric, + labelText: '${context.l10n.metric}*', ), ), Gaps.h24, @@ -103,7 +103,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { enabled: !_saving, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.maxEntities('Amount'), + labelText: '${context.l10n.maxEntities('Amount')}*', helperText: context.l10n.max_amount_message, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], @@ -120,9 +120,9 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { DropdownMenuItem(value: 'Year', child: Text(context.l10n.year)), ], onChanged: _saving ? null : (String? selected) => setState(() => _selectedPeriod = selected), - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Period*', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: '${context.l10n.period}*', ), ), if (_errorMessage != null) diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index ca99f618fa..f28ed2b5d7 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -63,7 +63,9 @@ class _TierDetailState extends State { Text.rich( TextSpan( children: [ - TextSpan(text: context.l10n.id, style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), + TextSpan( + text: '${context.l10n.id}: ', + style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), TextSpan(text: tierDetails.id, style: Theme.of(context).textTheme.bodyLarge), ], ), @@ -72,7 +74,7 @@ class _TierDetailState extends State { TextSpan( children: [ TextSpan( - text: context.l10n.name, + text: '${context.l10n.name}: ', style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold), ), TextSpan(text: tierDetails.name, style: Theme.of(context).textTheme.bodyLarge), diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index cbb4044a73..2cd749c91e 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -21,15 +21,15 @@ "default_tier": "Default Tier", "display_name": "Display Name", "hour": "Hour", - "id": "ID: ", + "id": "ID", "identities": "Identities", "individual": "Individual", "last_login_at": "Last Login at", "light": "Light", "max": "Max", - "metric": "Metric*", + "metric": "Metric", "month": "Month", - "name": "Name: ", + "name": "Name", "period": "Period", "public_key": "Public Key", "quotas": "Quotas", From 3c2ffaae757b3a6e804943c85bb21c790ccaccdf Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 25 Jun 2024 11:09:42 +0200 Subject: [PATCH 12/19] fix: add sign to translated text --- .../lib/home/clients_overview/modals/create_client_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index b85eacd7af..2237b9bf4a 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -142,7 +142,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { isExpanded: true, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.default_tier, + labelText: '${context.l10n.default_tier}*', ), value: _chosenDefaultTier, onChanged: _saveSucceeded ? null : (tier) => setState(() => _chosenDefaultTier = tier), From 34a9e283fbf758da4425c8a209f9089559ae6571 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 25 Jun 2024 11:15:15 +0200 Subject: [PATCH 13/19] revert: undo the space for the app title --- AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart index a38c18b6d8..505ba42002 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/app_title.dart @@ -21,7 +21,7 @@ class AppTitle extends StatelessWidget { TextSpan( children: [ TextSpan(text: 'enmeshed', style: textStyle.copyWith(fontWeight: FontWeight.bold)), - const TextSpan(text: ' Backbone AdminUI', style: textStyle), + const TextSpan(text: ' Backbone Admin UI', style: textStyle), ], ), ), From 2732e043569d56ddfa7b5ae23419ad133919f325 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Tue, 25 Jun 2024 11:22:02 +0200 Subject: [PATCH 14/19] fix: add trailing comma --- AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index f28ed2b5d7..d882a655d5 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -64,8 +64,9 @@ class _TierDetailState extends State { TextSpan( children: [ TextSpan( - text: '${context.l10n.id}: ', - style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold)), + text: '${context.l10n.id}: ', + style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold), + ), TextSpan(text: tierDetails.id, style: Theme.of(context).textTheme.bodyLarge), ], ), From 90d629b6ea49dfc923cb944aecb946c3acbe4505 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 27 Jun 2024 09:48:06 +0200 Subject: [PATCH 15/19] fix: make text translatable --- .../admin_ui/lib/core/modals/add_quota_dialog.dart | 2 +- .../identities_data_table.dart | 8 ++++---- .../identities_data_table/identities_filter.dart | 10 +++++----- .../lib/core/widgets/quotas_button_group.dart | 6 +++--- .../lib/home/clients_overview/clients_filter.dart | 4 ++-- .../home/clients_overview/clients_overview.dart | 12 ++++++------ .../modals/create_client_dialog.dart | 4 ++-- .../identities_overview/identities_overview.dart | 2 +- .../identity_quotas_table.dart | 4 ++-- .../admin_ui/lib/home/tier_detail/tier_detail.dart | 4 +++- .../modals/show_create_tier_dialog.dart | 10 +++++----- .../lib/home/tiers_overview/tiers_overview.dart | 6 +++--- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 14 +++++++++++++- 13 files changed, 50 insertions(+), 36 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index 149b7b3c76..bd30eec125 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -103,7 +103,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { enabled: !_saving, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: '${context.l10n.maxEntities('Amount')}*', + labelText: '${context.l10n.maxEntities(context.l10n.amount)}*', helperText: context.l10n.max_amount_message, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index 0342b3a456..1696739fc3 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -37,7 +37,7 @@ class _IdentitiesDataTableState extends State { isVerticalScrollBarVisible: true, renderEmptyRowsInTheEnd: false, availableRowsPerPage: const [5, 10, 25, 50, 100], - empty: Text(context.l10n.noEntitiesFound('identities')), + empty: Text(context.l10n.noEntitiesFound(context.l10n.identities)), errorBuilder: (error) => Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -52,11 +52,11 @@ class _IdentitiesDataTableState extends State { DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), DataColumn2(label: Text(context.l10n.created_with_client), onSort: _sort), - DataColumn2(label: Text(context.l10n.numberOfEntities('Devices')), onSort: _sort), + DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.devices)), onSort: _sort), DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), DataColumn2(label: Text(context.l10n.last_login_at), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.entityVersion('Datawallet')), onSort: _sort), - DataColumn2(label: Text(context.l10n.entityVersion('Identity')), onSort: _sort), + DataColumn2(label: Text(context.l10n.entityVersion(context.l10n.datawallet)), onSort: _sort), + DataColumn2(label: Text(context.l10n.entityVersion(context.l10n.identity)), onSort: _sort), ], ); } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index 1c56f35740..33e506084f 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -71,7 +71,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.tiers, - searchLabel: context.l10n.searchEntities('Tiers'), + searchLabel: context.l10n.searchEntities(context.l10n.tiers), controller: _tierController, onOptionSelected: (List> selectedOptions) { final selectedTiers = selectedOptions.map((item) => item.value!).toList(); @@ -83,7 +83,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.clients, - searchLabel: context.l10n.searchEntities('Clients'), + searchLabel: context.l10n.searchEntities(context.l10n.clients), controller: _clientController, onOptionSelected: (List> selectedOptions) { final selectedClients = selectedOptions.map((item) => item.value!).toList(); @@ -93,7 +93,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfEntities('Devices'), + label: context.l10n.numberOfEntities(context.l10n.devices), onNumberSelected: (FilterOperator operator, String enteredValue) { final numberOfDevices = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(numberOfDevices: numberOfDevices.value.isEmpty ? const Optional.absent() : Optional(numberOfDevices)); @@ -120,7 +120,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.entityVersion('Datawallet'), + label: context.l10n.entityVersion(context.l10n.datawallet), onNumberSelected: (FilterOperator operator, String enteredValue) { final datawalletVersion = FilterOperatorValue(operator, enteredValue); _filter = @@ -130,7 +130,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.entityVersion('Identity'), + label: context.l10n.entityVersion(context.l10n.identity), onNumberSelected: (FilterOperator operator, String enteredValue) { final identityVersion = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(identityVersion: identityVersion.value.isEmpty ? const Optional.absent() : Optional(identityVersion)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index 5f5158afb2..cf6fcffcdb 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -63,7 +63,7 @@ class _QuotasButtonGroupState extends State { Future _removeSelectedQuotas() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeEntities('Quotas'), + title: context.l10n.removeEntities(context.l10n.quotas), message: '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', ); @@ -75,7 +75,7 @@ class _QuotasButtonGroupState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.errorOccurredWhileDeletingEntities('quota(s)')), + content: Text('${context.l10n.errorOccurredWhileDeletingEntities(context.l10n.quota_lc)}(s)'), showCloseIcon: true, ), ); @@ -89,7 +89,7 @@ class _QuotasButtonGroupState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selectedEntityWasRemoved('quota(s)')), + content: Text('${context.l10n.selectedEntityWasRemoved(context.l10n.quota_lc)}(s)'), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index dccc6d3d53..c8bf4165ec 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -142,7 +142,7 @@ class _ClientsFilterRowState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.default_tier, - searchLabel: context.l10n.searchEntities('Tiers'), + searchLabel: context.l10n.searchEntities(context.l10n.tiers), controller: _tierController, onOptionSelected: (List> selectedOptions) { filter = filter.copyWith( @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfEntities('Identities'), + label: context.l10n.numberOfEntities(context.l10n.identities), onNumberSelected: (FilterOperator operator, String enteredValue) { filter = filter.copyWith( numberOfIdentities: enteredValue.isEmpty ? const Optional.absent() : Optional((operator, int.parse(enteredValue))), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 03f1c10db7..24b9dd753e 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingEntities('Clients'))), + appBar: AppBar(title: Text(context.l10n.listOfExistingEntities(context.l10n.clients))), body: Card( child: Padding( padding: const EdgeInsets.all(8), @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State { Expanded( child: DataTable2( isVerticalScrollBarVisible: true, - empty: Text(context.l10n.noEntitiesFound('clients')), + empty: Text(context.l10n.noEntitiesFound(context.l10n.clients_lc)), onSelectAll: (selected) { if (selected == null) return; @@ -84,7 +84,7 @@ class _ClientsOverviewState extends State { DataColumn2(label: Text(context.l10n.client_ID), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.display_name), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.default_tier)), - DataColumn2(label: Text(context.l10n.numberOfEntities('Identities')), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.identities)), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.createdAt)), const DataColumn2(label: Text(''), size: ColumnSize.L), ], @@ -153,7 +153,7 @@ class _ClientsOverviewState extends State { Future _removeSelectedClients() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeEntities('Clients'), + title: context.l10n.removeEntities(context.l10n.clients), message: context.l10n.remove_clients_message, ); @@ -164,7 +164,7 @@ class _ClientsOverviewState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.errorOccurredWhileDeletingEntities('client(s)')), + content: Text('${context.l10n.errorOccurredWhileDeletingEntities(context.l10n.client_lc)}(s)'), showCloseIcon: true, ), ); @@ -179,7 +179,7 @@ class _ClientsOverviewState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selectedEntityWasRemoved('clients')), + content: Text(context.l10n.selectedEntityWasRemoved(context.l10n.clients_lc)), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index 2237b9bf4a..bcc34ce39a 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -63,7 +63,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.createEntity('Client'), textAlign: TextAlign.center), + title: Text(context.l10n.createEntity(context.l10n.client), textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -130,7 +130,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.maxEntities('Identities'), + labelText: context.l10n.maxEntities(context.l10n.identities), helperText: '${context.l10n.max_identities_message}' '\n${context.l10n.no_identity_limit_message}', ), diff --git a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart index 23f92bde1d..66811fd592 100644 --- a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingEntities('Identities'))), + appBar: AppBar(title: Text(context.l10n.listOfExistingEntities(context.l10n.identities))), body: Card( child: Padding( padding: const EdgeInsets.all(8), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index 2964386767..8aae1a047c 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -27,7 +27,7 @@ class IdentityQuotaListState extends State { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: Text(context.l10n.viewAndAssignQuotasForEntity('identity')), + subtitle: Text(context.l10n.viewAndAssignQuotasForEntity(context.l10n.identity)), children: [ Card( child: Column( @@ -45,7 +45,7 @@ class IdentityQuotaListState extends State { columns: [ DataColumn2(label: Text(context.l10n.metric)), DataColumn2(label: Text(context.l10n.source), size: ColumnSize.S), - DataColumn2(label: Text(context.l10n.usage), size: ColumnSize.L), + DataColumn2(label: Text('${context.l10n.usage} (${context.l10n.used}/${context.l10n.max})'), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.period), size: ColumnSize.S), const DataColumn2(label: Text(''), size: ColumnSize.S), ], diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index d882a655d5..6d82e495b1 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -126,7 +126,9 @@ class _QuotaListState extends State<_QuotaList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: isQueuedForDeletionTier ? Text(context.l10n.view_quotas_for_the_tier) : Text(context.l10n.viewAndAssignQuotasForEntity('tier')), + subtitle: isQueuedForDeletionTier + ? Text(context.l10n.view_quotas_for_the_tier) + : Text(context.l10n.viewAndAssignQuotasForEntity(context.l10n.tier_lc)), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index f7ca16e681..d172552fe6 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -44,7 +44,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { return PopScope( canPop: !_isLoading, child: AlertDialog( - title: Text(context.l10n.createEntity('Tier')), + title: Text(context.l10n.createEntity(context.l10n.tier)), content: _isLoading ? const Padding( padding: EdgeInsets.all(16), @@ -118,13 +118,13 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { }); void _showSuccessSnackbar() { - const snackBar = SnackBar( + final snackBar = SnackBar( content: Text( - 'Tier was created successfully.', - style: TextStyle(color: Colors.white), + context.l10n.tier_created_successfully_message, + style: const TextStyle(color: Colors.white), ), backgroundColor: Colors.green, - duration: Duration(seconds: 3), + duration: const Duration(seconds: 3), showCloseIcon: true, ); ScaffoldMessenger.of(context).showSnackBar(snackBar); diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index 4e764e61cc..e54127f5ea 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -55,7 +55,7 @@ class _TiersOverviewState extends State { style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 30), ), Text( - context.l10n.listOfExistingEntities('Tiers'), + context.l10n.listOfExistingEntities(context.l10n.tiers), style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 13), ), ], @@ -88,10 +88,10 @@ class _TiersOverviewState extends State { child: DataTable2( isVerticalScrollBarVisible: true, showCheckboxColumn: false, - empty: Text(context.l10n.noEntitiesFound('tiers')), + empty: Text(context.l10n.noEntitiesFound(context.l10n.tiers)), columns: [ DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.numberOfEntities('Identities')), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.identities)), size: ColumnSize.L), ], rows: _tiers! .map( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 2cd749c91e..b50e3e57d7 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -3,12 +3,16 @@ "add": "Add", "addQuota": "Add Quota", "address": "Address", + "amount": "Amount", "cancel": "Cancel", "changeClientSecret": "Change Client Secret", "changeTier": "Change Tier", "client_ID": "Client ID", "client_secret": "Client Secret", + "client": "Client", "clients": "Clients", + "clients_lc": "clients", + "client_lc": "client", "close": "Close", "confirm": "Confirm", "copy_public_key": "Copy public key", @@ -18,11 +22,14 @@ "created_with_client": "Created with Client", "dark": "Dark", "day": "Day", + "datawallet": "Datawallet", "default_tier": "Default Tier", + "devices": "Devices", "display_name": "Display Name", "hour": "Hour", "id": "ID", "identities": "Identities", + "identity": "Identity", "individual": "Individual", "last_login_at": "Last Login at", "light": "Light", @@ -42,8 +49,13 @@ "the_tier": "the tier", "theme": "Theme", "tier": "Tier", + "tier_lc": "tier", "tiers": "Tiers", - "usage": "Usage (Used/Max)", + "tiers_lc": "tiers", + "usage": "Usage", + "used": "Used", + "quotas": "Quotas", + "quota_lc": "quota", "week": "Week", "year": "Year", "yes": "Yes", From 1f62482222c818f2ff2bff7922a5ffafb9b7fa2a Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 27 Jun 2024 10:34:06 +0200 Subject: [PATCH 16/19] fix: remove translation within translation --- .../lib/core/modals/add_quota_dialog.dart | 2 +- .../identities_data_table.dart | 6 +- .../identities_filter.dart | 6 +- .../lib/core/widgets/quotas_button_group.dart | 2 +- .../home/clients_overview/clients_filter.dart | 2 +- .../clients_overview/clients_overview.dart | 6 +- .../modals/change_client_secret_dialog.dart | 2 +- .../modals/create_client_dialog.dart | 4 +- .../identity_details/identity_details.dart | 2 +- .../identity_details/modals/change_tier.dart | 2 +- .../modals/show_create_tier_dialog.dart | 2 +- .../home/tiers_overview/tiers_overview.dart | 2 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 57 ++++--------------- 13 files changed, 31 insertions(+), 64 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index bd30eec125..265c152f12 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -103,7 +103,7 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { enabled: !_saving, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: '${context.l10n.maxEntities(context.l10n.amount)}*', + labelText: '${context.l10n.max_amount}*', helperText: context.l10n.max_amount_message, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index 1696739fc3..0f40caaf44 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -52,11 +52,11 @@ class _IdentitiesDataTableState extends State { DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), DataColumn2(label: Text(context.l10n.created_with_client), onSort: _sort), - DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.devices)), onSort: _sort), + DataColumn2(label: Text(context.l10n.number_of_devices), onSort: _sort), DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), DataColumn2(label: Text(context.l10n.last_login_at), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.entityVersion(context.l10n.datawallet)), onSort: _sort), - DataColumn2(label: Text(context.l10n.entityVersion(context.l10n.identity)), onSort: _sort), + DataColumn2(label: Text(context.l10n.datawallet_version), onSort: _sort), + DataColumn2(label: Text(context.l10n.identity_version), onSort: _sort), ], ); } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index 33e506084f..f9db44c7fb 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -93,7 +93,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfEntities(context.l10n.devices), + label: context.l10n.number_of_devices, onNumberSelected: (FilterOperator operator, String enteredValue) { final numberOfDevices = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(numberOfDevices: numberOfDevices.value.isEmpty ? const Optional.absent() : Optional(numberOfDevices)); @@ -120,7 +120,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.entityVersion(context.l10n.datawallet), + label: context.l10n.datawallet_version, onNumberSelected: (FilterOperator operator, String enteredValue) { final datawalletVersion = FilterOperatorValue(operator, enteredValue); _filter = @@ -130,7 +130,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.entityVersion(context.l10n.identity), + label: context.l10n.identity_version, onNumberSelected: (FilterOperator operator, String enteredValue) { final identityVersion = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(identityVersion: identityVersion.value.isEmpty ? const Optional.absent() : Optional(identityVersion)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index cf6fcffcdb..eba1dff4eb 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -63,7 +63,7 @@ class _QuotasButtonGroupState extends State { Future _removeSelectedQuotas() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeEntities(context.l10n.quotas), + title: context.l10n.remove_quotas, message: '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index c8bf4165ec..b2c673238e 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.numberOfEntities(context.l10n.identities), + label: context.l10n.number_of_identities, onNumberSelected: (FilterOperator operator, String enteredValue) { filter = filter.copyWith( numberOfIdentities: enteredValue.isEmpty ? const Optional.absent() : Optional((operator, int.parse(enteredValue))), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 24b9dd753e..2ff5ba126f 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -84,7 +84,7 @@ class _ClientsOverviewState extends State { DataColumn2(label: Text(context.l10n.client_ID), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.display_name), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.default_tier)), - DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.identities)), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.number_of_identities), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.createdAt)), const DataColumn2(label: Text(''), size: ColumnSize.L), ], @@ -121,7 +121,7 @@ class _ClientsOverviewState extends State { style: ButtonStyle(backgroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.primary)), onPressed: () => showChangeClientSecretDialog(context: context, clientId: client.clientId), child: Text( - context.l10n.changeClientSecret, + context.l10n.change_client_secret, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary), textAlign: TextAlign.center, ), @@ -153,7 +153,7 @@ class _ClientsOverviewState extends State { Future _removeSelectedClients() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.removeEntities(context.l10n.clients), + title: context.l10n.remove_clients, message: context.l10n.remove_clients_message, ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index a2cb1a579f..06930ed755 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -55,7 +55,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.changeClientSecret, textAlign: TextAlign.center), + title: Text(context.l10n.change_client_secret, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index bcc34ce39a..56fda15456 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -63,7 +63,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.createEntity(context.l10n.client), textAlign: TextAlign.center), + title: Text(context.l10n.create_client, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -130,7 +130,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.maxEntities(context.l10n.identities), + labelText: context.l10n.max_identities, helperText: '${context.l10n.max_identities_message}' '\n${context.l10n.no_identity_limit_message}', ), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart index a6ae4561d6..f55e9a5d2a 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart @@ -168,7 +168,7 @@ class _IdentityDetailsCard extends StatelessWidget { ) : null, icon: Icons.edit, - tooltipMessage: context.l10n.changeTier, + tooltipMessage: context.l10n.change_tier, ), ], ), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart index 11cee40055..0016352318 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart @@ -52,7 +52,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.changeTier, textAlign: TextAlign.center), + title: Text(context.l10n.change_tier, textAlign: TextAlign.center), content: DropdownButtonFormField( value: selectedTier, decoration: const InputDecoration(border: OutlineInputBorder()), diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index d172552fe6..676ceffa2b 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -44,7 +44,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { return PopScope( canPop: !_isLoading, child: AlertDialog( - title: Text(context.l10n.createEntity(context.l10n.tier)), + title: Text(context.l10n.create_tier), content: _isLoading ? const Padding( padding: EdgeInsets.all(16), diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index e54127f5ea..cd9aa98bd6 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -91,7 +91,7 @@ class _TiersOverviewState extends State { empty: Text(context.l10n.noEntitiesFound(context.l10n.tiers)), columns: [ DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.numberOfEntities(context.l10n.identities)), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.number_of_identities), size: ColumnSize.L), ], rows: _tiers! .map( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index b50e3e57d7..2eb608470c 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -3,13 +3,13 @@ "add": "Add", "addQuota": "Add Quota", "address": "Address", - "amount": "Amount", "cancel": "Cancel", - "changeClientSecret": "Change Client Secret", - "changeTier": "Change Tier", + "change_client_secret": "Change Client Secret", + "change_tier": "Change Tier", "client_ID": "Client ID", "client_secret": "Client Secret", - "client": "Client", + "create_client": "Create Client", + "create_tier": "Create Tier", "clients": "Clients", "clients_lc": "clients", "client_lc": "client", @@ -22,7 +22,7 @@ "created_with_client": "Created with Client", "dark": "Dark", "day": "Day", - "datawallet": "Datawallet", + "datawallet_version": "Datawallet Version", "default_tier": "Default Tier", "devices": "Devices", "display_name": "Display Name", @@ -30,17 +30,24 @@ "id": "ID", "identities": "Identities", "identity": "Identity", + "identity_version": "Identity Version", "individual": "Individual", "last_login_at": "Last Login at", "light": "Light", "max": "Max", + "max_amount": "Max Amount", + "max_identities": "Max Identities", "metric": "Metric", "month": "Month", "name": "Name", + "number_of_devices": "Number of Devices", + "number_of_identities": "Number of Identities", "period": "Period", "public_key": "Public Key", "quotas": "Quotas", "retry": "Retry", + "remove_quotas": "Remove Quotas", + "remove_clients": "Remove Clients", "save": "Save", "settings": "Settings", "source": "Source", @@ -81,38 +88,6 @@ "tier_quota_effect_message": "Tier quotas do not take effect if there is an individual quota.", "view_quotas_for_the_tier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", "view_identities_associated_with_tier": "View Identities associated with this Tier.", - "createEntity": "Create {entityName}", - "@createEntity": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "removeEntities": "Remove {entityName}", - "@removeEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "entityVersion": "{entityName} Version", - "@entityVersion": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "numberOfEntities": "Number of {entityName}", - "@numberOfEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, "clientDataMessage": "A {entityName} will be generated if this field is left blank.", "@clientDataMessage": { "placeholders": { @@ -145,14 +120,6 @@ } } }, - "maxEntities": "Max {entityName}", - "@maxEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, "noEntitiesFound": "No {entityName} found.", "@noEntitiesFound": { "placeholders": { From 5b2c887b0f1079e06a5e5c5a090381eeb2f17a18 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Thu, 27 Jun 2024 12:26:46 +0200 Subject: [PATCH 17/19] fix: remove the rest of translation within translation --- .../identities_data_table.dart | 2 +- .../identities_filter.dart | 4 +- .../lib/core/widgets/quotas_button_group.dart | 6 +- .../home/clients_overview/clients_filter.dart | 2 +- .../clients_overview/clients_overview.dart | 8 +- .../modals/change_client_secret_dialog.dart | 2 +- .../modals/create_client_dialog.dart | 4 +- .../identities_overview.dart | 2 +- .../identity_quotas_table.dart | 2 +- .../lib/home/tier_detail/tier_detail.dart | 4 +- .../home/tiers_overview/tiers_overview.dart | 4 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 80 ++++--------------- 12 files changed, 36 insertions(+), 84 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index 0f40caaf44..25f9f3367c 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -37,7 +37,7 @@ class _IdentitiesDataTableState extends State { isVerticalScrollBarVisible: true, renderEmptyRowsInTheEnd: false, availableRowsPerPage: const [5, 10, 25, 50, 100], - empty: Text(context.l10n.noEntitiesFound(context.l10n.identities)), + empty: Text(context.l10n.no_identities_found), errorBuilder: (error) => Center( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index f9db44c7fb..bb17237b18 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -71,7 +71,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.tiers, - searchLabel: context.l10n.searchEntities(context.l10n.tiers), + searchLabel: context.l10n.search_tiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { final selectedTiers = selectedOptions.map((item) => item.value!).toList(); @@ -83,7 +83,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.clients, - searchLabel: context.l10n.searchEntities(context.l10n.clients), + searchLabel: context.l10n.search_clients, controller: _clientController, onOptionSelected: (List> selectedOptions) { final selectedClients = selectedOptions.map((item) => item.value!).toList(); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index eba1dff4eb..6957752260 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -65,7 +65,7 @@ class _QuotasButtonGroupState extends State { context: context, title: context.l10n.remove_quotas, message: - '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.theIdentity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', + '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.the_identity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', ); if (!confirmed) return; @@ -75,7 +75,7 @@ class _QuotasButtonGroupState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text('${context.l10n.errorOccurredWhileDeletingEntities(context.l10n.quota_lc)}(s)'), + content: Text(context.l10n.error_deleting_quota), showCloseIcon: true, ), ); @@ -89,7 +89,7 @@ class _QuotasButtonGroupState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text('${context.l10n.selectedEntityWasRemoved(context.l10n.quota_lc)}(s)'), + content: Text(context.l10n.selected_quota_removed), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index b2c673238e..712f24ef26 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -142,7 +142,7 @@ class _ClientsFilterRowState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.default_tier, - searchLabel: context.l10n.searchEntities(context.l10n.tiers), + searchLabel: context.l10n.search_tiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { filter = filter.copyWith( diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index 2ff5ba126f..b9a658eee5 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingEntities(context.l10n.clients))), + appBar: AppBar(title: Text(context.l10n.list_of_all_clients)), body: Card( child: Padding( padding: const EdgeInsets.all(8), @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State { Expanded( child: DataTable2( isVerticalScrollBarVisible: true, - empty: Text(context.l10n.noEntitiesFound(context.l10n.clients_lc)), + empty: Text(context.l10n.no_clients_found), onSelectAll: (selected) { if (selected == null) return; @@ -164,7 +164,7 @@ class _ClientsOverviewState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text('${context.l10n.errorOccurredWhileDeletingEntities(context.l10n.client_lc)}(s)'), + content: Text(context.l10n.error_deleting_client), showCloseIcon: true, ), ); @@ -179,7 +179,7 @@ class _ClientsOverviewState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selectedEntityWasRemoved(context.l10n.clients_lc)), + content: Text(context.l10n.selected_client_removed), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index 06930ed755..7d05053643 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -69,7 +69,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.client_secret, - helperText: context.l10n.clientDataMessage(context.l10n.client_secret), + helperText: context.l10n.client_secret_generated_message, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index 56fda15456..b9c7f58ae4 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -75,7 +75,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.client_ID, - helperText: context.l10n.clientDataMessage(context.l10n.client_ID), + helperText: context.l10n.client_id_generated_message, ), ), Gaps.h24, @@ -96,7 +96,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: context.l10n.client_secret, - helperText: context.l10n.clientDataMessage(context.l10n.client_secret), + helperText: context.l10n.client_secret_generated_message, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( diff --git a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart index 66811fd592..01e123c797 100644 --- a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.listOfExistingEntities(context.l10n.identities))), + appBar: AppBar(title: Text(context.l10n.list_of_all_identities)), body: Card( child: Padding( padding: const EdgeInsets.all(8), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index 8aae1a047c..6030e03882 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -27,7 +27,7 @@ class IdentityQuotaListState extends State { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: Text(context.l10n.viewAndAssignQuotasForEntity(context.l10n.identity)), + subtitle: Text(context.l10n.view_and_assign_quota_for_identity), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 6d82e495b1..35cfcefb48 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -126,9 +126,7 @@ class _QuotaListState extends State<_QuotaList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: isQueuedForDeletionTier - ? Text(context.l10n.view_quotas_for_the_tier) - : Text(context.l10n.viewAndAssignQuotasForEntity(context.l10n.tier_lc)), + subtitle: isQueuedForDeletionTier ? Text(context.l10n.view_quotas_for_the_tier) : Text(context.l10n.view_and_assign_quota_for_tier), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index cd9aa98bd6..0f7779fc21 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -55,7 +55,7 @@ class _TiersOverviewState extends State { style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 30), ), Text( - context.l10n.listOfExistingEntities(context.l10n.tiers), + context.l10n.list_of_all_tiers, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 13), ), ], @@ -88,7 +88,7 @@ class _TiersOverviewState extends State { child: DataTable2( isVerticalScrollBarVisible: true, showCheckboxColumn: false, - empty: Text(context.l10n.noEntitiesFound(context.l10n.tiers)), + empty: Text(context.l10n.no_tiers_found), columns: [ DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.number_of_identities), size: ColumnSize.L), diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 2eb608470c..51cf091bb6 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -11,8 +11,6 @@ "create_client": "Create Client", "create_tier": "Create Tier", "clients": "Clients", - "clients_lc": "clients", - "client_lc": "client", "close": "Close", "confirm": "Confirm", "copy_public_key": "Copy public key", @@ -29,7 +27,6 @@ "hour": "Hour", "id": "ID", "identities": "Identities", - "identity": "Identity", "identity_version": "Identity Version", "individual": "Individual", "last_login_at": "Last Login at", @@ -50,26 +47,30 @@ "remove_clients": "Remove Clients", "save": "Save", "settings": "Settings", + "search_clients": "Search Clients", + "search_tiers": "Search Tiers", "source": "Source", "system": "System", - "theIdentity": "the identity", + "the_identity": "the identity", "the_tier": "the tier", "theme": "Theme", "tier": "Tier", - "tier_lc": "tier", "tiers": "Tiers", - "tiers_lc": "tiers", "usage": "Usage", "used": "Used", "quotas": "Quotas", - "quota_lc": "quota", "week": "Week", "year": "Year", "yes": "Yes", "error_data_load_failed": "Failed to load data", "error_loading_data": "An error occurred loading the data.", + "error_deleting_quota": "An error occurred while deleting the quota(s). Please try again.", + "error_deleting_client": "An error occurred while deleting the client(s). Please try again.", "no_quotas_applied_for_identity": "No quotas applied for this identity.", "no_quotas_added_for_tier": "No quotas added to this tier.", + "no_identities_found": "No identities found.", + "no_clients_found": "No clients found.", + "no_tiers_found": "No tiers found.", "copy_to_clipboard_message": "Client Secret copied to clipboard.", "deletion_of_quota_message": "Are you sure you want to remove the selected quotas from", "display_name_message": "Client ID will be used as a Display Name if no value is provided.", @@ -83,65 +84,18 @@ "no_identity_limit_message": "No Identity limit will be assigned if this field is left blank.", "public_key_copied_to_clipboard_message": "Public key copied to clipboard.", "remove_clients_message": "Are you sure you want to remove the selected clients?", + "list_of_all_clients": "A list of existing clients", + "list_of_all_identities": "A list of existing identities", + "list_of_all_tiers": "A list of existing tiers", "save_the_client_secret_message": "Please save the Client Secret since it will be inaccessible after exiting.", + "selected_quota_removed": "Selected quota(s) have been removed.", + "selected_client_removed": "Selected client(s) have been removed.", "tier_created_successfully_message": "Tier was created successfully.", "tier_quota_effect_message": "Tier quotas do not take effect if there is an individual quota.", "view_quotas_for_the_tier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", + "view_and_assign_quota_for_identity": "View and assign quotas for this identity.", + "view_and_assign_quota_for_tier": "View and assign quotas for this tier.", "view_identities_associated_with_tier": "View Identities associated with this Tier.", - "clientDataMessage": "A {entityName} will be generated if this field is left blank.", - "@clientDataMessage": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "searchEntities": "Search {entityName}", - "@searchEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "errorOccurredWhileDeletingEntities": "An error occurred while deleting the {entityName}. Please try again.", - "@errorOccurredWhileDeletingEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "viewAndAssignQuotasForEntity": "View and assign quotas for this {entityName}.", - "@viewAndAssignQuotasForEntity": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "noEntitiesFound": "No {entityName} found.", - "@noEntitiesFound": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "listOfExistingEntities": "A list of existing {entityName}", - "@listOfExistingEntities": { - "placeholders": { - "entityName": { - "type": "String" - } - } - }, - "selectedEntityWasRemoved": "Selected {entityName} have been removed.", - "@selectedEntityWasRemoved": { - "placeholders": { - "entityName": { - "type": "String" - } - } - } + "client_secret_generated_message": "A client secret will be generated if this field is left blank.", + "client_id_generated_message": "A client ID will be generated if this field is left blank." } From d3aec1967e679c8ef5bb7ff3789d79fa071faf13 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Mon, 1 Jul 2024 10:55:15 +0200 Subject: [PATCH 18/19] refactor: translation names --- .../lib/core/modals/add_quota_dialog.dart | 4 +- .../identities_data_table.dart | 14 +- .../identities_filter.dart | 12 +- .../lib/core/widgets/quotas_button_group.dart | 8 +- .../home/clients_overview/clients_filter.dart | 10 +- .../clients_overview/clients_overview.dart | 22 +-- .../modals/change_client_secret_dialog.dart | 12 +- .../modals/create_client_dialog.dart | 28 ++-- .../identities_overview.dart | 2 +- .../identity_details/identity_details.dart | 12 +- .../identity_quotas_table.dart | 16 ++- .../identity_details/modals/change_tier.dart | 6 +- .../lib/home/tier_detail/tier_detail.dart | 12 +- .../modals/show_create_tier_dialog.dart | 8 +- .../home/tiers_overview/tiers_overview.dart | 6 +- AdminUi/apps/admin_ui/lib/l10n/app_en.arb | 134 +++++++++--------- 16 files changed, 156 insertions(+), 150 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart index 265c152f12..e41b092e8a 100644 --- a/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/core/modals/add_quota_dialog.dart @@ -103,8 +103,8 @@ class _AddQuotaDialogState extends State<_AddQuotaDialog> { enabled: !_saving, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: '${context.l10n.max_amount}*', - helperText: context.l10n.max_amount_message, + labelText: '${context.l10n.maxAmount}*', + helperText: context.l10n.addQuotaDialog_maxAmount_message, ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart index 25f9f3367c..c5fe40b851 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_data_table.dart @@ -37,12 +37,12 @@ class _IdentitiesDataTableState extends State { isVerticalScrollBarVisible: true, renderEmptyRowsInTheEnd: false, availableRowsPerPage: const [5, 10, 25, 50, 100], - empty: Text(context.l10n.no_identities_found), + empty: Text(context.l10n.identitiesDataTable_noIdentitiesFound), errorBuilder: (error) => Center( child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text(context.l10n.error_data_load_failed), + Text(context.l10n.identitiesDataTable_failedToLoadData), Gaps.h16, FilledButton(onPressed: widget.dataSource.refreshDatasource, child: Text(context.l10n.retry)), ], @@ -51,12 +51,12 @@ class _IdentitiesDataTableState extends State { columns: [ DataColumn2(label: Text(context.l10n.address), size: ColumnSize.L, onSort: _sort), if (!widget.hideTierColumn) DataColumn2(label: Text(context.l10n.tier), size: ColumnSize.S), - DataColumn2(label: Text(context.l10n.created_with_client), onSort: _sort), - DataColumn2(label: Text(context.l10n.number_of_devices), onSort: _sort), + DataColumn2(label: Text(context.l10n.identitiesDataTable_createdWithClient), onSort: _sort), + DataColumn2(label: Text(context.l10n.numberOfDevices), onSort: _sort), DataColumn2(label: Text(context.l10n.createdAt), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.last_login_at), size: ColumnSize.S, onSort: _sort), - DataColumn2(label: Text(context.l10n.datawallet_version), onSort: _sort), - DataColumn2(label: Text(context.l10n.identity_version), onSort: _sort), + DataColumn2(label: Text(context.l10n.lastLoginAt), size: ColumnSize.S, onSort: _sort), + DataColumn2(label: Text(context.l10n.datawalletVersion), onSort: _sort), + DataColumn2(label: Text(context.l10n.identityVersion), onSort: _sort), ], ); } diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart index bb17237b18..30e6c0dd94 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/identities_data_table/identities_filter.dart @@ -71,7 +71,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.tiers, - searchLabel: context.l10n.search_tiers, + searchLabel: context.l10n.searchTiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { final selectedTiers = selectedOptions.map((item) => item.value!).toList(); @@ -83,7 +83,7 @@ class _IdentitiesFilterState extends State { Gaps.w16, MultiSelectFilter( label: context.l10n.clients, - searchLabel: context.l10n.search_clients, + searchLabel: context.l10n.identitiesFilter_searchClients, controller: _clientController, onOptionSelected: (List> selectedOptions) { final selectedClients = selectedOptions.map((item) => item.value!).toList(); @@ -93,7 +93,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.number_of_devices, + label: context.l10n.numberOfDevices, onNumberSelected: (FilterOperator operator, String enteredValue) { final numberOfDevices = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(numberOfDevices: numberOfDevices.value.isEmpty ? const Optional.absent() : Optional(numberOfDevices)); @@ -111,7 +111,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, DateFilter( - label: context.l10n.last_login_at, + label: context.l10n.lastLoginAt, onFilterSelected: (FilterOperator operator, DateTime? selectedDate) { final lastLoginAt = FilterOperatorValue(operator, selectedDate != null ? DateFormat('yyyy-MM-dd').format(selectedDate) : ''); _filter = _filter.copyWith(lastLoginAt: lastLoginAt.value.isEmpty ? const Optional.absent() : Optional(lastLoginAt)); @@ -120,7 +120,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.datawallet_version, + label: context.l10n.datawalletVersion, onNumberSelected: (FilterOperator operator, String enteredValue) { final datawalletVersion = FilterOperatorValue(operator, enteredValue); _filter = @@ -130,7 +130,7 @@ class _IdentitiesFilterState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.identity_version, + label: context.l10n.identityVersion, onNumberSelected: (FilterOperator operator, String enteredValue) { final identityVersion = FilterOperatorValue(operator, enteredValue); _filter = _filter.copyWith(identityVersion: identityVersion.value.isEmpty ? const Optional.absent() : Optional(identityVersion)); diff --git a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart index 6957752260..0d35220db1 100644 --- a/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart +++ b/AdminUi/apps/admin_ui/lib/core/widgets/quotas_button_group.dart @@ -63,9 +63,9 @@ class _QuotasButtonGroupState extends State { Future _removeSelectedQuotas() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.remove_quotas, + title: context.l10n.quotaButtonGroup_removeQuotas_title, message: - '${context.l10n.deletion_of_quota_message} ${widget.identityAddress != null ? '${context.l10n.the_identity} "${widget.identityAddress}"' : '${context.l10n.the_tier} "${widget.tierId}"'}?', + '${context.l10n.quotaButtonGroup_deletionMessage} ${widget.identityAddress != null ? '${context.l10n.quotaButtonGroup_theIdentity} "${widget.identityAddress}"' : '${context.l10n.quotaButtonGroup_theTier} "${widget.tierId}"'}?', ); if (!confirmed) return; @@ -75,7 +75,7 @@ class _QuotasButtonGroupState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.error_deleting_quota), + content: Text(context.l10n.quotaButtonGroup_errorDeletingQuota), showCloseIcon: true, ), ); @@ -89,7 +89,7 @@ class _QuotasButtonGroupState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selected_quota_removed), + content: Text(context.l10n.quotaButtonGroup_selectedQuotaRemoved), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart index 712f24ef26..af19ed8874 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_filter.dart @@ -123,7 +123,7 @@ class _ClientsFilterRowState extends State { mainAxisSize: MainAxisSize.min, children: [ InputField( - label: context.l10n.client_ID, + label: context.l10n.clientID, onEnteredText: (String enteredText) { filter = filter.copyWith(clientId: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -132,7 +132,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, InputField( - label: context.l10n.display_name, + label: context.l10n.displayName, onEnteredText: (String enteredText) { filter = filter.copyWith(displayName: enteredText.isEmpty ? const Optional.absent() : Optional(enteredText)); @@ -141,8 +141,8 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, MultiSelectFilter( - label: context.l10n.default_tier, - searchLabel: context.l10n.search_tiers, + label: context.l10n.defaultTier, + searchLabel: context.l10n.searchTiers, controller: _tierController, onOptionSelected: (List> selectedOptions) { filter = filter.copyWith( @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State { ), Gaps.w16, NumberFilter( - label: context.l10n.number_of_identities, + label: context.l10n.numberOfIdentities, onNumberSelected: (FilterOperator operator, String enteredValue) { filter = filter.copyWith( numberOfIdentities: enteredValue.isEmpty ? const Optional.absent() : Optional((operator, int.parse(enteredValue))), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart index b9a658eee5..b345ddcd52 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/clients_overview.dart @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.list_of_all_clients)), + appBar: AppBar(title: Text(context.l10n.clientsOverview_title)), body: Card( child: Padding( padding: const EdgeInsets.all(8), @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State { Expanded( child: DataTable2( isVerticalScrollBarVisible: true, - empty: Text(context.l10n.no_clients_found), + empty: Text(context.l10n.clientsOverview_noClientsFound), onSelectAll: (selected) { if (selected == null) return; @@ -81,10 +81,10 @@ class _ClientsOverviewState extends State { }); }, columns: [ - DataColumn2(label: Text(context.l10n.client_ID), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.display_name), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.default_tier)), - DataColumn2(label: Text(context.l10n.number_of_identities), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.clientID), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.displayName), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.defaultTier)), + DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), DataColumn2(label: Text(context.l10n.createdAt)), const DataColumn2(label: Text(''), size: ColumnSize.L), ], @@ -121,7 +121,7 @@ class _ClientsOverviewState extends State { style: ButtonStyle(backgroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.primary)), onPressed: () => showChangeClientSecretDialog(context: context, clientId: client.clientId), child: Text( - context.l10n.change_client_secret, + context.l10n.changeClientSecret, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary), textAlign: TextAlign.center, ), @@ -153,8 +153,8 @@ class _ClientsOverviewState extends State { Future _removeSelectedClients() async { final confirmed = await showConfirmationDialog( context: context, - title: context.l10n.remove_clients, - message: context.l10n.remove_clients_message, + title: context.l10n.clientsOverview_removeSelectedClients_title, + message: context.l10n.clientsOverview_removeSelectedClients_message, ); if (!confirmed) return; @@ -164,7 +164,7 @@ class _ClientsOverviewState extends State { if (result.hasError && mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.error_deleting_client), + content: Text(context.l10n.clientsOverview_removeSelectedClients_error), showCloseIcon: true, ), ); @@ -179,7 +179,7 @@ class _ClientsOverviewState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.selected_client_removed), + content: Text(context.l10n.clientsOverview_removeSelectedClients_success), showCloseIcon: true, ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart index 7d05053643..989953f549 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/change_client_secret_dialog.dart @@ -55,7 +55,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.change_client_secret, textAlign: TextAlign.center), + title: Text(context.l10n.changeClientSecret, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -68,8 +68,8 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.client_secret, - helperText: context.l10n.client_secret_generated_message, + labelText: context.l10n.clientSecret, + helperText: context.l10n.clientSecret_message, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -81,9 +81,9 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: context.l10n.copy_to_clipboard, + tooltip: context.l10n.changeClientSecretDialog_copyToClipboard, clipboardText: _newClientSecretController.text, - successMessage: context.l10n.copy_to_clipboard_message, + successMessage: context.l10n.clientSecret_copiedToClipboard, ), ], ), @@ -94,7 +94,7 @@ class _ChangeClientSecretDialogState extends State<_ChangeClientSecretDialog> { Padding( padding: const EdgeInsets.symmetric(vertical: 8), child: Text( - context.l10n.save_the_client_secret_message, + context.l10n.clientSecret_save_message, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ), diff --git a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart index b9c7f58ae4..956b16a3ca 100644 --- a/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/clients_overview/modals/create_client_dialog.dart @@ -63,7 +63,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.create_client, textAlign: TextAlign.center), + title: Text(context.l10n.createClientDialog_title, textAlign: TextAlign.center), content: SizedBox( width: 500, child: Column( @@ -74,8 +74,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.client_ID, - helperText: context.l10n.client_id_generated_message, + labelText: context.l10n.clientID, + helperText: context.l10n.createClientDialog_clientID_message, ), ), Gaps.h24, @@ -84,8 +84,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.display_name, - helperText: context.l10n.display_name_message, + labelText: context.l10n.displayName, + helperText: context.l10n.createClientDialog_displayName_message, ), ), Gaps.h24, @@ -95,8 +95,8 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { obscureText: _isClientSecretVisible, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.client_secret, - helperText: context.l10n.client_secret_generated_message, + labelText: context.l10n.clientSecret, + helperText: context.l10n.clientSecret_message, suffixIcon: Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( @@ -108,9 +108,9 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { ), Gaps.w4, CopyToClipboardButton( - tooltip: context.l10n.copy_to_clipboard, + tooltip: context.l10n.createClientDialog_clientSecret_copyToClipboard, clipboardText: _clientSecretController.text, - successMessage: context.l10n.copy_to_clipboard_message, + successMessage: context.l10n.clientSecret_copiedToClipboard, ), ], ), @@ -120,7 +120,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { if (_saveSucceeded) ...[ Gaps.h16, Text( - context.l10n.save_the_client_secret_message, + context.l10n.clientSecret_save_message, style: TextStyle(color: Theme.of(context).colorScheme.primary), ), ], @@ -130,9 +130,9 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { readOnly: _saveSucceeded, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: context.l10n.max_identities, - helperText: '${context.l10n.max_identities_message}' - '\n${context.l10n.no_identity_limit_message}', + labelText: context.l10n.maxIdentities, + helperText: '${context.l10n.createClientDialog_maxIdentities_message}' + '\n${context.l10n.createClientDialog_maxIdentities_noLimit_message}', ), inputFormatters: [FilteringTextInputFormatter.digitsOnly], keyboardType: TextInputType.number, @@ -142,7 +142,7 @@ class _CreateClientDialogState extends State<_CreateClientDialog> { isExpanded: true, decoration: InputDecoration( border: const OutlineInputBorder(), - labelText: '${context.l10n.default_tier}*', + labelText: '${context.l10n.defaultTier}*', ), value: _chosenDefaultTier, onChanged: _saveSucceeded ? null : (tier) => setState(() => _chosenDefaultTier = tier), diff --git a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart index 01e123c797..573ba07431 100644 --- a/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/identities_overview/identities_overview.dart @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(context.l10n.list_of_all_identities)), + appBar: AppBar(title: Text(context.l10n.identityOverview_title)), body: Card( child: Padding( padding: const EdgeInsets.all(8), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart index f55e9a5d2a..2c98a7a631 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_details.dart @@ -127,7 +127,7 @@ class _IdentityDetailsCard extends StatelessWidget { Gaps.w16, CopyToClipboardButton( clipboardText: identityDetails.address, - successMessage: context.l10n.identity_copied_to_clipboard_message, + successMessage: context.l10n.identityDetails_card_identityClipboardMessage, ), ], ), @@ -138,18 +138,18 @@ class _IdentityDetailsCard extends StatelessWidget { runSpacing: 8, children: [ _IdentityDetails( - title: context.l10n.client_ID, + title: context.l10n.clientID, value: identityDetails.clientId, ), _IdentityDetails( - title: context.l10n.public_key, + title: context.l10n.identityDetails_card_publicKey, value: identityDetails.publicKey.ellipsize(20), onIconPressed: () => context.setClipboardDataWithSuccessNotification( clipboardText: identityDetails.publicKey, - successMessage: context.l10n.public_key_copied_to_clipboard_message, + successMessage: context.l10n.identityDetails_card_publicKey_copyToClipboardMessage, ), icon: Icons.copy, - tooltipMessage: context.l10n.copy_public_key, + tooltipMessage: context.l10n.identityDetails_card_publicKey_tooltipMessage, ), _IdentityDetails( title: context.l10n.createdAt, @@ -168,7 +168,7 @@ class _IdentityDetailsCard extends StatelessWidget { ) : null, icon: Icons.edit, - tooltipMessage: context.l10n.change_tier, + tooltipMessage: context.l10n.changeTier, ), ], ), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index 6030e03882..ba1e1add3d 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -27,7 +27,7 @@ class IdentityQuotaListState extends State { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: Text(context.l10n.view_and_assign_quota_for_identity), + subtitle: Text(context.l10n.identityQuotaTable_title_description), children: [ Card( child: Column( @@ -45,16 +45,20 @@ class IdentityQuotaListState extends State { columns: [ DataColumn2(label: Text(context.l10n.metric)), DataColumn2(label: Text(context.l10n.source), size: ColumnSize.S), - DataColumn2(label: Text('${context.l10n.usage} (${context.l10n.used}/${context.l10n.max})'), size: ColumnSize.L), + DataColumn2( + label: Text( + '${context.l10n.usage} (${context.l10n.used}/${context.l10n.max})', + ), + size: ColumnSize.L), DataColumn2(label: Text(context.l10n.period), size: ColumnSize.S), const DataColumn2(label: Text(''), size: ColumnSize.S), ], - empty: Text(context.l10n.no_quotas_applied_for_identity), + empty: Text(context.l10n.identityQuotaTable_noQuotaApplied), rows: groupedQuotas.entries.expand((entry) { final metricName = entry.key; final quotas = entry.value; - final hasIndividualQuota = quotas.any((quota) => quota.source == context.l10n.individual); + final hasIndividualQuota = quotas.any((quota) => quota.source == context.l10n.identityQuotaTable_individual); return [ DataRow2( @@ -69,9 +73,9 @@ class IdentityQuotaListState extends State { ), ...quotas.map( (quota) { - final isTierQuota = quota.source == context.l10n.tier; + final isTierQuota = quota.source == 'Tier'; final shouldDisable = isTierQuota && hasIndividualQuota; - final tooltipMessage = shouldDisable ? context.l10n.tier_quota_effect_message : null; + final tooltipMessage = shouldDisable ? context.l10n.identityQuotaTable_tierQuotaEffectMessage : null; return DataRow2( selected: _selectedQuotas.contains(quota.id), diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart index 0016352318..35a4afdfec 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/modals/change_tier.dart @@ -52,7 +52,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { return PopScope( canPop: !_saving, child: AlertDialog( - title: Text(context.l10n.change_tier, textAlign: TextAlign.center), + title: Text(context.l10n.changeTier, textAlign: TextAlign.center), content: DropdownButtonFormField( value: selectedTier, decoration: const InputDecoration(border: OutlineInputBorder()), @@ -88,7 +88,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { if (response.hasError) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.failed_to_update_identity_message), + content: Text(context.l10n.changeTierDialog_error), duration: const Duration(seconds: 3), ), ); @@ -100,7 +100,7 @@ class _ShowChangeTierDialogState extends State<_ShowChangeTierDialog> { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(context.l10n.identity_updated_message), + content: Text(context.l10n.changeTierDialog_success), duration: const Duration(seconds: 3), ), ); diff --git a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart index 35cfcefb48..5a4a838b95 100644 --- a/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart +++ b/AdminUi/apps/admin_ui/lib/home/tier_detail/tier_detail.dart @@ -64,7 +64,7 @@ class _TierDetailState extends State { TextSpan( children: [ TextSpan( - text: '${context.l10n.id}: ', + text: '${context.l10n.tierDetails_tierID}: ', style: Theme.of(context).textTheme.bodyLarge!.copyWith(fontWeight: FontWeight.bold), ), TextSpan(text: tierDetails.id, style: Theme.of(context).textTheme.bodyLarge), @@ -126,7 +126,9 @@ class _QuotaListState extends State<_QuotaList> { data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( title: Text(context.l10n.quotas), - subtitle: isQueuedForDeletionTier ? Text(context.l10n.view_quotas_for_the_tier) : Text(context.l10n.view_and_assign_quota_for_tier), + subtitle: isQueuedForDeletionTier + ? Text(context.l10n.tierDetails_quotaList_titleDescription_readOnly) + : Text(context.l10n.tierDetails_quotaList_titleDescription), children: [ Card( child: Column( @@ -146,7 +148,7 @@ class _QuotaListState extends State<_QuotaList> { DataColumn(label: Text(context.l10n.max)), DataColumn(label: Text(context.l10n.period)), ], - empty: Text(context.l10n.no_quotas_added_for_tier), + empty: Text(context.l10n.tierDetails_quotaList_noQuotaForTier), rows: widget.tierDetails.quotas .map( (quota) => DataRow2( @@ -219,8 +221,8 @@ class _IdentitiesListState extends State<_IdentitiesList> { return Theme( data: Theme.of(context).copyWith(dividerColor: Colors.transparent), child: ExpansionTile( - title: Text(context.l10n.identities), - subtitle: Text(context.l10n.view_identities_associated_with_tier), + title: Text(context.l10n.tierDetails_identityList_title), + subtitle: Text(context.l10n.tierDetails_identityList_titleDescription), children: [ Card( child: Column( diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart index 676ceffa2b..c4faed35b2 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/modals/show_create_tier_dialog.dart @@ -44,7 +44,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { return PopScope( canPop: !_isLoading, child: AlertDialog( - title: Text(context.l10n.create_tier), + title: Text(context.l10n.createTierDialog_title), content: _isLoading ? const Padding( padding: EdgeInsets.all(16), @@ -53,7 +53,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { : Column( mainAxisSize: MainAxisSize.min, children: [ - Text(context.l10n.form_message_for_tier), + Text(context.l10n.createTierDialog_formMessage), Gaps.h16, TextField( controller: _tierNameController, @@ -93,7 +93,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { Future _onSubmitted(String name) async { if (name.isEmpty) { - _setErrorMessage(context.l10n.name_cannot_be_empty_message); + _setErrorMessage(context.l10n.createTierDialog_nameCannotBeEmpty); _focusNode.requestFocus(); return; } @@ -120,7 +120,7 @@ class _CreateTierDialogState extends State<_CreateTierDialog> { void _showSuccessSnackbar() { final snackBar = SnackBar( content: Text( - context.l10n.tier_created_successfully_message, + context.l10n.createTierDialog_tierCreatedSuccess, style: const TextStyle(color: Colors.white), ), backgroundColor: Colors.green, diff --git a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart index 0f7779fc21..b320510846 100644 --- a/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart +++ b/AdminUi/apps/admin_ui/lib/home/tiers_overview/tiers_overview.dart @@ -55,7 +55,7 @@ class _TiersOverviewState extends State { style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 30), ), Text( - context.l10n.list_of_all_tiers, + context.l10n.tiersOverview_title_description, style: TextStyle(color: Theme.of(context).colorScheme.onPrimary, fontSize: 13), ), ], @@ -88,10 +88,10 @@ class _TiersOverviewState extends State { child: DataTable2( isVerticalScrollBarVisible: true, showCheckboxColumn: false, - empty: Text(context.l10n.no_tiers_found), + empty: Text(context.l10n.tiersOverview_noTiersFound), columns: [ DataColumn2(label: Text(context.l10n.name), size: ColumnSize.L), - DataColumn2(label: Text(context.l10n.number_of_identities), size: ColumnSize.L), + DataColumn2(label: Text(context.l10n.numberOfIdentities), size: ColumnSize.L), ], rows: _tiers! .map( diff --git a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb index 51cf091bb6..6965ffa8a5 100644 --- a/AdminUi/apps/admin_ui/lib/l10n/app_en.arb +++ b/AdminUi/apps/admin_ui/lib/l10n/app_en.arb @@ -1,101 +1,101 @@ { "@@locale": "en", - "add": "Add", + "add": "Add", "addQuota": "Add Quota", "address": "Address", "cancel": "Cancel", - "change_client_secret": "Change Client Secret", - "change_tier": "Change Tier", - "client_ID": "Client ID", - "client_secret": "Client Secret", - "create_client": "Create Client", - "create_tier": "Create Tier", + "create": "Create", + "changeClientSecret": "Change Client Secret", + "changeTier": "Change Tier", + "clientID": "Client ID", + "clientSecret": "Client Secret", + "clientSecret_copiedToClipboard": "Client secret copied to clipboard.", + "clientSecret_message": "A client secret will be generated if this field is left blank.", + "clientSecret_save_message": "Please save the Client Secret since it will be inaccessible after exiting.", "clients": "Clients", "close": "Close", "confirm": "Confirm", - "copy_public_key": "Copy public key", - "copy_to_clipboard": "Copy to clipboard", - "create": "Create", "createdAt": "Created At", - "created_with_client": "Created with Client", "dark": "Dark", "day": "Day", - "datawallet_version": "Datawallet Version", - "default_tier": "Default Tier", + "datawalletVersion": "Datawallet Version", + "defaultTier": "Default Tier", "devices": "Devices", - "display_name": "Display Name", + "displayName": "Display Name", "hour": "Hour", - "id": "ID", - "identities": "Identities", - "identity_version": "Identity Version", - "individual": "Individual", - "last_login_at": "Last Login at", + "identityVersion": "Identity Version", + "lastLoginAt": "Last Login at", "light": "Light", "max": "Max", - "max_amount": "Max Amount", - "max_identities": "Max Identities", + "maxAmount": "Max Amount", + "maxIdentities": "Max Identities", "metric": "Metric", "month": "Month", "name": "Name", - "number_of_devices": "Number of Devices", - "number_of_identities": "Number of Identities", + "numberOfDevices": "Number of Devices", + "numberOfIdentities": "Number of Identities", "period": "Period", - "public_key": "Public Key", "quotas": "Quotas", "retry": "Retry", - "remove_quotas": "Remove Quotas", - "remove_clients": "Remove Clients", "save": "Save", + "searchTiers": "Search Tiers", "settings": "Settings", - "search_clients": "Search Clients", - "search_tiers": "Search Tiers", "source": "Source", "system": "System", - "the_identity": "the identity", - "the_tier": "the tier", "theme": "Theme", "tier": "Tier", "tiers": "Tiers", "usage": "Usage", "used": "Used", - "quotas": "Quotas", "week": "Week", "year": "Year", "yes": "Yes", - "error_data_load_failed": "Failed to load data", - "error_loading_data": "An error occurred loading the data.", - "error_deleting_quota": "An error occurred while deleting the quota(s). Please try again.", - "error_deleting_client": "An error occurred while deleting the client(s). Please try again.", - "no_quotas_applied_for_identity": "No quotas applied for this identity.", - "no_quotas_added_for_tier": "No quotas added to this tier.", - "no_identities_found": "No identities found.", - "no_clients_found": "No clients found.", - "no_tiers_found": "No tiers found.", - "copy_to_clipboard_message": "Client Secret copied to clipboard.", - "deletion_of_quota_message": "Are you sure you want to remove the selected quotas from", - "display_name_message": "Client ID will be used as a Display Name if no value is provided.", - "failed_to_update_identity_message": "Failed to update identity. Please try again.", - "form_message_for_tier": "Please fill the form below to create your Tier", - "identity_copied_to_clipboard_message": "Identity address copied to clipboard.", - "identity_updated_message": "Identity updated successfully.", - "max_identities_message": "The maximum number of Identities that can be created with this Client.", - "max_amount_message": "Only numbers greater or equal to 0 are valid.", - "name_cannot_be_empty_message": "Name cannot be empty.", - "no_identity_limit_message": "No Identity limit will be assigned if this field is left blank.", - "public_key_copied_to_clipboard_message": "Public key copied to clipboard.", - "remove_clients_message": "Are you sure you want to remove the selected clients?", - "list_of_all_clients": "A list of existing clients", - "list_of_all_identities": "A list of existing identities", - "list_of_all_tiers": "A list of existing tiers", - "save_the_client_secret_message": "Please save the Client Secret since it will be inaccessible after exiting.", - "selected_quota_removed": "Selected quota(s) have been removed.", - "selected_client_removed": "Selected client(s) have been removed.", - "tier_created_successfully_message": "Tier was created successfully.", - "tier_quota_effect_message": "Tier quotas do not take effect if there is an individual quota.", - "view_quotas_for_the_tier": "View quotas for this tier. This tier is managed by the system and therefore read-only.", - "view_and_assign_quota_for_identity": "View and assign quotas for this identity.", - "view_and_assign_quota_for_tier": "View and assign quotas for this tier.", - "view_identities_associated_with_tier": "View Identities associated with this Tier.", - "client_secret_generated_message": "A client secret will be generated if this field is left blank.", - "client_id_generated_message": "A client ID will be generated if this field is left blank." + "addQuotaDialog_maxAmount_message": "Only numbers greater or equal to 0 are valid.", + "changeClientSecretDialog_copyToClipboard": "Copy to Clipboard", + "changeTierDialog_error": "Failed to update identity. Please try again.", + "changeTierDialog_success": "Identity updated successfully.", + "clientsOverview_title": "A list of existing clients", + "clientsOverview_noClientsFound": "No clients found.", + "clientsOverview_removeSelectedClients_title": "Remove Clients", + "clientsOverview_removeSelectedClients_message": "Are you sure you want to remove the selected clients?", + "clientsOverview_removeSelectedClients_error": "An error occurred while deleting the client(s). Please try again.", + "clientsOverview_removeSelectedClients_success": "Selected client(s) have been removed.", + "createClientDialog_title": "Create Client", + "createClientDialog_clientID_message": "A client ID will be generated if this field is left blank.", + "createClientDialog_displayName_message": "Client ID will be used as a Display Name if no value is provided.", + "createClientDialog_clientSecret_copyToClipboard": "Client Secret copied to clipboard.", + "createClientDialog_maxIdentities_message": "The maximum number of Identities that can be created with this Client.", + "createClientDialog_maxIdentities_noLimit_message": "No Identity limit will be assigned if this field is left blank.", + "createTierDialog_title": "Create Tier", + "createTierDialog_formMessage": "Please fill the form below to create your Tier", + "createTierDialog_nameCannotBeEmpty": "Name cannot be empty.", + "createTierDialog_tierCreatedSuccess": "Tier was created successfully.", + "identityDetails_card_identityClipboardMessage": "Identity address copied to clipboard.", + "identityDetails_card_publicKey": "Public Key", + "identityDetails_card_publicKey_copyToClipboardMessage": "Public key copied to clipboard.", + "identityDetails_card_publicKey_tooltipMessage": "Copy public key", + "identityOverview_title": "A list of existing identities", + "identityQuotaTable_title_description": "View and assign quotas for this identity.", + "identityQuotaTable_noQuotaApplied": "No quotas applied for this identity.", + "identityQuotaTable_individual": "Individual", + "identityQuotaTable_tierQuotaEffectMessage": "Tier quotas do not take effect if there is an individual quota.", + "identitiesDataTable_noIdentitiesFound": "No identities found.", + "identitiesDataTable_failedToLoadData": "Failed to load data.", + "identitiesDataTable_createdWithClient": "Created with Client", + "identitiesFilter_searchClients": "Search Clients", + "quotaButtonGroup_removeQuotas_title": "Remove Quotas", + "quotaButtonGroup_deletionMessage": "Are you sure you want to remove the selected quotas from?", + "quotaButtonGroup_theIdentity": "The Identity", + "quotaButtonGroup_theTier": "The Tier", + "quotaButtonGroup_errorDeletingQuota": "An error occurred while deleting the quota(s). Please try again.", + "quotaButtonGroup_selectedQuotaRemoved": "Selected quota(s) have been removed.", + "tierDetails_tierID": "ID", + "tierDetails_quotaList_titleDescription": "View and assign quotas for this tier.", + "tierDetails_quotaList_titleDescription_readOnly": "View quotas for this tier. This tier is managed by the system and therefore read-only.", + "tierDetails_quotaList_noQuotaForTier": "No quotas added to this tier.", + "tierDetails_identityList_title": "Identities", + "tierDetails_identityList_titleDescription": "View Identities associated with this Tier.", + "tierDetails_quotaList_titleDescription": "View and assign quotas for this tier.", + "tiersOverview_title_description": "A list of existing tiers", + "tiersOverview_noTiersFound": "No tiers found." } From 6f224e6bc4c1e1c98c0c1153ccc4e24258f6fdf8 Mon Sep 17 00:00:00 2001 From: Vladimir Vuckovic Date: Mon, 1 Jul 2024 10:58:19 +0200 Subject: [PATCH 19/19] fix: add trailing comma --- .../identity_quotas_table/identity_quotas_table.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart index ba1e1add3d..5afdc2b64e 100644 --- a/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart +++ b/AdminUi/apps/admin_ui/lib/home/identity_details/identity_quotas_table/identity_quotas_table.dart @@ -46,10 +46,11 @@ class IdentityQuotaListState extends State { DataColumn2(label: Text(context.l10n.metric)), DataColumn2(label: Text(context.l10n.source), size: ColumnSize.S), DataColumn2( - label: Text( - '${context.l10n.usage} (${context.l10n.used}/${context.l10n.max})', - ), - size: ColumnSize.L), + label: Text( + '${context.l10n.usage} (${context.l10n.used}/${context.l10n.max})', + ), + size: ColumnSize.L, + ), DataColumn2(label: Text(context.l10n.period), size: ColumnSize.S), const DataColumn2(label: Text(''), size: ColumnSize.S), ],