Externalize strings in manage-data page

This commit is contained in:
Eike Kettner
2021-04-04 15:55:49 +02:00
parent 8f1380fcf5
commit 594818499e
57 changed files with 1078 additions and 379 deletions

View File

@@ -22,6 +22,7 @@ import Data.UiSettings exposing (UiSettings)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
import Messages.PersonFormComp exposing (Texts)
import Styles as S
@@ -178,14 +179,19 @@ update flags msg model =
--- View2
view2 : Bool -> UiSettings -> Model -> Html Msg
view2 mobile settings model =
view2 : Texts -> Bool -> UiSettings -> Model -> Html Msg
view2 texts mobile settings model =
let
personUseCfg =
{ display = Data.PersonUse.label
{ display = texts.personUseLabel
, icon = \_ -> Nothing
, style = DS.mainStyle
}
contactCfg =
{ mobile = mobile
, contactTypeLabel = texts.contactTypeLabel
}
in
div [ class "flex flex-col" ]
[ div
@@ -195,13 +201,13 @@ view2 mobile settings model =
[ class S.inputLabel
, for "personname"
]
[ text "Name"
[ text texts.name
, B.inputRequired
]
, input
[ type_ "text"
, onInput SetName
, placeholder "Name"
, placeholder texts.name
, value model.name
, class S.textInput
, classList
@@ -215,53 +221,58 @@ view2 mobile settings model =
[ label
[ class S.inputLabel
]
[ text "Use of this person" ]
[ text texts.useOfPerson
]
, Html.map UseDropdownMsg
(Comp.FixedDropdown.viewStyled2 personUseCfg False (Just model.use) model.useModel)
, span [ class "opacity-50 text-sm" ]
[ case model.use of
Data.PersonUse.Concerning ->
text "Use as concerning person only"
text texts.useAsConcerningOnly
Data.PersonUse.Correspondent ->
text "Use as correspondent person only"
text texts.useAsCorrespondentOnly
Data.PersonUse.Both ->
text "Use as both concerning or correspondent person"
text texts.useAsBoth
Data.PersonUse.Disabled ->
text "Do not use for suggestions."
text texts.dontUseForSuggestions
]
]
, div [ class "mb-4" ]
[ label
[ class S.inputLabel
]
[ text "Organization"
[ text texts.organization
]
, Html.map OrgDropdownMsg
(Comp.Dropdown.view2
(Comp.Dropdown.orgFormViewSettings DS.mainStyle)
(Comp.Dropdown.orgFormViewSettings texts.chooseAnOrg DS.mainStyle)
settings
model.orgModel
)
]
, div [ class "mb-4" ]
[ h3 [ class "ui dividing header" ]
[ text "Address"
[ text texts.address
]
, Html.map AddressMsg (Comp.AddressForm.view2 settings model.addressModel)
, Html.map AddressMsg
(Comp.AddressForm.view2 texts.addressForm
settings
model.addressModel
)
]
, div [ class "mb-4" ]
[ h3 [ class S.header3 ]
[ text "Contacts"
[ text texts.contacts
]
, Html.map ContactMsg
(Comp.ContactField.view2 mobile settings model.contactModel)
(Comp.ContactField.view2 contactCfg settings model.contactModel)
]
, div [ class "mb-4" ]
[ h3 [ class S.header3 ]
[ text "Notes"
[ text texts.notes
]
, div [ class "" ]
[ textarea