From 0b06d9b8c7135992198539874ad392b8d2bae387 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:31:36 +0200 Subject: [PATCH] added translations --- lib/data/models/app_feature.dart | 43 +++++++++++++++---- lib/l10n/intl_en.arb | 10 +++++ lib/l10n/intl_fr.arb | 26 ++++++++++- lib/l10n/intl_ru.arb | 26 ++++++++++- lib/l10n/intl_zh.arb | 25 ++++++++++- .../pro_features/screen_pro_features.dart | 2 +- 6 files changed, 117 insertions(+), 15 deletions(-) diff --git a/lib/data/models/app_feature.dart b/lib/data/models/app_feature.dart index ef1e73e..d632815 100644 --- a/lib/data/models/app_feature.dart +++ b/lib/data/models/app_feature.dart @@ -1,7 +1,12 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/providers/films_provider.dart'; + enum AppFeature { - cameraMetering, - ndFilters, - theming, + reflectedLightMetering, + incidedntLightMetering, + isoAndNdValues, + themeEngine, spotMetering, histogram, listOfFilms, @@ -9,15 +14,37 @@ enum AppFeature { timer, mainScreenCustomization; - String get name { - return toString().replaceAll(runtimeType.toString(), '').replaceAll('.', ''); + String name(BuildContext context) { + switch (this) { + case AppFeature.reflectedLightMetering: + return S.of(context).featureReflectedLightMetering; + case AppFeature.incidedntLightMetering: + return S.of(context).featureIncidentLightMetering; + case AppFeature.isoAndNdValues: + return S.of(context).featureIsoAndNdValues; + case AppFeature.themeEngine: + return S.of(context).featureTheme; + case AppFeature.spotMetering: + return S.of(context).featureSpotMetering; + case AppFeature.histogram: + return S.of(context).featureHistogram; + case AppFeature.listOfFilms: + return S.of(context).featureListOfFilms; + case AppFeature.equipmentProfiles: + return S.of(context).featureEquipmentProfiles; + case AppFeature.timer: + return S.of(context).featureTimer; + case AppFeature.mainScreenCustomization: + return S.of(context).featureMeteringScreenLayout; + } } bool get isFree { switch (this) { - case AppFeature.cameraMetering: - case AppFeature.ndFilters: - case AppFeature.theming: + case AppFeature.reflectedLightMetering: + case AppFeature.incidedntLightMetering: + case AppFeature.isoAndNdValues: + case AppFeature.themeEngine: return true; default: return false; diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 6ef9401..a5d7b25 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -109,6 +109,16 @@ "featuresPro": "Pro", "proFeaturesPromoText": "Lightmeter Pro delivers everything you need to get the best shots!", "proFeaturesWhatsIncluded": "What's included?", + "featureReflectedLightMetering": "Reflected light metering", + "featureIncidentLightMetering": "Incident light metering", + "featureIsoAndNdValues": "Wide range of ISO and ND filters values", + "featureTheme": "Theme customization", + "featureSpotMetering": "Spot metering", + "featureHistogram": "Histogram", + "featureListOfFilms": "List of 20+ films with reciprocity formulas", + "featureEquipmentProfiles": "Equipment profiles", + "featureTimer": "Built-in timer for long exposure", + "featureMeteringScreenLayout": "Customizable main screen", "proFeaturesSupportText": "By purchasing Lightmeter Pro you support the development and make it possible to add new features to the app.", "unlockFor": "Unlock for {price}", "@unlockFor": { diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 3d0a684..2848e98 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -104,9 +104,31 @@ } }, "proFeatures": "Fonctionnalités professionnelles", - "unlockProFeatures": "Déverrouiller les fonctionnalités professionnelles", - "unlockProFeaturesDescription": "Déverrouillez des fonctions professionnelles:\n \u2022 Profils d'équipement contenant des filtres pour l'ouverture, la vitesse d'obturation et plus encore, ainsi qu'une liste de films avec compensation pour ce que l'on appelle l'échec de réciprocité\n \u2022 Mesure spot & Histogramme\n \u2022 Et plus encore!\n\nEn débloquant les fonctionnalités Pro, vous soutenez le développement et permettez d'ajouter de nouvelles fonctionnalités à l'application.", + "proFeaturesTitle": "Lightmeter Pro", "unlock": "Déverrouiller", + "featuresFree": "Gratuit", + "featuresPro": "Pro", + "proFeaturesPromoText": "Lightmeter Pro offre tout ce dont vous avez besoin pour obtenir les meilleurs clichés!", + "proFeaturesWhatsIncluded": "Qu'est-ce qui est inclus?", + "featureReflectedLightMetering": "Mesure de la lumière réfléchie", + "featureIncidentLightMetering": "Mesure de la lumière incidente", + "featureIsoAndNdValues": "Large gamme de valeurs ISO et de filtres ND", + "featureTheme": "Personnalisation du thème", + "featureSpotMetering": "Mesure spot", + "featureHistogram": "Histogramme", + "featureListOfFilms": "Liste de plus de 20 films avec des formules de correction", + "featureEquipmentProfiles": "Profils de l'équipement", + "featureTimer": "Minuteur intégré pour longues expositions", + "featureMeteringScreenLayout": "Écran principal personnalisable", + "proFeaturesSupportText": "En achetant Lightmeter Pro, vous soutenez le développement et permettez l'ajout de nouvelles fonctionnalités à l'application.", + "unlockFor": "Déverrouiller pour {price}", + "@unlockFor": { + "price": { + "version": { + "type": "String" + } + } + }, "tooltipAdd": "Ajouter", "tooltipClose": "Fermer", "tooltipExpand": "Élargir", diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index d005f77..9df2907 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -104,9 +104,31 @@ } }, "proFeatures": "Профессиональные настройки", - "unlockProFeatures": "Разблокировать профессиональные настройки", - "unlockProFeaturesDescription": "Вы можете разблокировать профессиональные настройки:\n \u2022 Профили оборудования, содержащие фильтры для диафрагмы, выдержки и других значений\n \u2022 Список пленок с компенсацией эффекта Шварцшильда\n \u2022 Точечный замер и гистограмма\n \u2022 И другие возможности!\n\nПолучая доступ к профессиональным настройкам, вы поддерживаете разработку и делаете возможным появление новых функций в приложении.", + "proFeaturesTitle": "Lightmeter Pro", "unlock": "Разблокировать", + "featuresFree": "Бесплатно", + "featuresPro": "Pro", + "proFeaturesPromoText": "Lightmeter Pro предоставляет все необходимое для получения лучших снимков!", + "proFeaturesWhatsIncluded": "Что включено?", + "featureReflectedLightMetering": "Замер отраженного света", + "featureIncidentLightMetering": "Замер падающего света", + "featureIsoAndNdValues": "Широкий диапазон значений ISO и фильтров ND", + "featureTheme": "Настройка темы", + "featureSpotMetering": "Точечный замер", + "featureHistogram": "Гистограмма", + "featureListOfFilms": "Список из 20+ фильмов с формулами коррекции", + "featureEquipmentProfiles": "Профили оборудования", + "featureTimer": "Встроенный таймер для длинных выдержек", + "featureMeteringScreenLayout": "Настраиваемый главный экран", + "proFeaturesSupportText": "Покупая Lightmeter Pro, вы поддерживаете разработку и делаете возможным добавление новых функций в приложение.", + "unlockFor": "Разблокировать за {price}", + "@unlockFor": { + "price": { + "version": { + "type": "String" + } + } + }, "tooltipAdd": "Добавить", "tooltipClose": "Закрыть", "tooltipExpand": "Развернуть", diff --git a/lib/l10n/intl_zh.arb b/lib/l10n/intl_zh.arb index aa17748..bb2ab7d 100644 --- a/lib/l10n/intl_zh.arb +++ b/lib/l10n/intl_zh.arb @@ -104,9 +104,30 @@ } }, "proFeatures": "专业功能", - "unlockProFeatures": "解锁专业功能", - "unlockProFeaturesDescription": "\n \u2022 配置文件,其中包含光圈、快门速度等参数\n \u2022 胶卷列表,对胶片倒易率失效进行曝光补偿\n \u2022 点测光和直方图\n \u2022 和更多\n\n通过解锁专业版功能,您可以支持开发工作,帮助为应用程序添加新功能。", "unlock": "解锁", + "featuresFree": "免费", + "featuresPro": "专业版", + "proFeaturesPromoText": "Lightmeter Pro 提供您需要的一切,助您拍出最佳照片!", + "proFeaturesWhatsIncluded": "包括哪些内容?", + "featureReflectedLightMetering": "反射光测光", + "featureIncidentLightMetering": "入射光测光", + "featureIsoAndNdValues": "广泛的ISO和ND滤镜值范围", + "featureTheme": "主题自定义", + "featureSpotMetering": "点测光", + "featureHistogram": "直方图", + "featureListOfFilms": "20多部电影的修正公式列表", + "featureEquipmentProfiles": "设备配置文件", + "featureTimer": "内置长曝光计时器", + "featureMeteringScreenLayout": "可自定义的主屏幕", + "proFeaturesSupportText": "通过购买Lightmeter Pro,您支持开发工作,并使添加新功能成为可能。", + "unlockFor": "解锁价格 {price}", + "@unlockFor": { + "price": { + "version": { + "type": "String" + } + } + }, "tooltipAdd": "添加", "tooltipClose": "关闭", "tooltipExpand": "展开", diff --git a/lib/screens/pro_features/screen_pro_features.dart b/lib/screens/pro_features/screen_pro_features.dart index c44ba00..9db2b60 100644 --- a/lib/screens/pro_features/screen_pro_features.dart +++ b/lib/screens/pro_features/screen_pro_features.dart @@ -142,7 +142,7 @@ class _FeatureItem extends StatelessWidget { vertical: Dimens.paddingS, ), child: Text( - feature.name, + feature.name(context), style: Theme.of(context).textTheme.bodyLarge, ), ),