Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@
"@themeSettingSystem": {
"description": "Label for system theme setting."
},
"openLinksWithInAppBrowser": "Open links with in-app browser",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The translation for the label is taken from zulip-mobile. The user
facing string refers to "in in-app browser" when the actual value is
`UrlLaunchMode.platformDefault`. This is consistent with the behavior
the user sees when the link is a HTTP URL on Android and iOS, which
should cover the majority of use cases of this setting (and probably
what the user would expect).

This apologetic paragraph can get a lot simpler now 🙂 — I think really can just be cut.

The exact semantics are now "Open links with in-app browser where possible", and the implementation code now makes clear that those are the semantics. And having a "where possible" qualifier be implicit is pretty normal for UI text (outside of UIs for quite technical domains).

"@openLinksWithInAppBrowser": {
"description": "Label for toggling setting to open links with in-app browser"
},
"pollWidgetQuestionMissing": "No question.",
"@pollWidgetQuestionMissing": {
"description": "Text to display for a poll when the question is missing"
Expand Down
6 changes: 6 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,12 @@ abstract class ZulipLocalizations {
/// **'System'**
String get themeSettingSystem;

/// Label for toggling setting to open links with in-app browser
///
/// In en, this message translates to:
/// **'Open links with in-app browser'**
String get openLinksWithInAppBrowser;

/// Text to display for a poll when the question is missing
///
/// In en, this message translates to:
Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'Brak pytania.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'Нет вопроса.';

Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
@override
String get themeSettingSystem => 'System';

@override
String get openLinksWithInAppBrowser => 'Open links with in-app browser';

@override
String get pollWidgetQuestionMissing => 'Bez otázky.';

Expand Down
11 changes: 10 additions & 1 deletion lib/model/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ part 'database.g.dart';
class GlobalSettings extends Table {
Column<String> get themeSetting => textEnum<ThemeSetting>()
.nullable()();

Column<String> get browserPreference => textEnum<BrowserPreference>()
.nullable()();
}

/// The table of [Account] records in the app's database.
Expand Down Expand Up @@ -73,6 +76,8 @@ VersionedSchema _getSchema({
return Schema2(database: database);
case 3:
return Schema3(database: database);
case 4:
return Schema4(database: database);
default:
throw Exception('unknown schema version: $schemaVersion');
}
Expand All @@ -93,7 +98,7 @@ class AppDatabase extends _$AppDatabase {
// * Write a migration in `onUpgrade` below.
// * Write tests.
@override
int get schemaVersion => 3; // See note.
int get schemaVersion => 4; // See note.

Future<void> _dropAndCreateAll(Migrator m, {
required int schemaVersion,
Expand Down Expand Up @@ -145,6 +150,10 @@ class AppDatabase extends _$AppDatabase {
from2To3: (m, schema) async {
await m.createTable(schema.globalSettings);
},
from3To4: (m, schema) async {
await m.addColumn(
schema.globalSettings, schema.globalSettings.browserPreference);
},
));
});
}
Expand Down
Loading