Merge pull request #756 from eikek/doc-updates

Doc updates
This commit is contained in:
mergify[bot] 2021-04-11 15:51:03 +00:00 committed by GitHub
commit bbda4e84d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 521 additions and 192 deletions

View File

@ -186,7 +186,10 @@ langMenu model =
, span [ class "ml-2" ] [ text langMsg.label ]
]
in
div [ class "relative" ]
div
[ class "relative"
, classList [ ( "hidden", List.length Messages.UiLanguage.all == 1 ) ]
]
[ a
[ class dropdownLink
, onClick ToggleLangMenu

View File

@ -46,9 +46,6 @@ get lang =
English ->
gb
German ->
de
{-| Get a ISO-3166-1 code of the given lanugage.
-}
@ -103,23 +100,3 @@ gb =
, manageData = Messages.Page.ManageData.gb
, home = Messages.Page.Home.gb
}
de : Messages
de =
{ lang = German
, iso2 = "de"
, label = "Deutsch"
, flagIcon = "flag-icon flag-icon-de"
, app = Messages.App.de
, collectiveSettings = Messages.Page.CollectiveSettings.de
, login = Messages.Page.Login.de
, register = Messages.Page.Register.de
, newInvite = Messages.Page.NewInvite.de
, upload = Messages.Page.Upload.de
, itemDetail = Messages.Page.ItemDetail.de
, queue = Messages.Page.Queue.de
, userSettings = Messages.Page.UserSettings.de
, manageData = Messages.Page.ManageData.de
, home = Messages.Page.Home.de
}

View File

@ -1,6 +1,5 @@
module Messages.App exposing
( Texts
, de
, gb
)
@ -34,16 +33,17 @@ gb =
}
de : Texts
de =
{ collectiveProfile = "Kollektiv-Profil"
, userProfile = "Benutzer-Profil"
, lightDark = "Hell/Dunkel"
, logout = "Abmelden"
, items = "Dokumente"
, manageData = "Daten verwalten"
, uploadFiles = "Dateien hochladen"
, processingQueue = "Verarbeitung"
, newInvites = "Neue Einladung"
, help = "Hilfe (English)"
}
-- de : Texts
-- de =
-- { collectiveProfile = "Kollektiv-Profil"
-- , userProfile = "Benutzer-Profil"
-- , lightDark = "Hell/Dunkel"
-- , logout = "Abmelden"
-- , items = "Dokumente"
-- , manageData = "Daten verwalten"
-- , uploadFiles = "Dateien hochladen"
-- , processingQueue = "Verarbeitung"
-- , newInvites = "Neue Einladung"
-- , help = "Hilfe (English)"
-- }

View File

