Put change language option behind ff (#985)

This commit is contained in:
Neeraj Gupta 2023-04-13 14:29:09 +05:30 committed by GitHub
commit 3918e85614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 41 deletions

View file

@ -1,3 +1,4 @@
import "package:flutter/foundation.dart";
import "package:flutter/widgets.dart";
import "package:photos/generated/l10n.dart";
import "package:shared_preferences/shared_preferences.dart";
@ -9,10 +10,10 @@ extension AppLocalizationsX on BuildContext {
// list of locales which are enabled for auth app.
// Add more language to the list only when at least 90% of the strings are
// translated in the corresponding language.
const List<Locale> appSupportedLocales = <Locale>[
const List<Locale> appSupportedLocales = kDebugMode
? <Locale>[Locale('en'), Locale('fr'), Locale("nl")]
: <Locale>[
Locale('en'),
Locale('fr'),
Locale("nl")
];
Locale localResolutionCallBack(locales, supportedLocales) {

View file

@ -3,6 +3,7 @@ import "package:photos/app.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/l10n/l10n.dart";
import 'package:photos/services/billing_service.dart';
import "package:photos/services/feature_flag_service.dart";
import 'package:photos/services/user_service.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/advanced_settings_screen.dart';
@ -27,21 +28,10 @@ class GeneralSectionWidget extends StatelessWidget {
}
Widget _getSectionOptions(BuildContext context) {
final bool showLanguageChangeOption =
FeatureFlagService.instance.isInternalUserOrDebugBuild();
return Column(
children: [
sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: S.of(context).familyPlans,
),
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
showOnlyLoadingState: true,
onTap: () async {
await _onFamilyPlansTapped(context);
},
),
sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
@ -61,17 +51,19 @@ class GeneralSectionWidget extends StatelessWidget {
sectionOptionSpacing,
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: S.of(context).advanced,
title: S.of(context).familyPlans,
),
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
showOnlyLoadingState: true,
onTap: () async {
_onAdvancedTapped(context);
await _onFamilyPlansTapped(context);
},
),
sectionOptionSpacing,
MenuItemWidget(
showLanguageChangeOption
? MenuItemWidget(
captionedTextWidget:
CaptionedTextWidget(title: S.of(context).language),
pressedColor: getEnteColorScheme(context).fillFaint,
@ -92,6 +84,21 @@ class GeneralSectionWidget extends StatelessWidget {
),
);
},
)
: const SizedBox.shrink(),
showLanguageChangeOption
? sectionOptionSpacing
: const SizedBox.shrink(),
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: S.of(context).advanced,
),
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
onTap: () async {
_onAdvancedTapped(context);
},
),
sectionOptionSpacing,
],