Externalize strings in usersettings page

This commit is contained in:
Eike Kettner
2021-04-04 21:57:34 +02:00
parent 594818499e
commit 9c1beb2240
38 changed files with 1145 additions and 446 deletions

View File

@ -0,0 +1,45 @@
module Messages.EmailSettingsFormComp exposing (..)
import Data.SSLType exposing (SSLType)
import Messages.SSLTypeData
type alias Texts =
{ sslTypeLabel : SSLType -> String
, name : String
, connectionPlaceholder : String
, connectionNameInfo : String
, smtpHost : String
, smtpHostPlaceholder : String
, smtpUser : String
, smtpUserPlaceholder : String
, smtpPassword : String
, smtpPasswordPlaceholder : String
, fromAddress : String
, fromAddressPlaceholder : String
, replyTo : String
, replyToPlaceholder : String
, ssl : String
, ignoreCertCheck : String
}
gb : Texts
gb =
{ sslTypeLabel = Messages.SSLTypeData.gb
, name = "Name"
, connectionPlaceholder = "Connection name, e.g. 'gmail.com'"
, connectionNameInfo = "The connection name must not contain whitespace or special characters."
, smtpHost = "SMTP Host"
, smtpHostPlaceholder = "SMTP host name, e.g. 'mail.gmail.com'"
, smtpUser = "SMTP User"
, smtpUserPlaceholder = "SMTP Username, e.g. 'your.name@gmail.com'"
, smtpPassword = "SMTP Password"
, smtpPasswordPlaceholder = "Password"
, fromAddress = "From Address"
, fromAddressPlaceholder = "Sender E-Mail address"
, replyTo = "Reply-To"
, replyToPlaceholder = "Optional reply-to E-Mail address"
, ssl = "SSL"
, ignoreCertCheck = "Ignore certificate check"
}

View File

@ -0,0 +1,28 @@
module Messages.EmailSettingsManageComp exposing (..)
import Messages.Basics
import Messages.EmailSettingsFormComp
import Messages.EmailSettingsTableComp
type alias Texts =
{ basics : Messages.Basics.Texts
, settingsForm : Messages.EmailSettingsFormComp.Texts
, settingsTable : Messages.EmailSettingsTableComp.Texts
, newSettings : String
, addNewSmtpSettings : String
, reallyDeleteConnection : String
, deleteThisEntry : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, settingsForm = Messages.EmailSettingsFormComp.gb
, settingsTable = Messages.EmailSettingsTableComp.gb
, newSettings = "New Settings"
, addNewSmtpSettings = "Add new SMTP settings"
, reallyDeleteConnection = "Really delete these connection?"
, deleteThisEntry = "Delete this connection"
}

View File

@ -0,0 +1,16 @@
module Messages.EmailSettingsTableComp exposing (..)
type alias Texts =
{ name : String
, hostPort : String
, from : String
}
gb : Texts
gb =
{ name = "Name"
, hostPort = "Host/Port"
, from = "From"
}

View File

@ -0,0 +1,41 @@
module Messages.ImapSettingsFormComp exposing (..)
import Data.SSLType exposing (SSLType)
import Messages.SSLTypeData
type alias Texts =
{ sslTypeLabel : SSLType -> String
, name : String
, connectionNamePlaceholder : String
, connectionNameInfo : String
, imapHost : String
, imapHostPlaceholder : String
, imapUser : String
, imapUserPlaceholder : String
, imapPassword : String
, imapPasswordPlaceholder : String
, ssl : String
, ignoreCertCheck : String
, enableOAuth2 : String
, oauth2Info : String
}
gb : Texts
gb =
{ sslTypeLabel = Messages.SSLTypeData.gb
, name = "Name"
, connectionNamePlaceholder = "Connection name, e.g. 'gmail.com'"
, connectionNameInfo = "The connection name must not contain whitespace or special characters."
, imapHost = "IMAP Host"
, imapHostPlaceholder = "IMAP host name, e.g. 'mail.gmail.com'"
, imapUser = "IMAP User"
, imapUserPlaceholder = "IMAP Username, e.g. 'your.name@gmail.com'"
, imapPassword = "IMAP Password"
, imapPasswordPlaceholder = "Password"
, ssl = "SSL"
, ignoreCertCheck = "Ignore certificate check"
, enableOAuth2 = "Enable OAuth2 authentication"
, oauth2Info = "Enabling this, allows to connect via XOAuth using the password as access token."
}

