adding i18n to all other pages batch3

This commit is contained in:
Azmat-7860
2026-10-03 12:12:31 +05:30
parent 3fbeb606a8
commit cce6bb2ccb
16 changed files with 2037 additions and 201 deletions
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../l10n/app_localizations.dart';
import '../../providers/token_manager.dart';
import 'Bookmarks_api_service.dart';
@@ -24,7 +25,8 @@ class _CreateEntityScreenState extends State<CreateEntityScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Create Bookmarks')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.createBookmarks)),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
@@ -70,11 +72,14 @@ class _CreateEntityScreenState extends State<CreateEntityScreen> {
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Failed to create entity: $e'),
title: Text(AppLocalizations.of(context)!
.error),
content: Text(AppLocalizations.of(context)!
.failedCreateEntity(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(AppLocalizations.of(context)!
.ok),
onPressed: () {
Navigator.of(context).pop();
},
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import '../../Utils/image_constant.dart';
import '../../Utils/size_utils.dart';
import '../../l10n/app_localizations.dart';
import '../../providers/token_manager.dart';
import '../../theme/app_decoration.dart';
import '../../theme/app_style.dart';
@@ -46,11 +47,12 @@ class _bookmarks_entity_list_screenState
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Failed to fetch entities: $e'),
title: Text(AppLocalizations.of(context)!.error),
content: Text(AppLocalizations.of(context)!
.failedFetchEntities(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(AppLocalizations.of(context)!.ok),
onPressed: () {
Navigator.of(context).pop();
},
@@ -74,11 +76,12 @@ class _bookmarks_entity_list_screenState
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Failed to delete entity: $e'),
title: Text(AppLocalizations.of(context)!.error),
content: Text(AppLocalizations.of(context)!
.deleteEntityFailed(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(AppLocalizations.of(context)!.ok),
onPressed: () {
Navigator.of(context).pop();
},
@@ -105,10 +108,12 @@ class _bookmarks_entity_list_screenState
Navigator.pop(context);
}),
centerTitle: true,
title: AppbarTitle(text: "Bookmarks")),
title: AppbarTitle(
text: AppLocalizations.of(context)!.bookmarksTitle)),
body: entities.isEmpty
? const Center(
child: Text('No BookMarks found.'),
? Center(
child: Text(
AppLocalizations.of(context)!.noBookmarks),
)
: Container(
width: double.maxFinite,
@@ -315,8 +320,9 @@ class _bookmarks_entity_list_screenState
})
: Container(
height: MediaQuery.of(context).size.height,
child: const Center(
child: Text("No Databases available"),
child: Center(
child: Text(AppLocalizations.of(context)!
.noDatabases),
)),
)
]))
@@ -422,11 +428,12 @@ class _bookmarks_entity_list_screenState
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Failed to launch URL: $e'),
title: Text(AppLocalizations.of(context)!.error),
content: Text(AppLocalizations.of(context)!
.failedLaunchUrl(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(AppLocalizations.of(context)!.ok),
onPressed: () {
Navigator.of(context).pop();
},
@@ -519,7 +526,8 @@ class _bookmarks_entity_list_screenState
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Additional Fields'),
title: Text(
AppLocalizations.of(context)!.additionalFields),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
@@ -535,7 +543,7 @@ class _bookmarks_entity_list_screenState
),
actions: [
TextButton(
child: const Text('Close'),
child: Text(AppLocalizations.of(context)!.close),
onPressed: () {
Navigator.of(context).pop();
},
@@ -3,6 +3,7 @@ import 'dart:math';
import 'package:flutter/services.dart';
import '../../l10n/app_localizations.dart';
import '../../providers/token_manager.dart';
import 'Bookmarks_api_service.dart';
@@ -27,7 +28,8 @@ class _UpdateEntityScreenState extends State<UpdateEntityScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Update Bookmarks')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.updateBookmarks)),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
@@ -41,7 +43,8 @@ class _UpdateEntityScreenState extends State<UpdateEntityScreen> {
const InputDecoration(labelText: 'bookmark_firstletter'),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter a bookmark_firstletter';
return AppLocalizations.of(context)!.pleaseEnterThis(
'bookmark_firstletter');
}
return null;
},
@@ -55,7 +58,8 @@ class _UpdateEntityScreenState extends State<UpdateEntityScreen> {
decoration: const InputDecoration(labelText: 'bookmark_link'),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter a bookmark_link';
return AppLocalizations.of(context)!.pleaseEnterThis(
'bookmark_link');
}
return null;
},
@@ -70,7 +74,8 @@ class _UpdateEntityScreenState extends State<UpdateEntityScreen> {
const InputDecoration(labelText: 'fileupload_field'),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter a fileupload_field';
return AppLocalizations.of(context)!.pleaseEnterThis(
'fileupload_field');
}
return null;
},
@@ -99,11 +104,14 @@ class _UpdateEntityScreenState extends State<UpdateEntityScreen> {
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Failed to update entity: $e'),
title: Text(AppLocalizations.of(context)!
.error),
content: Text(AppLocalizations.of(context)!
.failedUpdateEntity(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(AppLocalizations.of(context)!
.ok),
onPressed: () {
Navigator.of(context).pop();
},