Settings: Make more parts translatable

This commit is contained in:
Vishesh Handa
2020-09-05 12:31:01 +02:00
parent 0b9b34d39a
commit 888e391af8
2 changed files with 63 additions and 28 deletions

View File

@ -82,6 +82,8 @@ settings:
markdownEditor: Markdown Editor markdownEditor: Markdown Editor
journalEditor: Journal Editor journalEditor: Journal Editor
defaultFolder: Default Folder defaultFolder: Default Folder
checklistEditor: Checklist Editor
rawEditor: Raw Editor
sortingField: sortingField:
modified: Last Modified modified: Last Modified
created: Created created: Created
@ -105,6 +107,22 @@ settings:
title: Misc Settings title: Misc Settings
swipe: Swipe to Delete Note swipe: Swipe to Delete Note
listView: List View listView: List View
NoteFileNameFormat:
iso8601WithTimeZone: ISO8601 With TimeZone
iso8601: ISO8601
iso8601WithoutColon: ISO8601 without Colons
title: Title
uuid: Uuid V4
simmple: yyyy-mm-dd-hh-mm-ss
zettelkasten: yyyymmddhhmmss
HomeScreen:
allNotes: All Notes
allFolders: All Folders
EditorDefaultView:
edit: Edit
view: View
lastUsed: Last Used
editors: editors:
checklist: checklist:

View File

