Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Admin UI: Use l10n translations everywhere #692

Merged
merged 55 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a990a3c
feat: move all texts to l10n file
stamenione Jun 11, 2024
76fa310
fix: add trailing comma
stamenione Jun 11, 2024
a9a7c36
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
stamenione Jun 11, 2024
c1dc59e
fix: remove fixed names
stamenione Jun 11, 2024
4f3bddc
fix: localization structure and add context translation keys
stamenione Jun 11, 2024
45f0f4b
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 11, 2024
9b3ae28
chore: extract more context text
stamenione Jun 11, 2024
7545b72
Merge branch 'NMSHDB-143-Admin-UI-Preparation-for-translation' of htt…
stamenione Jun 11, 2024
45c083a
chore: add space
stamenione Jun 11, 2024
9ac6256
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 11, 2024
d37bfdf
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 12, 2024
e4ed469
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 13, 2024
aa3f1f6
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 17, 2024
f0a2da4
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 17, 2024
1cf85ee
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 17, 2024
24198fc
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 17, 2024
a3a648f
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 18, 2024
011a844
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 18, 2024
a6f2562
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 19, 2024
172cbe5
fix: change from camel case to underscore notation
stamenione Jun 20, 2024
cee6d77
chore: addition to camel case to underscore fix
stamenione Jun 20, 2024
5bf5497
fix: remove localization from assert
stamenione Jun 20, 2024
e3b3a6a
fix: remove invalid state
stamenione Jun 21, 2024
76495f0
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 24, 2024
ef87446
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 24, 2024
f1f1665
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 24, 2024
033fd5f
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 24, 2024
b60b489
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 24, 2024
5164ca1
fix: remove signs from translation
stamenione Jun 25, 2024
3c2ffaa
fix: add sign to translated text
stamenione Jun 25, 2024
34a9e28
revert: undo the space for the app title
stamenione Jun 25, 2024
2732e04
fix: add trailing comma
stamenione Jun 25, 2024
af67980
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 26, 2024
42e12d2
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 26, 2024
005acf0
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 27, 2024
015a801
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jun 27, 2024
90d629b
fix: make text translatable
stamenione Jun 27, 2024
2c94bda
Merge branch 'NMSHDB-143-Admin-UI-Preparation-for-translation' of htt…
stamenione Jun 27, 2024
1f62482
fix: remove translation within translation
stamenione Jun 27, 2024
5b2c887
fix: remove the rest of translation within translation
stamenione Jun 27, 2024
d3aec19
refactor: translation names
stamenione Jul 1, 2024
6f224e6
fix: add trailing comma
stamenione Jul 1, 2024
fbec8bc
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 1, 2024
437e8e4
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 1, 2024
6db9e77
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 1, 2024
50a6e47
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 1, 2024
11cc7dc
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 2, 2024
8e97b19
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 2, 2024
c379a63
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 2, 2024
ac8a26c
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
stamenione Jul 3, 2024
234bae8
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 3, 2024
b2afd25
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 5, 2024
b604f84
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 5, 2024
4f53715
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 5, 2024
1958f54
Merge branch 'main' into NMSHDB-143-Admin-UI-Preparation-for-translation
mergify[bot] Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)}*',
stamenione marked this conversation as resolved.
Show resolved Hide resolved
helperText: context.l10n.max_amount_message,
),
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _IdentitiesDataTableState extends State<IdentitiesDataTable> {
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,
Expand All @@ -52,11 +52,11 @@ class _IdentitiesDataTableState extends State<IdentitiesDataTable> {
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),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _IdentitiesFilterState extends State<IdentitiesFilter> {
Gaps.w16,
MultiSelectFilter(
label: context.l10n.tiers,
searchLabel: context.l10n.searchEntities('Tiers'),
searchLabel: context.l10n.searchEntities(context.l10n.tiers),
controller: _tierController,
onOptionSelected: (List<ValueItem<String>> selectedOptions) {
final selectedTiers = selectedOptions.map((item) => item.value!).toList();
Expand All @@ -83,7 +83,7 @@ class _IdentitiesFilterState extends State<IdentitiesFilter> {
Gaps.w16,
MultiSelectFilter(
label: context.l10n.clients,
searchLabel: context.l10n.searchEntities('Clients'),
searchLabel: context.l10n.searchEntities(context.l10n.clients),
controller: _clientController,
onOptionSelected: (List<ValueItem<String>> selectedOptions) {
final selectedClients = selectedOptions.map((item) => item.value!).toList();
Expand All @@ -93,7 +93,7 @@ class _IdentitiesFilterState extends State<IdentitiesFilter> {
),
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));
Expand All @@ -120,7 +120,7 @@ class _IdentitiesFilterState extends State<IdentitiesFilter> {
),
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 =
Expand All @@ -130,7 +130,7 @@ class _IdentitiesFilterState extends State<IdentitiesFilter> {
),
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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class _QuotasButtonGroupState extends State<QuotasButtonGroup> {
Future<void> _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}"'}?',
);
Expand All @@ -75,7 +75,7 @@ class _QuotasButtonGroupState extends State<QuotasButtonGroup> {
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,
),
);
Expand All @@ -89,7 +89,7 @@ class _QuotasButtonGroupState extends State<QuotasButtonGroup> {
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,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class _ClientsFilterRowState extends State<ClientsFilterRow> {
Gaps.w16,
MultiSelectFilter(
label: context.l10n.default_tier,
searchLabel: context.l10n.searchEntities('Tiers'),
searchLabel: context.l10n.searchEntities(context.l10n.tiers),
controller: _tierController,
onOptionSelected: (List<ValueItem<dynamic>> selectedOptions) {
filter = filter.copyWith(
Expand All @@ -154,7 +154,7 @@ class _ClientsFilterRowState extends State<ClientsFilterRow> {
),
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))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
@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),
Expand Down Expand Up @@ -68,7 +68,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
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;

Expand All @@ -84,7 +84,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
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),
],
Expand Down Expand Up @@ -153,7 +153,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
Future<void> _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,
);

Expand All @@ -164,7 +164,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
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,
),
);
Expand All @@ -179,7 +179,7 @@ class _ClientsOverviewState extends State<ClientsOverview> {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(context.l10n.selectedEntityWasRemoved('clients')),
content: Text(context.l10n.selectedEntityWasRemoved(context.l10n.clients_lc)),
showCloseIcon: true,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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}',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _IdentitiesOverviewState extends State<IdentitiesOverview> {
@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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class IdentityQuotaListState extends State<IdentityQuotaList> {
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(
Expand All @@ -45,7 +45,7 @@ class IdentityQuotaListState extends State<IdentityQuotaList> {
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),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _TiersOverviewState extends State<TiersOverview> {
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),
),
],
Expand Down Expand Up @@ -88,10 +88,10 @@ class _TiersOverviewState extends State<TiersOverview> {
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(
Expand Down
14 changes: 13 additions & 1 deletion AdminUi/apps/admin_ui/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down