@ -1,4 +1,4 @@
module Messages.Basics exposing (..)
module Messages.Basics exposing (Texts, gb)
type alias Texts =
@ -66,8 +66,3 @@ gb =
, customFields = "Custom Fields"
, direction = "Direction"
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Comp.AddressForm exposing (..)
module Messages.Comp.AddressForm exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.AttachmentMeta exposing (..)
module Messages.Comp.AttachmentMeta exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.CalEventInput exposing (..)
module Messages.Comp.CalEventInput exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.ChangePasswordForm exposing (..)
module Messages.Comp.ChangePasswordForm exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ClassifierSettingsForm exposing (..)
module Messages.Comp.ClassifierSettingsForm exposing (Texts, gb)
import Messages.Comp.CalEventInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.CollectiveSettingsForm exposing (..)
module Messages.Comp.CollectiveSettingsForm exposing (Texts, gb)
import Data.Language exposing (Language)
import Messages.Comp.ClassifierSettingsForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.CustomFieldForm exposing (..)
module Messages.Comp.CustomFieldForm exposing (Texts, gb)
import Data.CustomFieldType exposing (CustomFieldType)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.CustomFieldInput exposing (..)
module Messages.Comp.CustomFieldInput exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.CustomFieldManage exposing (..)
module Messages.Comp.CustomFieldManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.CustomFieldMultiInput exposing (..)
module Messages.Comp.CustomFieldMultiInput exposing (Texts, gb)
import Messages.Comp.CustomFieldInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.CustomFieldTable exposing (..)
module Messages.Comp.CustomFieldTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.DetailEdit exposing (..)
module Messages.Comp.DetailEdit exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.Dropzone exposing (..)
module Messages.Comp.Dropzone exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.EmailSettingsForm exposing (..)
module Messages.Comp.EmailSettingsForm exposing (Texts, gb)
import Data.SSLType exposing (SSLType)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.EmailSettingsManage exposing (..)
module Messages.Comp.EmailSettingsManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.EmailSettingsForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.EmailSettingsTable exposing (..)
module Messages.Comp.EmailSettingsTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.EquipmentForm exposing (..)
module Messages.Comp.EquipmentForm exposing (Texts, gb)
import Data.EquipmentUse exposing (EquipmentUse)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.EquipmentManage exposing (..)
module Messages.Comp.EquipmentManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.EquipmentForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.EquipmentTable exposing (..)
module Messages.Comp.EquipmentTable exposing (Texts, gb)
import Data.EquipmentUse exposing (EquipmentUse)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.FolderDetail exposing (..)
module Messages.Comp.FolderDetail exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.FolderManage exposing (..)
module Messages.Comp.FolderManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.FolderDetail

View File

@ -1,4 +1,4 @@
module Messages.Comp.FolderTable exposing (..)
module Messages.Comp.FolderTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ImapSettingsForm exposing (..)
module Messages.Comp.ImapSettingsForm exposing (Texts, gb)
import Data.SSLType exposing (SSLType)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ImapSettingsManage exposing (..)
module Messages.Comp.ImapSettingsManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.ImapSettingsForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.ImapSettingsTable exposing (..)
module Messages.Comp.ImapSettingsTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemCard exposing (..)
module Messages.Comp.ItemCard exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemCardList exposing (..)
module Messages.Comp.ItemCardList exposing (Texts, gb)
import Messages.Comp.ItemCard

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail exposing (..)
module Messages.Comp.ItemDetail exposing (Texts, gb)
import Messages.Comp.DetailEdit
import Messages.Comp.ItemDetail.AddFilesForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.AddFilesForm exposing (..)
module Messages.Comp.ItemDetail.AddFilesForm exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.Dropzone

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.EditForm exposing (..)
module Messages.Comp.ItemDetail.EditForm exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldMultiInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.ItemInfoHeader exposing (..)
module Messages.Comp.ItemDetail.ItemInfoHeader exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.MultiEditMenu exposing (..)
module Messages.Comp.ItemDetail.MultiEditMenu exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldMultiInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.Notes exposing (..)
module Messages.Comp.ItemDetail.Notes exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemDetail.SingleAttachment exposing (..)
module Messages.Comp.ItemDetail.SingleAttachment exposing (Texts, gb)
import Messages.Comp.AttachmentMeta

View File

@ -1,4 +1,4 @@
module Messages.Comp.ItemMail exposing (..)
module Messages.Comp.ItemMail exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.NotificationForm exposing (..)
module Messages.Comp.NotificationForm exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CalEventInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.NotificationManage exposing (..)
module Messages.Comp.NotificationManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.NotificationForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.NotificationTable exposing (..)
module Messages.Comp.NotificationTable exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.OrgForm exposing (..)
module Messages.Comp.OrgForm exposing (Texts, gb)
import Data.ContactType exposing (ContactType)
import Data.OrgUse exposing (OrgUse)

View File

@ -1,4 +1,4 @@
module Messages.Comp.OrgManage exposing (..)
module Messages.Comp.OrgManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.OrgForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.OrgTable exposing (..)
module Messages.Comp.OrgTable exposing (Texts, gb)
import Data.OrgUse exposing (OrgUse)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.PersonForm exposing (..)
module Messages.Comp.PersonForm exposing (Texts, gb)
import Data.ContactType exposing (ContactType)
import Data.PersonUse exposing (PersonUse)