View File

@ -0,0 +1,28 @@
module Messages.ImapSettingsManageComp exposing (..)
import Messages.Basics
import Messages.ImapSettingsFormComp
import Messages.ImapSettingsTableComp
type alias Texts =
{ basics : Messages.Basics.Texts
, imapForm : Messages.ImapSettingsFormComp.Texts
, imapTable : Messages.ImapSettingsTableComp.Texts
, addNewImapSettings : String
, newSettings : String
, reallyDeleteSettings : String
, deleteThisEntry : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, imapForm = Messages.ImapSettingsFormComp.gb
, imapTable = Messages.ImapSettingsTableComp.gb
, addNewImapSettings = "Add new IMAP settings"
, newSettings = "New Settings"
, reallyDeleteSettings = "Really delete this mail-box connection?"
, deleteThisEntry = "Delete this settings entry"
}

View File

@ -0,0 +1,14 @@
module Messages.ImapSettingsTableComp exposing (..)
type alias Texts =
{ name : String
, hostPort : String
}
gb : Texts
gb =
{ name = "Name"
, hostPort = "Host/Port"
}

View File

@ -0,0 +1,62 @@
module Messages.NotificationFormComp exposing (..)
import Messages.Basics
type alias Texts =
{ basics : Messages.Basics.Texts
, reallyDeleteTask : String
, startOnce : String
, startTaskNow : String
, selectConnection : String
, deleteThisTask : String
, enableDisable : String
, summary : String
, summaryInfo : String
, sendVia : String
, sendViaInfo : String
, recipients : String
, recipientsInfo : String
, tagsInclude : String
, tagsIncludeInfo : String
, tagsExclude : String
, tagsExcludeInfo : String
, remindDaysInfo : String
, capOverdue : String
, capOverdueInfo : String
, schedule : String
, scheduleClickForHelp : String
, scheduleInfo : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, reallyDeleteTask = "Really delete this notification task?"
, startOnce = "Start Once"
, startTaskNow = "Start this task now"
, selectConnection = "Select connection..."
, deleteThisTask = "Delete this task"
, enableDisable = "Enable or disable this task."
, summary = "Summary"
, summaryInfo = "Some human readable name, only for displaying"
, sendVia = "Send via"
, sendViaInfo = "The SMTP connection to use when sending notification mails."
, recipients = "Recipient(s)"
, recipientsInfo = "One or more mail addresses, confirm each by pressing 'Return'."
, tagsInclude = "Tags Include (and)"
, tagsIncludeInfo = "Items must have all the tags specified here."
, tagsExclude = "Tags Exclude (or)"
, tagsExcludeInfo = "Items must not have any tag specified here."
, remindDaysInfo = "Select items with a due date *lower than* `today+remindDays`"
, capOverdue = "Cap overdue items"
, capOverdueInfo = "If checked, only items with a due date *greater than* `today - remindDays` are considered."
, schedule = "Schedule"
, scheduleClickForHelp = "Click here for help"
, scheduleInfo =
"Specify how often and when this task should run. "
++ "Use English 3-letter weekdays. Either a single value, "
++ "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) "
++ "is allowed for each part."
}

View File

@ -0,0 +1,24 @@
module Messages.NotificationManageComp exposing (..)
import Messages.Basics
import Messages.NotificationFormComp
import Messages.NotificationTableComp
type alias Texts =
{ basics : Messages.Basics.Texts
, notificationForm : Messages.NotificationFormComp.Texts
, notificationTable : Messages.NotificationTableComp.Texts
, newTask : String
, createNewTask : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, notificationForm = Messages.NotificationFormComp.gb
, notificationTable = Messages.NotificationTableComp.gb
, newTask = "New Task"
, createNewTask = "Create a new notification task"
}

View File

@ -0,0 +1,18 @@
module Messages.NotificationTableComp exposing (..)
type alias Texts =
{ summary : String
, schedule : String
, connection : String
, recipients : String
}
gb : Texts
gb =
{ summary = "Summary"
, schedule = "Schedule"
, connection = "Connection"
, recipients = "Recipients"
}

View File

@ -0,0 +1,16 @@
module Messages.SSLTypeData exposing (..)
import Data.SSLType exposing (SSLType(..))
gb : SSLType -> String
gb st =
case st of
None ->
"None"
SSL ->
"SSL/TLS"
StartTLS ->
"StartTLS"