@ -332,17 +332,21 @@ class Settings extends ChangeNotifier {
} }
class NoteFileNameFormat { class NoteFileNameFormat {
static const Iso8601WithTimeZone = static const Iso8601WithTimeZone = NoteFileNameFormat(
NoteFileNameFormat("Iso8601WithTimeZone", "ISO8601 With TimeZone"); "Iso8601WithTimeZone", 'settings.NoteFileNameFormat.iso8601WithTimeZone');
static const Iso8601 = NoteFileNameFormat("Iso8601", "Iso8601"); static const Iso8601 =
NoteFileNameFormat("Iso8601", 'settings.NoteFileNameFormat.iso8601');
static const Iso8601WithTimeZoneWithoutColon = NoteFileNameFormat( static const Iso8601WithTimeZoneWithoutColon = NoteFileNameFormat(
"Iso8601WithTimeZoneWithoutColon", "ISO8601 without Colons"); "Iso8601WithTimeZoneWithoutColon",
static const FromTitle = NoteFileNameFormat("FromTitle", "Title"); 'settings.NoteFileNameFormat.iso8601WithoutColon');
static const FromTitle =
NoteFileNameFormat("FromTitle", 'settings.NoteFileNameFormat.title');
static const SimpleDate = static const SimpleDate =
NoteFileNameFormat("SimpleDate", "yyyy-mm-dd-hh-mm-ss"); NoteFileNameFormat("SimpleDate", 'settings.NoteFileNameFormat.simmple');
static const UuidV4 = NoteFileNameFormat("uuidv4", "Uuid V4"); static const UuidV4 =
static const Zettelkasten = NoteFileNameFormat("uuidv4", 'settings.NoteFileNameFormat.uuid');
NoteFileNameFormat("Zettelkasten", "yyyymmddhhmmss"); static const Zettelkasten = NoteFileNameFormat(
"Zettelkasten", 'settings.NoteFileNameFormat.zettelkasten');
static const Default = FromTitle; static const Default = FromTitle;
@ -384,7 +388,7 @@ class NoteFileNameFormat {
} }
String toPublicString() { String toPublicString() {
return _publicStr; return tr(_publicStr);
} }
@override @override
@ -444,10 +448,13 @@ class RemoteSyncFrequency {
} }
class SettingsEditorType { class SettingsEditorType {
static const Markdown = SettingsEditorType("Markdown", "Markdown"); static const Markdown =
static const Raw = SettingsEditorType("Raw", "Raw"); SettingsEditorType('settings.editors.markdownEditor', "Markdown");
static const Journal = SettingsEditorType("Journal", "Journal"); static const Raw = SettingsEditorType('settings.editors.rawEditor', "Raw");
static const Checklist = SettingsEditorType("Checklist", "Checklist"); static const Journal =
SettingsEditorType('settings.editors.journalEditor', "Journal");
static const Checklist =
SettingsEditorType('settings.editors.checklistEditor', "Checklist");
static const Default = Markdown; static const Default = Markdown;
final String _str; final String _str;
@ -459,7 +466,7 @@ class SettingsEditorType {
} }
String toPublicString() { String toPublicString() {
return _publicString; return tr(_publicString);
} }
EditorType toEditorType() { EditorType toEditorType() {
@ -524,10 +531,14 @@ class SettingsEditorType {
} }
class SettingsFolderViewType { class SettingsFolderViewType {
static const Standard = SettingsFolderViewType("Standard", "Standard"); static const Standard =
static const Journal = SettingsFolderViewType("Journal", "Journal"); SettingsFolderViewType('widgets.FolderView.views.standard', "Standard");
static const Card = SettingsFolderViewType("Card", "Card"); static const Journal =
static const Grid = SettingsFolderViewType("Grid", "Grid"); SettingsFolderViewType('widgets.FolderView.views.journal', "Journal");
static const Card =
SettingsFolderViewType('widgets.FolderView.views.card', "Card");
static const Grid =
SettingsFolderViewType('widgets.FolderView.views.grid', "Grid");
static const Default = Standard; static const Default = Standard;
final String _str; final String _str;
@ -539,7 +550,7 @@ class SettingsFolderViewType {
} }
String toPublicString() { String toPublicString() {
return _publicString; return tr(_publicString);
} }
static const options = <SettingsFolderViewType>[ static const options = <SettingsFolderViewType>[
@ -604,20 +615,24 @@ class SettingsFolderViewType {
} }
class SettingsMarkdownDefaultView { class SettingsMarkdownDefaultView {
static const Edit = SettingsMarkdownDefaultView("Edit"); static const Edit =
static const View = SettingsMarkdownDefaultView("View"); SettingsMarkdownDefaultView('settings.EditorDefaultView.edit', "Edit");
static const LastUsed = SettingsMarkdownDefaultView("Last Used"); static const View =
SettingsMarkdownDefaultView('settings.EditorDefaultView.view', "View");
static const LastUsed = SettingsMarkdownDefaultView(
'settings.EditorDefaultView.lastUsed', "Last Used");
static const Default = LastUsed; static const Default = LastUsed;
final String _str; final String _str;
const SettingsMarkdownDefaultView(this._str); final String _publicStr;
const SettingsMarkdownDefaultView(this._publicStr, this._str);
String toInternalString() { String toInternalString() {
return _str; return _str;
} }
String toPublicString() { String toPublicString() {
return _str; return tr(_publicStr);
} }
static const options = <SettingsMarkdownDefaultView>[ static const options = <SettingsMarkdownDefaultView>[
@ -653,8 +668,10 @@ class SettingsMarkdownDefaultView {
} }
class SettingsHomeScreen { class SettingsHomeScreen {
static const AllNotes = SettingsHomeScreen("All Notes", "all_notes"); static const AllNotes =
static const AllFolders = SettingsHomeScreen("All Folders", "all_folders"); SettingsHomeScreen("settings.HomeScreen.allNotes", "all_notes");
static const AllFolders =
SettingsHomeScreen("settings.HomeScreen.allFolders", "all_folders");
static const Default = AllNotes; static const Default = AllNotes;
final String _str; final String _str;
@ -666,7 +683,7 @@ class SettingsHomeScreen {
} }
String toPublicString() { String toPublicString() {
return _publicString; return tr(_publicString);
} }
static const options = <SettingsHomeScreen>[ static const options = <SettingsHomeScreen>[