View File

@ -1,4 +1,4 @@
module Messages.Comp.PersonManage exposing (..)
module Messages.Comp.PersonManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.PersonForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.PersonTable exposing (..)
module Messages.Comp.PersonTable exposing (Texts, gb)
import Data.PersonUse exposing (PersonUse)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.ScanMailboxForm exposing (..)
module Messages.Comp.ScanMailboxForm exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CalEventInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.ScanMailboxManage exposing (..)
module Messages.Comp.ScanMailboxManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.ScanMailboxForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.ScanMailboxTable exposing (..)
module Messages.Comp.ScanMailboxTable exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.SearchMenu exposing (..)
module Messages.Comp.SearchMenu exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldMultiInput

View File

@ -1,4 +1,4 @@
module Messages.Comp.SearchStatsView exposing (..)
module Messages.Comp.SearchStatsView exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.SentMails exposing (..)
module Messages.Comp.SentMails exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.SourceForm exposing (..)
module Messages.Comp.SourceForm exposing (Texts, gb)
import Data.Language exposing (Language)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.SourceManage exposing (..)
module Messages.Comp.SourceManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.SourceForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.SourceTable exposing (..)
module Messages.Comp.SourceTable exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.TagForm exposing (..)
module Messages.Comp.TagForm exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.TagManage exposing (..)
module Messages.Comp.TagManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.TagForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.TagSelect exposing (..)
module Messages.Comp.TagSelect exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.TagTable exposing (..)
module Messages.Comp.TagTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Comp.UiSettingsForm exposing (..)
module Messages.Comp.UiSettingsForm exposing (Texts, gb)
import Data.Color exposing (Color)
import Data.Fields exposing (Field)

View File

@ -1,4 +1,4 @@
module Messages.Comp.UiSettingsManage exposing (..)
module Messages.Comp.UiSettingsManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.UiSettingsForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.UserForm exposing (..)
module Messages.Comp.UserForm exposing (Texts, gb)
type alias Texts =

View File

@ -1,4 +1,4 @@
module Messages.Comp.UserManage exposing (..)
module Messages.Comp.UserManage exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.UserForm

View File

@ -1,4 +1,4 @@
module Messages.Comp.UserTable exposing (..)
module Messages.Comp.UserTable exposing (Texts, gb)
import Messages.Basics

View File