View File

@ -0,0 +1,133 @@
module Messages.ScanMailboxFormComp exposing (..)
import Messages.Basics
type alias Texts =
{ basics : Messages.Basics.Texts
, reallyDeleteTask : String
, startOnce : String
, startNow : String
, deleteThisTask : String
, generalTab : String
, processingTab : String
, additionalFilterTab : String
, postProcessingTab : String
, metadataTab : String
, scheduleTab : String
, processingTabInfo : String
, additionalFilterTabInfo : String
, postProcessingTabInfo : String
, metadataTabInfo : String
, scheduleTabInfo : String
, selectConnection : String
, enableDisable : String
, mailbox : String
, summary : String
, summaryInfo : String
, connectionInfo : String
, folders : String
, foldersInfo : String
, receivedHoursInfo : String
, fileFilter : String
, fileFilterInfo : String
, subjectFilter : String
, subjectFilterInfo : String
, postProcessingLabel : String
, postProcessingInfo : String
, targetFolder : String
, targetFolderInfo : String
, deleteMailLabel : String
, deleteMailInfo : String
, itemDirection : String
, automatic : String
, itemDirectionInfo : String
, itemFolder : String
, itemFolderInfo : String
, folderOwnerWarning : String
, tagsInfo : String
, documentLanguage : String
, documentLanguageInfo : String
, schedule : String
, scheduleClickForHelp : String
, scheduleInfo : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, reallyDeleteTask = "Really delete this scan mailbox task?"
, startOnce = "Start Once"
, startNow = "Start this task now"
, deleteThisTask = "Delete this task"
, generalTab = "General"
, processingTab = "Processing"
, additionalFilterTab = "Additional Filter"
, postProcessingTab = "Post Processing"
, metadataTab = "Metadata"
, scheduleTab = "Schedule"
, processingTabInfo = "These settings define which mails are fetched from the mail server."
, additionalFilterTabInfo = "These filters are applied to mails that have been fetched from the mailbox to select those that should be imported."
, postProcessingTabInfo = "This defines what happens to mails that have been downloaded."
, metadataTabInfo = "Define metadata that should be attached to all items created by this task."
, scheduleTabInfo = "Define when mails should be imported."
, selectConnection = "Select connection..."
, enableDisable = "Enable or disable this task."
, mailbox = "Mailbox"
, summary = "Summary"
, summaryInfo = "Some human readable name, only for displaying"
, connectionInfo = "The IMAP connection to use when sending notification mails."
, folders = "Folders"
, foldersInfo = "The folders to look for mails."
, receivedHoursInfo = "Select mails newer than `now - receivedHours`"
, fileFilter = "File Filter"
, fileFilterInfo =
"Specify a file glob to filter attachments. For example, to only extract pdf files: "
++ "`*.pdf`. If you want to include the mail body, allow html files or "
++ "`mail.html`. Globs can be combined via OR, like this: "
++ "`*.pdf|mail.html`. No file filter defaults to "
++ "`*` that includes all"
, subjectFilter = "Subject Filter"
, subjectFilterInfo =
"Specify a file glob to filter mails by subject. For example: "
++ "`*Scanned Document*`. No file filter defaults to `*` that includes all."
, postProcessingLabel = "Apply post-processing to all fetched mails."
, postProcessingInfo =
"When mails are fetched but not imported due to the 'Additional Filters', this flag can "
++ "control whether they should be moved to a target folder or deleted (whatever is "
++ "defined here) nevertheless. If unchecked only imported mails "
++ "are post-processed, others stay where they are."
, targetFolder = "Target folder"
, targetFolderInfo = "Move mails into this folder."
, deleteMailLabel = "Delete imported mails"
, deleteMailInfo =
"Whether to delete all mails fetched by docspell. This only applies if "
++ "*target folder* is not set."
, itemDirection = "Item direction"
, automatic = "Automatic"
, itemDirectionInfo =
"Sets the direction for an item. If you know all mails are incoming or "
++ "outgoing, you can set it here. Otherwise it will be guessed from looking "
++ "at sender and receiver."
, itemFolder = "Item Folder"
, itemFolderInfo = "Put all items from this mailbox into the selected folder"
, folderOwnerWarning = """
You are **not a member** of this folder. Items created from mails in
this mailbox will be **hidden** from any search results. Use a folder
where you are a member of to make items visible. This message will
disappear then.
"""
, tagsInfo = "Choose tags that should be applied to items."
, documentLanguage = "Language"
, documentLanguageInfo =
"Used for text extraction and text analysis. The "
++ "collective's default language is used, if not specified here."
, schedule = "Schedule"
, scheduleClickForHelp = "Click here for help"
, scheduleInfo =
"Specify how often and when this task should run. "
++ "Use English 3-letter weekdays. Either a single value, "
++ "a list (ex. 1,2,3), a range (ex. 1..3) or a '*' (meaning all) "
++ "is allowed for each part."
}

