added translations

This commit is contained in:
komekh 2024-08-19 16:31:03 +05:00
parent 3b12b68d0c
commit 6ed76123f7
14 changed files with 187 additions and 159 deletions

View File

@ -1,3 +1,47 @@
{
"profile_select_lang": "Выберите язык"
"profile_select_lang": "Dil saýlamak",
"my_orders": "Sargytlarym",
"follow_orders": "öz ýüküňizi yzarlaň",
"order_history": "Sargytlaryň taryhy",
"order_history_desc": "şu ýerde siziň sargytlaryňyz wagt tertipi boyunça görkezilen",
"order_not_available": "Sargyt yok",
"personal_cabinet": "Şahsy otagym",
"splash_text": "Довезём всё!",
"start_tracking": "Yzarlap başlaň",
"track_cargo": "Öz sargydyňyzy yzarlaň",
"cargo_app": "Cargo goşundy",
"exit_app": "Exit Application",
"are_you_sure": "Are You Sure?",
"yes": "Hawa",
"no": "Ýok",
"login_header": "Şahsy otaga giriş",
"login_desc": "özüňize berlen logini we açar sözi giriziň",
"login": "Giriş",
"login_hint": "Öz loginiňizi ýazyň",
"password": "Açar sözi",
"password_hint": "Öz açar sözüni ýazyň",
"credentials_validation_header": "'Invalid credentials",
"credentials_validation_body": "Username or Password Wrong!",
"required_validation": "This field can't be empty",
"order": "Sargyt",
"order_info": "Sargyt barada maglumat",
"route": "Gatnaw yoly",
"order_status": "Ýagdaýy",
"order_carrier": "Awtoulag №",
"order_shop": "Dükan №",
"order_from": "Nireden ugradyldy:",
"order_to": "Nirä barmaly:",
"order_placement_count": "'Ýer sany",
"order_volume": "Kuby",
"order_dimensions": "Göwrümi",
"order_dimensions_desc": "(ini, uzynlygy, beýikligi)",
"order_product_name": "Harydyň ady",
"contact_support": "Tehniki goldaw bilen habarlaşmak",
"privacy_policy": "Gizlinlik syýasaty",
"use_terms": "Ulanyş şertleri",
"logout": "Şahsy otagdan çykmak",
"order_details": "Giňişleýin",
"order_from_card": "Nireden",
"order_to_card": "Nirä",
"order_sent": "Ugradylan senesi"
}

View File

@ -1,3 +1,47 @@
{
"profile_select_lang": "Dil saýlamak"
"profile_select_lang": "Dil saýlamak",
"my_orders": "Sargytlarym",
"follow_orders": "öz ýüküňizi yzarlaň",
"order_history": "Sargytlaryň taryhy",
"order_history_desc": "şu ýerde siziň sargytlaryňyz wagt tertipi boyunça görkezilen",
"order_not_available": "Sargyt yok",
"personal_cabinet": "Şahsy otagym",
"splash_text": "Довезём всё!",
"start_tracking": "Yzarlap başlaň",
"track_cargo": "Öz sargydyňyzy yzarlaň",
"cargo_app": "Cargo goşundy",
"exit_app": "Exit Application",
"are_you_sure": "Are You Sure?",
"yes": "Hawa",
"no": "Ýok",
"login_header": "Şahsy otaga giriş",
"login_desc": "özüňize berlen logini we açar sözi giriziň",
"login": "Giriş",
"login_hint": "Öz loginiňizi ýazyň",
"password": "Açar sözi",
"password_hint": "Öz açar sözüni ýazyň",
"credentials_validation_header": "'Invalid credentials",
"credentials_validation_body": "Username or Password Wrong!",
"required_validation": "This field can't be empty",
"order": "Sargyt",
"order_info": "Sargyt barada maglumat",
"route": "Gatnaw yoly",
"order_status": "Ýagdaýy",
"order_carrier": "Awtoulag №",
"order_shop": "Dükan №",
"order_from": "Nireden ugradyldy:",
"order_to": "Nirä barmaly:",
"order_placement_count": "'Ýer sany",
"order_volume": "Kuby",
"order_dimensions": "Göwrümi",
"order_dimensions_desc": "(ini, uzynlygy, beýikligi)",
"order_product_name": "Harydyň ady",
"contact_support": "Tehniki goldaw bilen habarlaşmak",
"privacy_policy": "Gizlinlik syýasaty",
"use_terms": "Ulanyş şertleri",
"logout": "Şahsy otagdan çykmak",
"order_details": "Giňişleýin",
"order_from_card": "Nireden",
"order_to_card": "Nirä",
"order_sent": "Ugradylan senesi"
}

View File