@ -1,4 +1,4 @@
module Messages.Data.Color exposing (..)
module Messages.Data.Color exposing (gb)
import Data.Color exposing (Color(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.ContactType exposing (..)
module Messages.Data.ContactType exposing (gb)
import Data.ContactType exposing (ContactType(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.CustomFieldType exposing (..)
module Messages.Data.CustomFieldType exposing (gb)
import Data.CustomFieldType exposing (CustomFieldType(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.EquipmentUse exposing (..)
module Messages.Data.EquipmentUse exposing (gb)
import Data.EquipmentUse exposing (EquipmentUse(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.Fields exposing (..)
module Messages.Data.Fields exposing (gb)
import Data.Fields exposing (Field(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.Language exposing (..)
module Messages.Data.Language exposing (gb)
import Data.Language exposing (Language(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.OrgUse exposing (..)
module Messages.Data.OrgUse exposing (gb)
import Data.OrgUse exposing (OrgUse(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.PersonUse exposing (..)
module Messages.Data.PersonUse exposing (gb)
import Data.PersonUse exposing (PersonUse(..))

View File

@ -1,4 +1,4 @@
module Messages.Data.SSLType exposing (..)
module Messages.Data.SSLType exposing (gb)
import Data.SSLType exposing (SSLType(..))

View File

@ -1,4 +1,4 @@
module Messages.Page.CollectiveSettings exposing (..)
module Messages.Page.CollectiveSettings exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CollectiveSettingsForm
@ -37,8 +37,3 @@ gb =
, collective = "Collective"
, size = "Size"
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.Home exposing (..)
module Messages.Page.Home exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.ItemCardList
@ -51,8 +51,3 @@ gb =
, resetSearchForm = "Reset search form"
, exitSelectMode = "Exit Select Mode"
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.HomeSideMenu exposing (..)
module Messages.Page.HomeSideMenu exposing (Texts, gb)
import Messages.Comp.ItemDetail.MultiEditMenu
import Messages.Comp.SearchMenu

View File

@ -1,4 +1,4 @@
module Messages.Page.ItemDetail exposing (..)
module Messages.Page.ItemDetail exposing (Texts, gb)
import Messages.Comp.ItemDetail
import Messages.Comp.ItemDetail.EditForm
@ -19,8 +19,3 @@ gb =
, editMetadata = "Edit Metadata"
, collapseExpand = "Collapse/Expand"
}
de : Texts
de =
gb

View File

@ -1,8 +1,4 @@
module Messages.Page.Login exposing
( Texts
, de
, gb
)
module Messages.Page.Login exposing (Texts, gb)
type alias Texts =
@ -36,17 +32,18 @@ gb =
}
de : Texts
de =
{ loginToDocspell = "Docspell Anmeldung"
, username = "Benutzer"
, collectiveSlashLogin = "Kollektiv / Benutzer"
, password = "Passwort"
, rememberMe = "Anmeldung speichern"
, loginPlaceholder = "Benutzer"
, passwordPlaceholder = "Passwort"
, loginButton = "Anmelden"
, loginSuccessful = "Anmeldung erfolgreich"
, noAccount = "Kein Konto?"
, signupLink = "Hier registrieren!"
}
-- de : Texts
-- de =
-- { loginToDocspell = "Docspell Anmeldung"
-- , username = "Benutzer"
-- , collectiveSlashLogin = "Kollektiv / Benutzer"
-- , password = "Passwort"
-- , rememberMe = "Anmeldung speichern"
-- , loginPlaceholder = "Benutzer"
-- , passwordPlaceholder = "Passwort"
-- , loginButton = "Anmelden"
-- , loginSuccessful = "Anmeldung erfolgreich"
-- , noAccount = "Kein Konto?"
-- , signupLink = "Hier registrieren!"
-- }

View File

@ -1,4 +1,4 @@
module Messages.Page.ManageData exposing (..)
module Messages.Page.ManageData exposing (Texts, gb)
import Messages.Basics
import Messages.Comp.CustomFieldManage
@ -32,8 +32,3 @@ gb =
, customFieldManage = Messages.Comp.CustomFieldManage.gb
, manageData = "Manage Data"
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.NewInvite exposing (..)
module Messages.Page.NewInvite exposing (Texts, gb)
import Messages.Basics
@ -31,8 +31,3 @@ gb =
Creating an invite requires providing the password
from the configuration."""
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.Queue exposing (..)
module Messages.Page.Queue exposing (Texts, gb)
import Messages.Basics
@ -48,8 +48,3 @@ gb =
, changePriority = "Change priority of this job"
, prio = "Prio"
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.Register exposing (..)
module Messages.Page.Register exposing (Texts, gb)
import Messages.Basics
@ -34,8 +34,3 @@ gb =
, signIn = "Sign in"
, registrationSuccessful = "Registration successful."
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.Upload exposing (..)
module Messages.Page.Upload exposing (Texts, gb)
import Data.Language exposing (Language)
import Messages.Basics
@ -59,8 +59,3 @@ gb =
, selectedFiles = "Selected Files"
, languageLabel = Messages.Data.Language.gb
}
de : Texts
de =
gb

View File

@ -1,4 +1,4 @@
module Messages.Page.UserSettings exposing (..)
module Messages.Page.UserSettings exposing (Texts, gb)
import Messages.Comp.ChangePasswordForm
import Messages.Comp.EmailSettingsManage
@ -70,8 +70,3 @@ gb =
adjust the schedule to avoid reading over the same mails
again."""
}
de : Texts
de =
gb

View File

@ -9,11 +9,9 @@ module Messages.UiLanguage exposing
type UiLanguage
= English
| German
all : List UiLanguage
all =
[ English
, German
]

View File

@ -4,7 +4,9 @@ weight = 0
+++
You must install [sbt](https://scala-sbt.org) and [Elm](https://elm-lang.org).
You must install [sbt](https://scala-sbt.org),
[nodejs](https://www.npmjs.com/get-npm) (for the `npm` command) and
[Elm](https://elm-lang.org).
Clone the sources and run:

View File

@ -0,0 +1,402 @@
+++
title = "Translating Web-UI"
weight = 10
+++
Help with translating the web-ui is greatly appreciated. I can only
provide translations for English and German, and these may be wrong -
so pointing out mistakes is also appreciated :).
Here is a detailed walkthrough for adding a new language. It requires
to code in [Elm](https://elm-lang.org). But even if you're not a
programmer, you will be comfortable as it's not difficult for this
task. Elm is also a nice and friendly language, provding helpful error
messages.
This guide assumes no knowledge about Elm at all.
# TL;DR
If you are already familiar with Elm, here is the TL;DR:
1. Goto `Messages.UiLanguage` in `modules/webapp/src/main/elm` and add
another language to the union type and also to the `all` list.
2. Fix all compile errors by providing a different `Texts` value for
the new language.
# Prepare
You need to install [git](https://git-scm.org),
[sbt](https://scala-sbt.org), [Elm](https://elm-lang.org) and
[nodejs](https://www.npmjs.com/get-npm) (for the `npm` command) to
compile and run the project.
It is also recommended to install `elm-format` as it will help you to
format the elm source code. Look
[here](https://github.com/avh4/elm-format) for how to install it with
your editor of choice.
## Checkout the source code
Note: These steps are only required to do once. If you come back to
translating, just start the application.
Use git to clone the docspell repository to your machine. In a
terminal type:
``` bash
git clone https://github.com/eikek/docspell.git
Cloning into 'docspell'...
remote: Enumerating objects: 1861, done.
remote: Counting objects: 100% (1861/1861), done.
remote: Compressing objects: 100% (861/861), done.
remote: Total 30276 (delta 821), reused 1604 (delta 668), pack-reused 28415
Receiving objects: 100% (30276/30276), 60.89 MiB | 23.62 MiB/s, done.
Resolving deltas: 100% (14658/14658), done.
/tmp took 4s
```
This creates a new directory `docspell`. Change into it, create a
`DOCSPELL_ENV` environment variable and run sbt:
``` bash
cd docspell
docspell on  master via 🌳 v0.19.1 via ☕ v11.0.9 via ⬢ v12.21.0
export DOCSPELL_ENV=dev
sbt
[info] welcome to sbt 1.5.0 (Oracle Corporation Java 1.8.0_212)
[info] loading settings for project global-plugins from plugins.sbt ...
[info] loading settings for project docspell-build from plugins.sbt ...
[info] loading project definition from /tmp/docspell/project
[info] compiling 6 Scala sources to /tmp/docspell/project/target/scala-2.12/sbt-1.0/classes ...
[info] loading settings for project root from build.sbt,version.sbt ...
[info] resolving key references (24191 settings) ...
[info] set current project to docspell-root (in build file:/tmp/docspell/)
[info] sbt server started at local:///home/eike/.sbt/1.0/server/3cf61b9ad9af43ee6032/sock
[info] started sbt server
sbt:docspell-root>
```
This downloads some stuff and puts you in the sbt shell. Now compile
everything (only needed the first time after checkout):
``` sbt
sbt:docspell-root> make
```
This will take a while, you need to wait until this is finished.
## Start the application
If sbt is not started, start sbt from within the source root. Also
export the `DOCSPELL_ENV` variable *before* starting sbt:
``` bash
> export DOCSPELL_ENV=dev
> sbt
```
Then start the application:
``` sbt
sbt:docspell-root> reStart
```
This starts docspell (joex and the restserver). Once the output gets a
bit quiter, open a browser and navigate to `http://localhost:7880`.
You can create a new account (if not already done so) and login.
Note that the database is created in your `/tmp` directory, so it
might be cleared once you restart your machine. For translating this
should not be a problem.
## Make webui updates faster
The sbt build tool could be used to watch the elm sources and
re-compile everything on change. This however also restarts the server
and takes quite long. When only coding on the webui the server can be
just left as is. Only the new compiled webapp must be made available
to the running server. For this, a script is provided in the
`project/` folder.
Now open another terminal and `cd` into the docspell folder as before
and run the following:
``` bash
./project/dev-ui-build.sh watch
Compile elm to js …
Success!
Main ───> /tmp/docspell/modules/webapp/target/scala-2.13/classes/META-INF/resources/webjars/docspell-webapp/0.22.0-SNAPSHOT/docspell-app.js
Building css …
/tmp/docspell
Watching css and elm sources. C-c to quit.
Setting up watches. Beware: since -r was given, this may take a while!
Watches established.
```
Once you see this, you're all set. The docspell application is running
and changes to elm files are detected, the webapp is compiled and the
resulting javascript file is copied to the correct location. To see
your changes, a refresh in the browser is necessary.
If this script is not working, install inotify-tools. The
`inotifywait` command is required.
You'll notice that compiling elm files is very fast!
## Find the webapp sources
The web-ui is implemented in the `webapp` module. The sources can be
found in the folder `modules/webapp/src/main/elm`.
All translated strings are in the files below `Messages` directory.
You should start with the file `UiLanguage.elm` to add a new language
to the list. Then start with `App.elm` to provide transalations. See
below for details.
# Example: Add German
## Add the new language
Start by editing `UiLanguage.elm` and add another language to the
list:
``` elm
type UiLanguage
= English
| German
```
More languaes are simply appended using the `|` symbol. Use the
English name here, because this is source code.
Also add it to the list of all languages below. Simply add the new
language separated by a comma `,`.
``` elm
all : List UiLanguage
all =
[ English
, German
]
```
If you make a mistake, the elm compiler will tell you with usually
quite helpful messages. Now, after adding this, there will be errors
when compiling the elm files. You should see something like this:
```
Detected problems in 1 module.
-- MISSING PATTERNS ------------------- modules/webapp/src/main/elm/Messages.elm
This `case` does not have branches for all possibilities:
45|> case lang of
46|> English ->
47|> gb
Missing possibilities include:
German
I would have to crash if I saw one of those. Add branches for them!
Hint: If you want to write the code for each branch later, use `Debug.todo` as a
placeholder. Read <https://elm-lang.org/0.19.1/missing-patterns> for more
guidance on this workflow.
```
So around line 45 in `Messages.elm` there is something wrong. This is
the place where a record of all strings is returned given some
lanugage. Currently, there is only one set of strings for English.
Open this file, you see at the and a value of name `gb` for English.
Copy it to another name, `de` for this example (it's good practice to
stick to the two letter country code).
``` elm
de : Messages
de =
{ lang = German
, iso2 = "de"
, label = "Deutsch"
, flagIcon = "flag-icon flag-icon-de"
, app = Messages.App.gb
, collectiveSettings = Messages.Page.CollectiveSettings.gb
, login = Messages.Page.Login.gb
, register = Messages.Page.Register.gb
, newInvite = Messages.Page.NewInvite.gb
, upload = Messages.Page.Upload.gb
, itemDetail = Messages.Page.ItemDetail.gb
, queue = Messages.Page.Queue.gb
, userSettings = Messages.Page.UserSettings.gb
, manageData = Messages.Page.ManageData.gb
, home = Messages.Page.Home.gb
}
```
Change `lang`, `iso2`, `label` and `flagIcon` appropriately. For the
`label` use the native language name (not English), as this is the
label shown to users when selecting a language. The flag icon can be
copied and only the last two letters need to be changed to the country
code. You may look [here](https://github.com/lipis/flag-icon-css) for
additional information.
Now the error can be fixed. Go to line 45 and add another branch to
the `case` expression:
``` elm
get : UiLanguage -> Messages
get lang =
case lang of
English ->
gb
German ->
de
```
This makes the compiler happy again. If you refresh the browser, you
should see the new language in the dropdown menu. You can already
choose the new language, but nothing happens in the application. Of
course, we just copied the English strings for now. So now begins the
translation process.
## Translating
Now translation can begin. If you look at the newly created value
`de`, you'll see some entries in the record. Each corresponds to a
page: `login` is for the login page, `home` for the "home page" etc;
and `app` is for the top menu.
Take one of them and start translating. For the example, I use the
first one which is `Messages.App`. The file to this is
`Messages/App.em`. You can always replace the dots with slashes to
find a file to an elm module. Open this file and you'll see again a
`gb` value at the end. Copy it to `de` and start translating:
``` elm
de : Texts
de =
{ collectiveProfile = "Kollektiv-Profil"
, userProfile = "Benutzer-Profil"
, lightDark = "Hell/Dunkel"
, logout = "Abmelden"
, items = "Dokumente"
, manageData = "Daten verwalten"
, uploadFiles = "Dateien hochladen"
, processingQueue = "Verarbeitung"
, newInvites = "Neue Einladung"
, help = "Hilfe (English)"
}
```
Then go to the beginning of the file and add the new `de` value to the
list of "exposed" values. This is necessary so it can be used from
within the `Messages.elm` module.
``` elm
module Messages.App exposing
( Texts
, de {- the new value -}
, gb
)
```
Now you can go back to `Messages.elm` and exchange `Messages.App.gb`
with `Messages.App.de`.
``` elm
de : Messages
de =
{ lang = German
, iso2 = "de"
, label = "Deutsch"
, flagIcon = "flag-icon flag-icon-de"
, app = Messages.App.de
, collectiveSettings = Messages.Page.CollectiveSettings.gb
, login = Messages.Page.Login.gb
, register = Messages.Page.Register.gb
, newInvite = Messages.Page.NewInvite.gb
, upload = Messages.Page.Upload.gb
, itemDetail = Messages.Page.ItemDetail.gb
, queue = Messages.Page.Queue.gb
, userSettings = Messages.Page.UserSettings.gb
, manageData = Messages.Page.ManageData.gb
, home = Messages.Page.Home.gb
}
```
If you refresh the browser, you should now see the new values. Then
take the next entry and start over. It happens that some files contain
other string-sets of certain components. Then just follow this guide
recursively.
# Publishing
You can publish your work to this repo in various ways:
## Github PR
This is the preferred way, because it means less work for me :). If
you have a github account, you can create a pull request. Here is a
quick walk-through. There is a thorough help [at
github](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests).
1. Fork this repository in the github webapp
2. Go to the docspell source root you checked out in the terminal. Run:
```
git remote rename origin upstream
git remote add origin git@github.com:<your-github-name>/docspell.git
git fetch --all
```
3. Create a new git branch:
```
git checkout -b translate origin/master
```
4. Make a commit of your changes:
```
git config user.name "Your Name"
git config user.email "Your Email" #(note that this email will be publicly viewable! a dummy address is fine, too)
git commit -am 'Add translation for German'
```
Modify the message to your needs.
5. Push the change to your fork:
```
git push origin translate
```
6. Go to the github webapp and create a pull request from your branch.
## E-Mail
You can send me the patch via e-mail. You can use `git send-email` or
your favorite e-mail client. For this do step 4 from above and then:
```
git bundle create translation.bundle origin/master..HEAD
```
Then send the created `translate.bundle` file. If this command doesn't
work, try:
```
git format-patch origin/master..HEAD
```
This results in one or more `0001-…` files that you can send.
## Any other
Contact me by mail or create an issue.