View File

@ -0,0 +1,24 @@
module Messages.ScanMailboxManageComp exposing (..)
import Messages.Basics
import Messages.ScanMailboxFormComp
import Messages.ScanMailboxTableComp
type alias Texts =
{ basics : Messages.Basics.Texts
, form : Messages.ScanMailboxFormComp.Texts
, table : Messages.ScanMailboxTableComp.Texts
, newTask : String
, createNewTask : String
}
gb : Texts
gb =
{ basics = Messages.Basics.gb
, form = Messages.ScanMailboxFormComp.gb
, table = Messages.ScanMailboxTableComp.gb
, newTask = "New Task"
, createNewTask = "Create a new scan mailbox task"
}

View File

@ -0,0 +1,18 @@
module Messages.ScanMailboxTableComp exposing (..)
type alias Texts =
{ summary : String
, connection : String
, folders : String
, receivedSince : String
}
gb : Texts
gb =
{ summary = "Summary"
, connection = "Connection"
, folders = "Folders"
, receivedSince = "Received Since"
}

View File

@ -1,12 +1,20 @@
module Messages.UserSettingsPage exposing (..)
import Messages.ChangePasswordFormComp
import Messages.EmailSettingsManageComp
import Messages.ImapSettingsManageComp
import Messages.NotificationManageComp
import Messages.ScanMailboxManageComp
import Messages.UiSettingsManageComp
type alias Texts =
{ changePasswordForm : Messages.ChangePasswordFormComp.Texts
, uiSettingsManage : Messages.UiSettingsManageComp.Texts
, emailSettingsManage : Messages.EmailSettingsManageComp.Texts
, imapSettingsManage : Messages.ImapSettingsManageComp.Texts
, notificationManage : Messages.NotificationManageComp.Texts
, scanMailboxManage : Messages.ScanMailboxManageComp.Texts
, userSettings : String
, uiSettings : String
, notifications : String
@ -15,6 +23,10 @@ type alias Texts =
, emailSettingImap : String
, changePassword : String
, uiSettingsInfo : String
, notificationInfoText : String
, notificationRemindDaysInfo : String
, scanMailboxInfo1 : String
, scanMailboxInfo2 : String
}
@ -22,6 +34,10 @@ gb : Texts
gb =
{ changePasswordForm = Messages.ChangePasswordFormComp.gb
, uiSettingsManage = Messages.UiSettingsManageComp.gb
, emailSettingsManage = Messages.EmailSettingsManageComp.gb
, imapSettingsManage = Messages.ImapSettingsManageComp.gb
, notificationManage = Messages.NotificationManageComp.gb
, scanMailboxManage = Messages.ScanMailboxManageComp.gb
, userSettings = "User Settings"
, uiSettings = "UI Settings"
, notifications = "Notifications"
@ -32,6 +48,27 @@ gb =
, uiSettingsInfo =
"These settings only affect the web ui. They are stored in the browser, "
++ "so they are separated between browsers and devices."
, notificationInfoText =
"""
Docspell can notify you once the due dates of your items
come closer. Notification is done via e-mail. You need to
provide a connection in your e-mail settings."""
, notificationRemindDaysInfo =
"Docspell finds all items that are due in *Remind Days* days and sends this list via e-mail."
, scanMailboxInfo1 =
"Docspell can scan folders of your mailbox to import your mails. "
++ "You need to provide a connection in "
++ "your e-mail (imap) settings."
, scanMailboxInfo2 =
"""
Docspell goes through all configured folders and imports
mails matching the search criteria. Mails are skipped if
they were imported in a previous run and the corresponding
items still exist. After submitting a mail into docspell,
you can choose to move it to another folder, to delete it
or to just leave it there. In the latter case you should
adjust the schedule to avoid reading over the same mails
again."""
}