Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Translate Auth changelog for all supported locales

AmanRajSinghMourya3a83a9ef66bb
diff --git a/mobile/apps/auth/lib/ui/settings/widgets/change_log_strings.dart b/mobile/apps/auth/lib/ui/settings/widgets/change_log_strings.dart
index 73780c74d1..107647f328 100644
--- a/mobile/apps/auth/lib/ui/settings/widgets/change_log_strings.dart
+++ b/mobile/apps/auth/lib/ui/settings/widgets/change_log_strings.dart
@@ -29,6 +29,377 @@ class ChangeLogStrings {
),
],
),
+ 'ar': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "الأحدث أولاً",
+ description: "اعرض الرموز التي أضفتها مؤخراً أولاً.",
+ ),
+ ChangeLogEntryStrings(
+ title: "استيراد من Open Authenticator",
+ description:
+ "انقل رموزك إلى Ente Auth باستخدام نسخة احتياطية من Open Authenticator.",
+ ),
+ ],
+ ),
+ 'bg': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Най-новите първо",
+ description:
+ "Показвайте първо кодовете, които сте добавили най-скоро.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Импортиране от Open Authenticator",
+ description:
+ "Прехвърлете кодовете си в Ente Auth от резервно копие на Open Authenticator.",
+ ),
+ ],
+ ),
+ 'ca': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Els més recents primer",
+ description: "Mostra primer els codis que has afegit més recentment.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importa des d’Open Authenticator",
+ description:
+ "Porta els teus codis a Ente Auth des d’una còpia de seguretat d’Open Authenticator.",
+ ),
+ ],
+ ),
+ 'cs': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Nejnovější nahoře",
+ description: "Zobrazte nejdříve naposledy přidané kódy.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Import z Open Authenticator",
+ description:
+ "Přeneste své kódy do Ente Auth ze zálohy aplikace Open Authenticator.",
+ ),
+ ],
+ ),
+ 'de': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Neueste zuerst",
+ description: "Zeige deine zuletzt hinzugefügten Codes zuerst an.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Import aus Open Authenticator",
+ description:
+ "Übertrage deine Codes aus einem Open Authenticator-Backup in Ente Auth.",
+ ),
+ ],
+ ),
+ 'el': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Τα νεότερα πρώτα",
+ description:
+ "Εμφανίστε πρώτα τους κωδικούς που προσθέσατε πιο πρόσφατα.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Εισαγωγή από το Open Authenticator",
+ description:
+ "Μεταφέρετε τους κωδικούς σας στο Ente Auth από ένα αντίγραφο ασφαλείας του Open Authenticator.",
+ ),
+ ],
+ ),
+ 'es': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Más recientes primero",
+ description:
+ "Muestra primero los códigos que has añadido más recientemente.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importar desde Open Authenticator",
+ description:
+ "Trae tus códigos a Ente Auth desde una copia de seguridad de Open Authenticator.",
+ ),
+ ],
+ ),
+ 'fa': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "جدیدترین‌ها در ابتدا",
+ description:
+ "کدهایی را که به‌تازگی اضافه کرده‌اید، در ابتدا نمایش دهید.",
+ ),
+ ChangeLogEntryStrings(
+ title: "وارد کردن از Open Authenticator",
+ description:
+ "کدهای خود را از یک نسخهٔ پشتیبان Open Authenticator به Ente Auth منتقل کنید.",
+ ),
+ ],
+ ),
+ 'fr': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Les plus récents d’abord",
+ description: "Affichez d’abord les codes ajoutés le plus récemment.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importer depuis Open Authenticator",
+ description:
+ "Transférez vos codes vers Ente Auth à partir d’une sauvegarde Open Authenticator.",
+ ),
+ ],
+ ),
+ 'he': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "החדשים ביותר תחילה",
+ description: "הציגו תחילה את הקודים שהוספתם לאחרונה.",
+ ),
+ ChangeLogEntryStrings(
+ title: "ייבוא מ־Open Authenticator",
+ description:
+ "העבירו את הקודים שלכם אל Ente Auth מגיבוי של Open Authenticator.",
+ ),
+ ],
+ ),
+ 'hu': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Legújabbak elöl",
+ description: "A legutóbb hozzáadott kódok megjelenítése elsőként.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importálás az Open Authenticator alkalmazásból",
+ description:
+ "Vigye át kódjait az Ente Auth alkalmazásba az Open Authenticator biztonsági mentéséből.",
+ ),
+ ],
+ ),
+ 'id': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Terbaru lebih dulu",
+ description:
+ "Tampilkan kode yang paling baru ditambahkan terlebih dahulu.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Impor dari Open Authenticator",
+ description:
+ "Pindahkan kode Anda ke Ente Auth dari cadangan Open Authenticator.",
+ ),
+ ],
+ ),
+ 'it': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Prima i più recenti",
+ description: "Mostra per primi i codici aggiunti più di recente.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importa da Open Authenticator",
+ description:
+ "Trasferisci i tuoi codici in Ente Auth da un backup di Open Authenticator.",
+ ),
+ ],
+ ),
+ 'ja': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(title: "新しい順", description: "最近追加したコードを先に表示します。"),
+ ChangeLogEntryStrings(
+ title: "Open Authenticatorからインポート",
+ description: "Open AuthenticatorのバックアップからEnte Authにコードを移行できます。",
+ ),
+ ],
+ ),
+ 'ko': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "최신순",
+ description: "가장 최근에 추가한 코드를 먼저 표시하세요.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Open Authenticator에서 가져오기",
+ description: "Open Authenticator 백업에서 Ente Auth로 코드를 가져오세요.",
+ ),
+ ],
+ ),
+ 'lt': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Naujausi pirmiausia",
+ description: "Pirmiausia rodykite naujausiai pridėtus kodus.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importavimas iš Open Authenticator",
+ description:
+ "Perkelkite kodus į Ente Auth iš Open Authenticator atsarginės kopijos.",
+ ),
+ ],
+ ),
+ 'nl': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Nieuwste eerst",
+ description: "Toon je meest recent toegevoegde codes eerst.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importeren uit Open Authenticator",
+ description:
+ "Zet je codes over naar Ente Auth vanuit een back-up van Open Authenticator.",
+ ),
+ ],
+ ),
+ 'pl': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Najnowsze najpierw",
+ description: "Wyświetlaj ostatnio dodane kody jako pierwsze.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Import z Open Authenticator",
+ description:
+ "Przenieś swoje kody do Ente Auth z kopii zapasowej Open Authenticator.",
+ ),
+ ],
+ ),
+ 'pt': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Mais recentes primeiro",
+ description:
+ "Mostre primeiro os códigos que adicionou mais recentemente.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importar do Open Authenticator",
+ description:
+ "Transfira os seus códigos para o Ente Auth a partir de uma cópia de segurança do Open Authenticator.",
+ ),
+ ],
+ ),
+ 'pt_BR': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Mais recentes primeiro",
+ description:
+ "Mostre primeiro os códigos que você adicionou mais recentemente.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importar do Open Authenticator",
+ description:
+ "Transfira seus códigos para o Ente Auth a partir de um backup do Open Authenticator.",
+ ),
+ ],
+ ),
+ 'ro': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Cele mai noi mai întâi",
+ description: "Afișează mai întâi codurile adăugate cel mai recent.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Importă din Open Authenticator",
+ description:
+ "Transferă codurile în Ente Auth dintr-o copie de rezervă Open Authenticator.",
+ ),
+ ],
+ ),
+ 'ru': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Сначала новые",
+ description: "Показывайте недавно добавленные коды первыми.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Импорт из Open Authenticator",
+ description:
+ "Перенесите свои коды в Ente Auth из резервной копии Open Authenticator.",
+ ),
+ ],
+ ),
+ 'sl': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Najnovejše najprej",
+ description: "Najprej prikažite nazadnje dodane kode.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Uvoz iz Open Authenticator",
+ description:
+ "Prenesite svoje kode v Ente Auth iz varnostne kopije Open Authenticator.",
+ ),
+ ],
+ ),
+ 'sk': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Najnovšie navrchu",
+ description: "Zobrazte najskôr naposledy pridané kódy.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Import z Open Authenticator",
+ description:
+ "Preneste svoje kódy do Ente Auth zo zálohy aplikácie Open Authenticator.",
+ ),
+ ],
+ ),
+ 'tr': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Önce en yeniler",
+ description: "En son eklediğiniz kodları önce gösterin.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Open Authenticator’dan içe aktar",
+ description:
+ "Kodlarınızı bir Open Authenticator yedeğinden Ente Auth’a aktarın.",
+ ),
+ ],
+ ),
+ 'uk': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Спочатку нові",
+ description: "Показуйте нещодавно додані коди першими.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Імпорт з Open Authenticator",
+ description:
+ "Перенесіть свої коди до Ente Auth із резервної копії Open Authenticator.",
+ ),
+ ],
+ ),
+ 'vi': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(
+ title: "Mới nhất trước",
+ description: "Hiển thị các mã được thêm gần đây nhất lên đầu.",
+ ),
+ ChangeLogEntryStrings(
+ title: "Nhập từ Open Authenticator",
+ description:
+ "Chuyển các mã của bạn vào Ente Auth từ bản sao lưu Open Authenticator.",
+ ),
+ ],
+ ),
+ 'zh_CN': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(title: "最新添加优先", description: "优先显示最近添加的验证码。"),
+ ChangeLogEntryStrings(
+ title: "从 Open Authenticator 导入",
+ description: "将 Open Authenticator 备份中的验证码导入 Ente Auth。",
+ ),
+ ],
+ ),
+ 'zh_TW': ChangeLogStrings(
+ entries: [
+ ChangeLogEntryStrings(title: "最新加入優先", description: "優先顯示最近加入的驗證碼。"),
+ ChangeLogEntryStrings(
+ title: "從 Open Authenticator 匯入",
+ description: "將 Open Authenticator 備份中的驗證碼匯入 Ente Auth。",
+ ),
+ ],
+ ),
};
}
diff --git a/mobile/apps/auth/test/ui/settings/whats_new_test.dart b/mobile/apps/auth/test/ui/settings/whats_new_test.dart
index 1fa98b6c33..ff660cc09b 100644
--- a/mobile/apps/auth/test/ui/settings/whats_new_test.dart
+++ b/mobile/apps/auth/test/ui/settings/whats_new_test.dart
@@ -2,9 +2,11 @@ import 'dart:io';
import 'package:dio/dio.dart';
import 'package:ente_auth/core/configuration.dart';
+import 'package:ente_auth/locale.dart';
import 'package:ente_auth/services/preference_service.dart';
import 'package:ente_auth/ui/settings/about_settings_page.dart';
import 'package:ente_auth/ui/settings/data/data_settings_page.dart';
+import 'package:ente_auth/ui/settings/widgets/change_log_strings.dart';
import 'package:ente_auth/ui/settings_page.dart';
import 'package:ente_components/ente_components.dart';
import 'package:ente_network/network.dart';
@@ -62,6 +64,87 @@ void main() {
await directory.delete(recursive: true);
});
+ for (final locale in appSupportedLocales) {
+ if (locale.languageCode != 'en') {
+ test('changelog translates every entry for $locale', () {
+ final english = ChangeLogStrings.forLocale(const Locale('en'));
+ final translated = ChangeLogStrings.forLocale(locale);
+ expect(translated.entries, hasLength(english.entries.length));
+ for (var i = 0; i < translated.entries.length; i++) {
+ expect(translated.entries[i].title, isNotEmpty);
+ expect(translated.entries[i].description, isNotEmpty);
+ expect(translated.entries[i].title, isNot(english.entries[i].title));
+ expect(
+ translated.entries[i].description,
+ isNot(english.entries[i].description),
+ );
+ }
+ });
+ }
+
+ testWidgets('changelog renders and scrolls in $locale', (tester) async {
+ tester.view.physicalSize = const Size(320, 568);
+ tester.view.devicePixelRatio = 1;
+ addTearDown(tester.view.resetPhysicalSize);
+ addTearDown(tester.view.resetDevicePixelRatio);
+ await tester.pumpWidget(
+ MaterialApp(
+ locale: locale,
+ theme: ComponentTheme.lightTheme(app: ComponentApp.auth),
+ localizationsDelegates: StringsLocalizations.localizationsDelegates,
+ supportedLocales: appSupportedLocales,
+ builder: (context, child) => MediaQuery(
+ data: MediaQuery.of(
+ context,
+ ).copyWith(textScaler: const TextScaler.linear(1.5)),
+ child: child!,
+ ),
+ home: const AboutSettingsPage(),
+ ),
+ );
+ await tester.pumpAndSettle();
+ final l10n = tester.element(find.byType(AboutSettingsPage)).strings;
+ await tester.tap(find.text(l10n.whatsNew));
+ await tester.pumpAndSettle();
+ final sheet = find.byType(BottomSheetComponent);
+ expect(Localizations.localeOf(tester.element(sheet)), locale);
+ expect(
+ Directionality.of(tester.element(sheet)),
+ ['ar', 'fa', 'he'].contains(locale.languageCode)
+ ? TextDirection.rtl
+ : TextDirection.ltr,
+ );
+ final entries = ChangeLogStrings.forLocale(locale).entries;
+ for (final entry in entries) {
+ await tester.scrollUntilVisible(
+ find.text(entry.description),
+ 100,
+ scrollable: find.descendant(
+ of: sheet,
+ matching: find.byType(Scrollable),
+ ),
+ );
+ expect(find.text(entry.title), findsOneWidget);
+ expect(find.text(entry.description), findsOneWidget);
+ }
+ expect(tester.takeException(), isNull);
+ await tester.tap(find.text(l10n.continueLabel));
+ await tester.pumpAndSettle();
+ expect(sheet, findsNothing);
+ });
+ }
+
+ test('changelog falls back by language, then to English', () {
+ expect(
+ ChangeLogStrings.forLocale(const Locale('es', 'MX')),
+ same(ChangeLogStrings.forLocale(const Locale('es', 'ES'))),
+ );
+ expect(
+ ChangeLogStrings.forLocale(const Locale('xx')),
+ same(ChangeLogStrings.forLocale(const Locale('en'))),
+ );
+ });
+
for (final signedIn in [false, true]) {
group(signedIn ? 'signed in without internet' : 'offline mode', () {
setUp(() async {