Add language_id to users
This commit is contained in:
parent
49724fd6eb
commit
9ab6c70a2c
|
|
@ -127,9 +127,13 @@ List<BaseEntity> filteredSelector(String? filter, UserCompanyState state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String localeSelector(AppState state, {bool twoLetter = false}) {
|
String localeSelector(AppState state, {bool twoLetter = false}) {
|
||||||
final locale = state
|
var languageId = state.company.languageId;
|
||||||
.staticState.languageMap[state.company.settings.languageId]?.locale ??
|
if (state.user.languageId.isNotEmpty) {
|
||||||
'en';
|
languageId = state.user.languageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
final languageMap = state.staticState.languageMap;
|
||||||
|
final locale = languageMap[languageId]?.locale ?? 'en';
|
||||||
|
|
||||||
// https://github.com/flutter/flutter/issues/32090
|
// https://github.com/flutter/flutter/issues/32090
|
||||||
if (locale == 'mk_MK' || locale == 'sq') {
|
if (locale == 'mk_MK' || locale == 'sq') {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import 'package:built_collection/built_collection.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
|
||||||
import 'package:invoiceninja_flutter/main_app.dart';
|
import 'package:invoiceninja_flutter/main_app.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/static/static_selectors.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/entity_dropdown.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/sms_verification.dart';
|
import 'package:invoiceninja_flutter/ui/app/sms_verification.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
|
@ -443,6 +445,23 @@ class _UserDetailsState extends State<UserDetails>
|
||||||
value ?? '#ffffff'));
|
value ?? '#ffffff'));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
EntityDropdown(
|
||||||
|
entityType: EntityType.language,
|
||||||
|
entityList:
|
||||||
|
memoizedLanguageList(state.staticState.languageMap),
|
||||||
|
labelText: localization.language +
|
||||||
|
(user.languageId.isNotEmpty
|
||||||
|
? ''
|
||||||
|
: ' - ' +
|
||||||
|
state
|
||||||
|
.staticState
|
||||||
|
.languageMap[state.company.languageId]!
|
||||||
|
.name),
|
||||||
|
entityId: user.languageId,
|
||||||
|
onSelected: (SelectableEntity? language) =>
|
||||||
|
viewModel.onChanged(user.rebuild(
|
||||||
|
(b) => b..languageId = language?.id ?? '')),
|
||||||
|
),
|
||||||
if (state.company.isLarge || !kReleaseMode) ...[
|
if (state.company.isLarge || !kReleaseMode) ...[
|
||||||
AppDropdownButton<int>(
|
AppDropdownButton<int>(
|
||||||
blankValue: null,
|
blankValue: null,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))
|
InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))
|
||||||
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
||||||
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
|
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin"))
|
PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin"))
|
||||||
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
|
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue