TF-1579 Always put source language in addition to current language
This commit is contained in:
@@ -11,7 +11,6 @@ import 'package:pointer_interceptor/pointer_interceptor.dart';
|
|||||||
import 'package:rich_text_composer/rich_text_composer.dart' as rich_text_composer;
|
import 'package:rich_text_composer/rich_text_composer.dart' as rich_text_composer;
|
||||||
import 'package:rule_filter/rule_filter/rule_condition.dart' as rule_condition;
|
import 'package:rule_filter/rule_filter/rule_condition.dart' as rule_condition;
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/model/font_name_type.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/model/font_name_type.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/extensions/locale_extension.dart';
|
|
||||||
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/extensions/rule_condition_extensions.dart';
|
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/extensions/rule_condition_extensions.dart';
|
||||||
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/model/email_rule_filter_action.dart';
|
import 'package:tmail_ui_user/features/rules_filter_creator/presentation/model/email_rule_filter_action.dart';
|
||||||
|
|
||||||
@@ -167,9 +166,6 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
|||||||
if (item is Identity) {
|
if (item is Identity) {
|
||||||
return item.name ?? '';
|
return item.name ?? '';
|
||||||
}
|
}
|
||||||
if (item is Locale) {
|
|
||||||
return item.getLanguageName(context);
|
|
||||||
}
|
|
||||||
if (item is FontNameType) {
|
if (item is FontNameType) {
|
||||||
return item.fontFamily;
|
return item.fontFamily;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-1
@@ -4,7 +4,7 @@ import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
|||||||
|
|
||||||
extension LocaleExtension on Locale {
|
extension LocaleExtension on Locale {
|
||||||
|
|
||||||
String getLanguageName(BuildContext context) {
|
String getLanguageNameByCurrentLocale(BuildContext context) {
|
||||||
switch(languageCode) {
|
switch(languageCode) {
|
||||||
case 'fr':
|
case 'fr':
|
||||||
return AppLocalizations.of(context).languageFrench;
|
return AppLocalizations.of(context).languageFrench;
|
||||||
@@ -22,4 +22,23 @@ extension LocaleExtension on Locale {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getSourceLanguageName() {
|
||||||
|
switch(languageCode) {
|
||||||
|
case 'fr':
|
||||||
|
return 'Français';
|
||||||
|
case 'en':
|
||||||
|
return 'English';
|
||||||
|
case 'vi':
|
||||||
|
return 'Tiếng Việt';
|
||||||
|
case 'ru':
|
||||||
|
return 'Русский';
|
||||||
|
case 'ar':
|
||||||
|
return 'اَلْعَرَبِيَّةُ';
|
||||||
|
case 'it':
|
||||||
|
return 'Italiano';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -112,7 +112,7 @@ class ChangeLanguageButtonWidget extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(left: 12, right: 10),
|
padding: const EdgeInsets.only(left: 12, right: 10),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Expanded(child: Text(
|
Expanded(child: Text(
|
||||||
_controller.languageSelected.value.getLanguageName(context),
|
_controller.languageSelected.value.getLanguageNameByCurrentLocale(context),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
|
|||||||
+25
-10
@@ -33,16 +33,31 @@ class LanguageItemWidget extends StatelessWidget {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Expanded(child: Text(
|
Expanded(child: Row(
|
||||||
localeCurrent.getLanguageName(context),
|
children: [
|
||||||
style: const TextStyle(
|
Text(
|
||||||
fontSize: 17,
|
localeCurrent.getLanguageNameByCurrentLocale(context),
|
||||||
fontWeight: FontWeight.normal,
|
style: const TextStyle(
|
||||||
color: Colors.black
|
fontSize: 17,
|
||||||
),
|
fontWeight: FontWeight.normal,
|
||||||
maxLines: 1,
|
color: Colors.black
|
||||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
),
|
||||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
maxLines: 1,
|
||||||
|
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||||
|
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
' - ${localeCurrent.getSourceLanguageName()}',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 17,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.black
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||||
|
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||||
|
)
|
||||||
|
]
|
||||||
)),
|
)),
|
||||||
if (localeCurrent == localeSelected)
|
if (localeCurrent == localeSelected)
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
|
|||||||
Reference in New Issue
Block a user