@ -1,7 +1,9 @@
import 'package:easy_localization/easy_localization.dart';
class FormValidator {
static String? validateField(String? val) {
if (val == null || val.isEmpty) {
return 'This field can\'t be empty';
return 'required_validation'.tr();
}
return null;
}

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -46,12 +47,12 @@ class _HistoriesScreenState extends State<HistoriesScreen> {
/// header text
Text(
'Sargytlaryn taryhy',
'order_history'.tr(),
style: AppText.h1b,
),
const Text(
'şu ýerde siziň sargytlaryňyz wagt tertipi boyunça görkezilen',
style: TextStyle(
Text(
'order_history_desc'.tr(),
style: const TextStyle(
color: AppColors.darkGrey,
),
),
@ -92,9 +93,9 @@ class _HistoriesScreenState extends State<HistoriesScreen> {
),
);
} else {
return const SliverToBoxAdapter(
return SliverToBoxAdapter(
child: Center(
child: Text('No orders available'),
child: Text('order_not_available'.tr()),
),
);
}

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
@ -119,17 +120,17 @@ class _LoginScreenState extends State<LoginScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Şahsy otaga giriş',
style: TextStyle(
Text(
'login_header'.tr(),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
const Text(
'özüňize berlen logini we açar sözi giriziň',
style: TextStyle(
Text(
'login_desc'.tr(),
style: const TextStyle(
color: Colors.grey,
),
),
@ -138,14 +139,14 @@ class _LoginScreenState extends State<LoginScreen> {
Space.yf(),
/// username field
const Text('Login'),
Text('login'.tr()),
Space.y!,
TextFormField(
controller: _userNameController,
decoration: const InputDecoration(
hintText: 'Öz loginiňizi ýazyň',
prefixIcon: Icon(Icons.person_outline),
border: OutlineInputBorder(),
decoration: InputDecoration(
hintText: 'login_hint'.tr(),
prefixIcon: const Icon(Icons.person_outline),
border: const OutlineInputBorder(),
),
validator: (val) => FormValidator.validateField(val),
),
@ -154,13 +155,13 @@ class _LoginScreenState extends State<LoginScreen> {
Space.yf(),
/// password field
const Text('Açar sözi'),
Text('password'.tr()),
Space.y!,
TextFormField(
controller: _passwordController,
obscureText: _obscureText,
decoration: InputDecoration(
hintText: 'Öz açar sözüni ýazyň',
hintText: 'password_hint'.tr(),
prefixIcon: const Icon(Icons.lock_outline),
suffixIcon: GestureDetector(
onTap: _onEyeTapped,
@ -186,8 +187,8 @@ class _LoginScreenState extends State<LoginScreen> {
if (state.failure is CredentialFailure) {
showErrorDialog(
context: context,
header: 'Invalid credentials',
body: 'Username or Password Wrong!',
header: 'credentials_validation_header'.tr(),
body: 'credentials_validation_body'.tr(),
);
} else {
showAuthErrorDialog(context);
@ -220,7 +221,7 @@ class _LoginScreenState extends State<LoginScreen> {
);
}
},
text: 'Yzarlap başlaň',
text: 'start_tracking'.tr(),
),
);
},

View File

@ -1,15 +1,15 @@
import 'package:cargo/configs/configs.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../application/order_detail_bloc/order_detail_bloc.dart';
import '../../configs/configs.dart';
import '../../core/core.dart';
import '../../domain/entities/order/order.dart';
import '../widgets/map/clustering.dart';
import '../widgets/widgets.dart';
import 'package:flutter/services.dart';
class OrderDetailsScreen extends StatefulWidget {
final OrderEntity order;
@ -55,7 +55,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
),
backgroundColor: AppColors.primary,
title: Text(
'Sargyt: ${widget.order.name}',
'${'order'.tr()}${widget.order.no}',
style: AppText.h2!.copyWith(color: Colors.white),
),
),
@ -83,7 +83,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sargyt barada maglumat${widget.order.no}',
'${'order_info'.tr()}${widget.order.no}',
style: AppText.b1b,
),
@ -105,7 +105,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Gatnaw yoly',
'route'.tr(),
style: AppText.b1b,
),

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -36,19 +37,19 @@ class _OrdersScreenState extends State<OrdersScreen> with AutomaticKeepAliveClie
SliverToBoxAdapter(
child: Padding(
padding: Space.all(1, 1),
child: const Column(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Sargytlarym',
style: TextStyle(
'my_orders'.tr(),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
Text(
'öz ýüküňizi yzarlaň',
style: TextStyle(
'follow_orders'.tr(),
style: const TextStyle(
color: Colors.grey,
),
),

View File

@ -66,7 +66,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
/// header
Text(
'Şahsy otagym',
'personal_cabinet'.tr(),
style: AppText.h1b,
),
@ -105,14 +105,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
Space.yf(2),
/// card
const SizedBox(
SizedBox(
width: double.infinity,
child: Card(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(16.0),
padding: const EdgeInsets.all(16.0),
child: RowWidget(
text: 'Tehniki goldaw bilen habarlaşmak',
text: 'contact_support'.tr(),
leadingIcon: Icons.contact_support_outlined,
trailingIcon: Icons.arrow_forward_ios,
),
@ -146,15 +146,15 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
/// name surname
const RowWidget(
text: 'Gizlinlik syýasaty',
RowWidget(
text: 'privacy_policy'.tr(),
leadingIcon: Icons.gpp_maybe_outlined,
trailingIcon: Icons.arrow_forward_ios,
),
/// phone
const RowWidget(
text: 'Ulanyş şertleri',
RowWidget(
text: 'use_terms'.tr(),
leadingIcon: Icons.file_copy_outlined,
trailingIcon: Icons.arrow_forward_ios,
),
@ -175,7 +175,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
context.read<UserBloc>().add(SignOutUser());
},
child: Text(
'Şahsy otagdan çykmak',
'logout'.tr(),
style: AppText.b1!.copyWith(
color: Colors.red,
),

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -15,18 +16,18 @@ class RootScreen extends StatelessWidget {
return (await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: const Text(
'Exit Application',
style: TextStyle(color: AppColors.primary),
title: Text(
'exit_app'.tr(),
style: const TextStyle(color: AppColors.primary),
),
content: const Text(
'Are You Sure?',
content: Text(
'are_you_sure'.tr(),
),
actions: <Widget>[
TextButton(
child: const Text(
'Yes',
style: TextStyle(
child: Text(
'yes'.tr(),
style: const TextStyle(
color: Colors.red,
),
),
@ -35,9 +36,9 @@ class RootScreen extends StatelessWidget {
},
),
TextButton(
child: const Text(
'No',
style: TextStyle(color: AppColors.primary),
child: Text(
'no'.tr(),
style: const TextStyle(color: AppColors.primary),
),
onPressed: () {
Navigator.of(context).pop();

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
@ -58,7 +59,7 @@ class SplashScreen extends StatelessWidget {
),
Space.yf(0.30),
Text(
'Довезём всё!',
'splash_text'.tr(),
style: AppText.b1?.copyWith(
color: AppColors.yellow,
),
@ -72,75 +73,3 @@ class SplashScreen extends StatelessWidget {
);
}
}
// class SplashScreen extends StatefulWidget {
// const SplashScreen({super.key});
// @override
// State<SplashScreen> createState() => _SplashScreenState();
// }
// class _SplashScreenState extends State<SplashScreen> {
// void _nextScreen() {
// Future.delayed(const Duration(seconds: 1), () {
// Navigator.of(context).pushNamedAndRemoveUntil(
// AppRouter.splash2,
// (route) => false,
// );
// });
// }
// @override
// void initState() {
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// _nextScreen();
// });
// super.initState();
// }
// @override
// Widget build(BuildContext context) {
// App.init(context);
// return Scaffold(
// body: Container(
// decoration: const BoxDecoration(
// gradient: RadialGradient(
// center: Alignment.center,
// radius: 1.0,
// colors: [
// Color(0xFF5468FF), // Lighter blue in the center
// AppColors.primary, // Darker blue at the edges
// ],
// ),
// ),
// child: SafeArea(
// child: Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// AppAssets.logo,
// height: AppDimensions.normalize(30),
// ),
// Space.yf(0.80),
// Text(
// appTitle,
// style: AppText.h1b?.copyWith(
// color: Colors.white,
// ),
// ),
// Space.yf(0.30),
// Text(
// 'Довезём всё!',
// style: AppText.b1?.copyWith(
// color: AppColors.yellow,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// );
// }
// }

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import '../../configs/configs.dart';
@ -35,7 +36,7 @@ class Splash2Screen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Cargo goşundy',
'cargo_app'.tr(),
style: AppText.h1b?.copyWith(
color: Colors.white,
fontSize: 40,
@ -47,7 +48,7 @@ class Splash2Screen extends StatelessWidget {
/// text
Text(
'Öz sargydyňyzy yzarlaň',
'track_cargo'.tr(),
style: AppText.b1?.copyWith(
color: AppColors.yellow,
fontSize: 22,
@ -71,7 +72,7 @@ class Splash2Screen extends StatelessWidget {
textColor: AppColors.primary,
btnColor: AppColors.yellow,
onPressed: () => _onFollowTapped(context),
text: 'Yzarlap başlaň',
text: 'start_tracking'.tr(),
),
),
)

View File

@ -1,11 +1,12 @@
// bottom_navigation.dart
import 'package:cargo/core/core.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../application/application.dart';
import '../../configs/configs.dart';
import '../../core/core.dart';
class BottomNavigation extends StatelessWidget {
const BottomNavigation({super.key});
@ -23,18 +24,18 @@ class BottomNavigation extends StatelessWidget {
final newTab = NavigationTab.values[index];
context.read<NavigationCubit>().updateTab(newTab);
},
items: const <BottomNavigationBarItem>[
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.list_alt_outlined),
label: 'Sargytlarym',
icon: const Icon(Icons.list_alt_outlined),
label: 'my_orders'.tr(context: context),
),
BottomNavigationBarItem(
icon: Icon(Icons.history_rounded),
label: 'Sargytlaryň taryhy',
icon: const Icon(Icons.history_rounded),
label: 'order_history'.tr(context: context),
),
BottomNavigationBarItem(
icon: Icon(Icons.person_outline_rounded),
label: 'Şahsy otagym',
icon: const Icon(Icons.person_outline_rounded),
label: 'personal_cabinet'.tr(context: context),
),
],
selectedItemColor: AppColors.primary,

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import '../../configs/configs.dart';
@ -18,26 +19,27 @@ class InfoCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RowTextWidget(title: 'Ýagdaýy:', info: order.state),
RowTextWidget(title: '${'order_status'.tr()}:', info: order.state),
Space.y!,
RowTextWidget(title: 'Awtoulag №:', info: order.carrier),
RowTextWidget(title: '${'order_carrier'.tr()}:', info: order.carrier),
Space.y!,
RowTextWidget(title: 'Dukan №:', info: order.shopNo),
RowTextWidget(title: '${'order_shop'.tr()}:', info: order.shopNo),
Space.y!,
RowTextWidget(title: 'Nireden ugradyldy:', info: order.from),
RowTextWidget(title: '${'order_from'.tr()}:', info: order.from),
Space.y!,
RowTextWidget(title: 'Nirä barmaly:', info: order.to),
RowTextWidget(title: '${'order_to'.tr()}:', info: order.to),
Space.y!,
RowTextWidget(title: 'Ýer sany:', info: order.placesCount.toString()),
RowTextWidget(title: '${'order_placement_count'.tr()}:', info: order.placesCount.toString()),
Space.y!,
RowTextWidget(title: 'Kub:', info: order.volume.toString()),
RowTextWidget(title: '${'order_volume'.tr()}:', info: order.volume.toString()),
Space.y!,
RowTextWidget(
title: 'Göwrumi:', info: '${order.width}x${order.depth}x${order.height} (ini, uzynlygy, beýikligi)'),
title: '${'order_dimensions'.tr()}:',
info: '${order.width}x${order.depth}x${order.height} ${'order_dimensions_desc'.tr()}'),
Space.y!,
RowTextWidget(title: 'Harydyň ady:', info: order.name),
RowTextWidget(title: '${'order_product_name'.tr()}:', info: order.name),
// Space.y!,
// const RowTextWidget(title: 'Sargydyň bahasy:', info: '300'),
// RowTextWidget(title: 'Sargydyň bahasy:', info: order.price),
],
),
),

View File

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import '../../configs/configs.dart';
@ -36,7 +37,7 @@ class OrderCard extends StatelessWidget {
);
},
child: Text(
'Ginişleýin >',
'${'order_details'.tr()} >',
style: AppText.b1b?.copyWith(
color: AppColors.primary,
),
@ -61,7 +62,7 @@ class OrderCard extends StatelessWidget {
),
const Spacer(),
Text(
'Ugradylan senesi: ${order.departedAt}',
'${'order_sent'.tr()}: ${order.departedAt}',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -78,7 +79,7 @@ class OrderCard extends StatelessWidget {
Row(
children: [
Expanded(
flex: 3,
flex: 2,
child: Row(
children: [
/// vertical status line
@ -99,7 +100,7 @@ class OrderCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Nireden:',
'${'order_from_card'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -114,7 +115,7 @@ class OrderCard extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
'Nirede:',
'${'order_to_card'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -142,7 +143,7 @@ class OrderCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ýer sany:',
'${'order_placement_count'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -155,7 +156,7 @@ class OrderCard extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
'Göwrümi:',
'${'order_dimensions'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -175,7 +176,7 @@ class OrderCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Maşyn №:',
'${'order_carrier'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),
@ -188,7 +189,7 @@ class OrderCard extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
'Dukan №:',
'${'order_shop'.tr()}:',
style: AppText.b2b!.copyWith(
color: AppColors.grey,
),