From 0df59ececa8290520f97881b60d889e091b8329e Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 10 Oct 2022 17:11:06 +0200 Subject: [PATCH 01/21] [DSW-1526] Add consistency checking before publishing KM --- .../elm/Shared/Data/KnowledgeModel/Expert.elm | 11 +- .../Data/KnowledgeModel/Integration.elm | 12 +- .../Shared/Data/KnowledgeModel/Reference.elm | 4 +- .../Reference/URLReferenceData.elm | 10 + .../DefaultQuestionnaireRenderer.elm | 18 +- .../Common/Provisioning/DefaultLocale.elm | 25 + .../KMEditor/Editor/Common/EditorBranch.elm | 684 +++++++++++++----- .../KMEditor/Editor/Components/KMEditor.elm | 63 +- .../Editor/Components/KMEditor/Tree.elm | 4 +- .../elm/Wizard/KMEditor/Editor/Update.elm | 6 +- .../elm/Wizard/KMEditor/Editor/View.elm | 2 - .../modules/KMEditor/Editor/_KMEditor.scss | 36 + 12 files changed, 668 insertions(+), 207 deletions(-) diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel/Expert.elm b/engine-shared/elm/Shared/Data/KnowledgeModel/Expert.elm index 934596a51..2c4b2653d 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel/Expert.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel/Expert.elm @@ -1,4 +1,4 @@ -module Shared.Data.KnowledgeModel.Expert exposing (Expert, decoder) +module Shared.Data.KnowledgeModel.Expert exposing (Expert, decoder, getVisibleName) import Json.Decode as D exposing (Decoder) import Json.Decode.Pipeline as D @@ -20,3 +20,12 @@ decoder = |> D.required "name" D.string |> D.required "email" D.string |> D.required "annotations" (D.list Annotation.decoder) + + +getVisibleName : Expert -> String +getVisibleName expert = + if String.isEmpty expert.name then + expert.email + + else + expert.name diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm b/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm index e2713b419..454700d97 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm @@ -82,8 +82,16 @@ getId = getName : Integration -> String -getName = - .name << getCommonIntegrationData +getName integration = + let + name = + (getCommonIntegrationData integration).name + in + if String.isEmpty name then + getId integration + + else + name getProps : Integration -> List String diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel/Reference.elm b/engine-shared/elm/Shared/Data/KnowledgeModel/Reference.elm index 4fdd6e20e..7543999d6 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel/Reference.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel/Reference.elm @@ -85,7 +85,7 @@ getUuid = getVisibleName : Reference -> String getVisibleName = - map .shortUuid .label .targetUuid + map .shortUuid URLReferenceData.toLabel .targetUuid getAnnotations : Reference -> List Annotation @@ -105,7 +105,7 @@ getUrl = getLabel : Reference -> Maybe String getLabel = - map (always Nothing) (Just << .label) (always Nothing) + map (always Nothing) (Just << URLReferenceData.toLabel) (always Nothing) getTargetUuid : Reference -> Maybe String diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel/Reference/URLReferenceData.elm b/engine-shared/elm/Shared/Data/KnowledgeModel/Reference/URLReferenceData.elm index 7c048f4fc..601fef5f7 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel/Reference/URLReferenceData.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel/Reference/URLReferenceData.elm @@ -1,6 +1,7 @@ module Shared.Data.KnowledgeModel.Reference.URLReferenceData exposing ( URLReferenceData , decoder + , toLabel ) import Json.Decode as D exposing (Decoder) @@ -23,3 +24,12 @@ decoder = |> D.required "url" D.string |> D.required "label" D.string |> D.required "annotations" (D.list Annotation.decoder) + + +toLabel : URLReferenceData -> String +toLabel data = + if String.isEmpty data.label then + data.url + + else + data.label diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm index 14f2187d3..0c1d370e8 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm @@ -256,9 +256,15 @@ viewExperts appState = viewExpert : Expert -> Html msg viewExpert expert = - span [] - [ text expert.name - , text " (" - , a [ href <| "mailto:" ++ expert.email ] [ text expert.email ] - , text ")" - ] + if String.isEmpty expert.name then + span [] + [ a [ href <| "mailto:" ++ expert.email ] [ text expert.email ] + ] + + else + span [] + [ text expert.name + , text " (" + , a [ href <| "mailto:" ++ expert.email ] [ text expert.email ] + , text ")" + ] diff --git a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm index 41c18b775..4b0afa64e 100644 --- a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm +++ b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm @@ -704,6 +704,29 @@ locale = , ( "Wizard.KMEditor.Common.UpgradeModal.text", "Select the new parent knowledge model for %s." ) , ( "Wizard.KMEditor.Common.UpgradeModal.title", "Create migration" ) , ( "Wizard.KMEditor.Common.UpgradeModal.action", "Create" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.answerEmptyLabel", "Empty label for answer" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.chapterTitleEmpty", "Empty title for chapter" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.choiceEmptyLabel", "Empty label for choice" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.expertEmptyEmail", "Empty email for expert" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.expertInvalidEmail", "Invalid email for expert" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyId", "Empty ID for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyItemUrl", "Empty item URL for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyRequestHttpMethod", "Empty request HTTP method for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyRequestUrl", "Empty request URL for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyResponseItemID", "Empty response item ID for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyResponseItemTemplate", "Empty response item template for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyWidgetUrl", "Empty widget URL for integration" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.metricEmptyTitle", "Empty title for metric" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.phaseEmptyTitle", "Empty title for phase" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyAnswers", "No answers for options question" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyChoices", "No choices for multi-choice question" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyIntegration", "No integration selected for integration question" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyItemQuestions", "No item questions for list question" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionTitleEmpty", "Empty title for question" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceEmptyShortUuid", "Empty short UUID for page reference" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceEmptyUrl", "Empty URL for URL reference" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceInvalidUrl", "Invalid URL for URL reference" ) + , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.tagEmptyName", "Empty name for tag" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.annotations.add", "Add" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.headers.add", "Add" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.markdown.editor", "Editor" ) @@ -759,6 +782,7 @@ locale = , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.label", "Select a new parent" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.move", "Move" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.cancel", "Cancel" ) + , ( "Wizard.KMEditor.Editor.Components.KMEditor.navbar.warnings", "Warnings" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addAnswer", "Add answer" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addChoice", "Add choice" ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addExpert", "Add expert" ) @@ -770,6 +794,7 @@ locale = , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.options", "Changing a question type will remove all answers." ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.list", "Changing a question type will remove all item questions." ) , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.multichoice", "Changing a question type will remove all choices." ) + , ( "Wizard.KMEditor.Editor.Components.KMEditor.warnings.empty", "There are no more warnings." ) , ( "Wizard.KMEditor.Editor.Components.Preview.tags.selectAll", "Select all" ) , ( "Wizard.KMEditor.Editor.Components.Preview.tags.selectNone", "Select none" ) , ( "Wizard.KMEditor.Editor.Components.TagEditor.noTags", "There are no question tags, create them first." ) diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm index ade11142f..7377b7bfe 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm @@ -1,5 +1,6 @@ module Wizard.KMEditor.Editor.Common.EditorBranch exposing ( EditorBranch + , EditorBranchWarning , applyEvent , filterDeleted , filterDeletedWith @@ -25,6 +26,7 @@ module Wizard.KMEditor.Editor.Common.EditorBranch exposing import Dict import List.Extra as List import Maybe.Extra as Maybe +import Regex import Set exposing (Set) import Shared.Data.BranchDetail exposing (BranchDetail) import Shared.Data.Event exposing (Event(..)) @@ -52,16 +54,29 @@ import Shared.Data.Event.EditReferenceEventData as EditReferenceEventData import Shared.Data.Event.EditTagEventData as EditTagEventData import Shared.Data.Event.MoveEventData exposing (MoveEventData) import Shared.Data.KnowledgeModel as KnowledgeModel exposing (KnowledgeModel) -import Shared.Data.KnowledgeModel.Integration as Integration +import Shared.Data.KnowledgeModel.Answer exposing (Answer) +import Shared.Data.KnowledgeModel.Chapter exposing (Chapter) +import Shared.Data.KnowledgeModel.Choice exposing (Choice) +import Shared.Data.KnowledgeModel.Expert as Expert exposing (Expert) +import Shared.Data.KnowledgeModel.Integration as Integration exposing (Integration) +import Shared.Data.KnowledgeModel.Metric exposing (Metric) +import Shared.Data.KnowledgeModel.Phase exposing (Phase) import Shared.Data.KnowledgeModel.Question as Question exposing (Question(..)) -import Shared.Data.KnowledgeModel.Reference as Reference -import Shared.Locale exposing (lg) +import Shared.Data.KnowledgeModel.Reference as Reference exposing (Reference) +import Shared.Data.KnowledgeModel.Tag exposing (Tag) +import Shared.Locale exposing (l, lg) +import Shared.RegexPatterns as RegexPatterns import Shared.Utils exposing (flip) import String.Extra as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) +l_ : String -> AppState -> String +l_ = + l "Wizard.KMEditor.Editor.Common.EditorBranch" + + type alias EditorBranch = { branch : BranchDetail , parentMap : KnowledgeModel.ParentMap @@ -71,11 +86,18 @@ type alias EditorBranch = , editedUuids : List String , deletedUuids : List String , emptyIntegrationEditorUuids : Set String + , warnings : List EditorBranchWarning + } + + +type alias EditorBranchWarning = + { editorUuid : String + , message : String } -init : BranchDetail -> Maybe Uuid -> EditorBranch -init branch mbEditorUuid = +init : AppState -> BranchDetail -> Maybe Uuid -> EditorBranch +init appState branch mbEditorUuid = let kmUuid = Uuid.toString branch.knowledgeModel.uuid @@ -89,10 +111,12 @@ init branch mbEditorUuid = , editedUuids = [] , deletedUuids = [] , emptyIntegrationEditorUuids = Set.empty + , warnings = [] } in - setActiveEditor (Maybe.map Uuid.toString mbEditorUuid) <| - List.foldl (applyEvent False) editorBranch editorBranch.branch.events + List.foldl (applyEvent appState False) editorBranch editorBranch.branch.events + |> setActiveEditor (Maybe.map Uuid.toString mbEditorUuid) + |> computeWarnings appState getEditUuid : String -> EditorBranch -> Maybe Uuid @@ -247,7 +271,7 @@ getEditorName appState uuid editorBranch = getEditorName_ (String.withDefault (lg "reference.untitled" appState) << Reference.getVisibleName) KnowledgeModel.getReference getExpertName = - getEditorName_ (String.withDefault (lg "expert.untitled" appState) << .name) KnowledgeModel.getExpert + getEditorName_ (String.withDefault (lg "expert.untitled" appState) << Expert.getVisibleName) KnowledgeModel.getExpert in getKnowledgeModelName |> Maybe.orElse getChapterName @@ -438,8 +462,8 @@ isEmptyIntegrationEditorUuid uuid editorBranch = Set.member uuid editorBranch.emptyIntegrationEditorUuids -applyEvent : Bool -> Event -> EditorBranch -> EditorBranch -applyEvent local event originalEditorBranch = +applyEvent : AppState -> Bool -> Event -> EditorBranch -> EditorBranch +applyEvent appState local event originalEditorBranch = let branch = originalEditorBranch.branch @@ -450,218 +474,219 @@ applyEvent local event originalEditorBranch = editorBranch = { originalEditorBranch | branch = { branch | events = branch.events ++ [ event ] } } in - case event of - AddKnowledgeModelEvent _ _ -> - editorBranch + computeWarnings appState <| + case event of + AddKnowledgeModelEvent _ _ -> + editorBranch - AddAnswerEvent eventData commonData -> - let - answer = - AddAnswerEventData.toAnswer commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertAnswer answer commonData editorBranch + AddAnswerEvent eventData commonData -> + let + answer = + AddAnswerEventData.toAnswer commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertAnswer answer commonData editorBranch - AddChapterEvent eventData commonData -> - let - chapter = - AddChapterEventData.toChapter commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertChapter chapter commonData editorBranch + AddChapterEvent eventData commonData -> + let + chapter = + AddChapterEventData.toChapter commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertChapter chapter commonData editorBranch - AddChoiceEvent eventData commonData -> - let - choice = - AddChoiceEventData.toChoice commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertChoice choice commonData editorBranch + AddChoiceEvent eventData commonData -> + let + choice = + AddChoiceEventData.toChoice commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertChoice choice commonData editorBranch - AddExpertEvent eventData commonData -> - let - expert = - AddExpertEventData.toExpert commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertExpert expert commonData editorBranch + AddExpertEvent eventData commonData -> + let + expert = + AddExpertEventData.toExpert commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertExpert expert commonData editorBranch - AddIntegrationEvent eventData commonData -> - let - integration = - AddIntegrationEventData.toIntegration commonData.entityUuid eventData + AddIntegrationEvent eventData commonData -> + let + integration = + AddIntegrationEventData.toIntegration commonData.entityUuid eventData - updatedEditorBranch = - addEmptyIntegrationEditorUuid (Integration.getUuid integration) editorBranch - in - applyAdd local KnowledgeModel.insertIntegration integration commonData updatedEditorBranch + updatedEditorBranch = + addEmptyIntegrationEditorUuid (Integration.getUuid integration) editorBranch + in + applyAdd local KnowledgeModel.insertIntegration integration commonData updatedEditorBranch - AddMetricEvent eventData commonData -> - let - metric = - AddMetricEventData.toMetric commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertMetric metric commonData editorBranch + AddMetricEvent eventData commonData -> + let + metric = + AddMetricEventData.toMetric commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertMetric metric commonData editorBranch - AddPhaseEvent eventData commonData -> - let - phase = - AddPhaseEventData.toPhase commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertPhase phase commonData editorBranch + AddPhaseEvent eventData commonData -> + let + phase = + AddPhaseEventData.toPhase commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertPhase phase commonData editorBranch - AddQuestionEvent eventData commonData -> - let - question = - AddQuestionEventData.toQuestion commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertQuestion question commonData editorBranch + AddQuestionEvent eventData commonData -> + let + question = + AddQuestionEventData.toQuestion commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertQuestion question commonData editorBranch - AddReferenceEvent eventData commonData -> - let - reference = - AddReferenceEventData.toReference commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertReference reference commonData editorBranch + AddReferenceEvent eventData commonData -> + let + reference = + AddReferenceEventData.toReference commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertReference reference commonData editorBranch - AddTagEvent eventData commonData -> - let - tag = - AddTagEventData.toTag commonData.entityUuid eventData - in - applyAdd local KnowledgeModel.insertTag tag commonData editorBranch + AddTagEvent eventData commonData -> + let + tag = + AddTagEventData.toTag commonData.entityUuid eventData + in + applyAdd local KnowledgeModel.insertTag tag commonData editorBranch - EditAnswerEvent eventData commonData -> - let - mbAnswer = - KnowledgeModel.getAnswer commonData.entityUuid knowledgeModel - |> Maybe.map (EditAnswerEventData.apply eventData) - in - applyEdit KnowledgeModel.updateAnswer mbAnswer commonData editorBranch + EditAnswerEvent eventData commonData -> + let + mbAnswer = + KnowledgeModel.getAnswer commonData.entityUuid knowledgeModel + |> Maybe.map (EditAnswerEventData.apply eventData) + in + applyEdit KnowledgeModel.updateAnswer mbAnswer commonData editorBranch - EditChapterEvent eventData commonData -> - let - mbChapter = - KnowledgeModel.getChapter commonData.entityUuid knowledgeModel - |> Maybe.map (EditChapterEventData.apply eventData) - in - applyEdit KnowledgeModel.updateChapter mbChapter commonData editorBranch + EditChapterEvent eventData commonData -> + let + mbChapter = + KnowledgeModel.getChapter commonData.entityUuid knowledgeModel + |> Maybe.map (EditChapterEventData.apply eventData) + in + applyEdit KnowledgeModel.updateChapter mbChapter commonData editorBranch - EditChoiceEvent eventData commonData -> - let - mbChoice = - KnowledgeModel.getChoice commonData.entityUuid knowledgeModel - |> Maybe.map (EditChoiceEventData.apply eventData) - in - applyEdit KnowledgeModel.updateChoice mbChoice commonData editorBranch + EditChoiceEvent eventData commonData -> + let + mbChoice = + KnowledgeModel.getChoice commonData.entityUuid knowledgeModel + |> Maybe.map (EditChoiceEventData.apply eventData) + in + applyEdit KnowledgeModel.updateChoice mbChoice commonData editorBranch - EditExpertEvent eventData commonData -> - let - mbExpert = - KnowledgeModel.getExpert commonData.entityUuid knowledgeModel - |> Maybe.map (EditExpertEventData.apply eventData) - in - applyEdit KnowledgeModel.updateExpert mbExpert commonData editorBranch + EditExpertEvent eventData commonData -> + let + mbExpert = + KnowledgeModel.getExpert commonData.entityUuid knowledgeModel + |> Maybe.map (EditExpertEventData.apply eventData) + in + applyEdit KnowledgeModel.updateExpert mbExpert commonData editorBranch - EditIntegrationEvent eventData commonData -> - let - mbIntegration = - KnowledgeModel.getIntegration commonData.entityUuid knowledgeModel - |> Maybe.map (EditIntegrationEvent.apply eventData) + EditIntegrationEvent eventData commonData -> + let + mbIntegration = + KnowledgeModel.getIntegration commonData.entityUuid knowledgeModel + |> Maybe.map (EditIntegrationEvent.apply eventData) - updatedEditorBranch = - removeEmptyIntegrationEditorUuid (Maybe.unwrap "" Integration.getUuid mbIntegration) editorBranch - in - applyEdit KnowledgeModel.updateIntegration mbIntegration commonData updatedEditorBranch + updatedEditorBranch = + removeEmptyIntegrationEditorUuid (Maybe.unwrap "" Integration.getUuid mbIntegration) editorBranch + in + applyEdit KnowledgeModel.updateIntegration mbIntegration commonData updatedEditorBranch - EditKnowledgeModelEvent eventData _ -> - let - newKnowledgeModel = - EditKnowledgeModelEventData.apply eventData knowledgeModel - in - setKnowledgeModel newKnowledgeModel editorBranch - |> setEdited (Uuid.toString knowledgeModel.uuid) + EditKnowledgeModelEvent eventData _ -> + let + newKnowledgeModel = + EditKnowledgeModelEventData.apply eventData knowledgeModel + in + setKnowledgeModel newKnowledgeModel editorBranch + |> setEdited (Uuid.toString knowledgeModel.uuid) - EditMetricEvent eventData commonData -> - let - mbMetric = - KnowledgeModel.getMetric commonData.entityUuid knowledgeModel - |> Maybe.map (EditMetricEventData.apply eventData) - in - applyEdit KnowledgeModel.updateMetric mbMetric commonData editorBranch + EditMetricEvent eventData commonData -> + let + mbMetric = + KnowledgeModel.getMetric commonData.entityUuid knowledgeModel + |> Maybe.map (EditMetricEventData.apply eventData) + in + applyEdit KnowledgeModel.updateMetric mbMetric commonData editorBranch - EditPhaseEvent eventData commonData -> - let - mbPhase = - KnowledgeModel.getPhase commonData.entityUuid knowledgeModel - |> Maybe.map (EditPhaseEventData.apply eventData) - in - applyEdit KnowledgeModel.updatePhase mbPhase commonData editorBranch + EditPhaseEvent eventData commonData -> + let + mbPhase = + KnowledgeModel.getPhase commonData.entityUuid knowledgeModel + |> Maybe.map (EditPhaseEventData.apply eventData) + in + applyEdit KnowledgeModel.updatePhase mbPhase commonData editorBranch - EditQuestionEvent eventData commonData -> - let - mbQuestion = - KnowledgeModel.getQuestion commonData.entityUuid knowledgeModel - |> Maybe.map (EditQuestionEventData.apply eventData) - in - applyEdit KnowledgeModel.updateQuestion mbQuestion commonData editorBranch + EditQuestionEvent eventData commonData -> + let + mbQuestion = + KnowledgeModel.getQuestion commonData.entityUuid knowledgeModel + |> Maybe.map (EditQuestionEventData.apply eventData) + in + applyEdit KnowledgeModel.updateQuestion mbQuestion commonData editorBranch - EditReferenceEvent eventData commonData -> - let - mbReference = - KnowledgeModel.getReference commonData.entityUuid knowledgeModel - |> Maybe.map (EditReferenceEventData.apply eventData) - in - applyEdit KnowledgeModel.updateReference mbReference commonData editorBranch + EditReferenceEvent eventData commonData -> + let + mbReference = + KnowledgeModel.getReference commonData.entityUuid knowledgeModel + |> Maybe.map (EditReferenceEventData.apply eventData) + in + applyEdit KnowledgeModel.updateReference mbReference commonData editorBranch - EditTagEvent eventData commonData -> - let - mbTag = - KnowledgeModel.getTag commonData.entityUuid knowledgeModel - |> Maybe.map (EditTagEventData.apply eventData) - in - applyEdit KnowledgeModel.updateTag mbTag commonData editorBranch + EditTagEvent eventData commonData -> + let + mbTag = + KnowledgeModel.getTag commonData.entityUuid knowledgeModel + |> Maybe.map (EditTagEventData.apply eventData) + in + applyEdit KnowledgeModel.updateTag mbTag commonData editorBranch - DeleteAnswerEvent commonData -> - applyDelete commonData editorBranch + DeleteAnswerEvent commonData -> + applyDelete commonData editorBranch - DeleteChapterEvent commonData -> - applyDelete commonData editorBranch + DeleteChapterEvent commonData -> + applyDelete commonData editorBranch - DeleteChoiceEvent commonData -> - applyDelete commonData editorBranch + DeleteChoiceEvent commonData -> + applyDelete commonData editorBranch - DeleteExpertEvent commonData -> - applyDelete commonData editorBranch + DeleteExpertEvent commonData -> + applyDelete commonData editorBranch - DeleteIntegrationEvent commonData -> - applyDelete commonData editorBranch + DeleteIntegrationEvent commonData -> + applyDelete commonData editorBranch - DeleteMetricEvent commonData -> - applyDelete commonData editorBranch + DeleteMetricEvent commonData -> + applyDelete commonData editorBranch - DeletePhaseEvent commonData -> - applyDelete commonData editorBranch + DeletePhaseEvent commonData -> + applyDelete commonData editorBranch - DeleteReferenceEvent commonData -> - applyDelete commonData editorBranch + DeleteReferenceEvent commonData -> + applyDelete commonData editorBranch - DeleteQuestionEvent commonData -> - applyDelete commonData editorBranch + DeleteQuestionEvent commonData -> + applyDelete commonData editorBranch - DeleteTagEvent commonData -> - applyDelete commonData editorBranch + DeleteTagEvent commonData -> + applyDelete commonData editorBranch - MoveQuestionEvent moveData commonData -> - applyMove KnowledgeModel.moveQuestion KnowledgeModel.getQuestion commonData moveData editorBranch + MoveQuestionEvent moveData commonData -> + applyMove KnowledgeModel.moveQuestion KnowledgeModel.getQuestion commonData moveData editorBranch - MoveAnswerEvent moveData commonData -> - applyMove KnowledgeModel.moveAnswer KnowledgeModel.getAnswer commonData moveData editorBranch + MoveAnswerEvent moveData commonData -> + applyMove KnowledgeModel.moveAnswer KnowledgeModel.getAnswer commonData moveData editorBranch - MoveChoiceEvent moveData commonData -> - applyMove KnowledgeModel.moveChoice KnowledgeModel.getChoice commonData moveData editorBranch + MoveChoiceEvent moveData commonData -> + applyMove KnowledgeModel.moveChoice KnowledgeModel.getChoice commonData moveData editorBranch - MoveReferenceEvent moveData commonData -> - applyMove KnowledgeModel.moveReference KnowledgeModel.getReference commonData moveData editorBranch + MoveReferenceEvent moveData commonData -> + applyMove KnowledgeModel.moveReference KnowledgeModel.getReference commonData moveData editorBranch - MoveExpertEvent moveData commonData -> - applyMove KnowledgeModel.moveExpert KnowledgeModel.getExpert commonData moveData editorBranch + MoveExpertEvent moveData commonData -> + applyMove KnowledgeModel.moveExpert KnowledgeModel.getExpert commonData moveData editorBranch applyAdd : Bool -> (a -> String -> KnowledgeModel -> KnowledgeModel) -> a -> CommonEventData -> EditorBranch -> EditorBranch @@ -716,3 +741,294 @@ applyMove updateKm getEntity { entityUuid, parentUuid } { targetUuid } editorBra Nothing -> editorBranch + + +computeWarnings : AppState -> EditorBranch -> EditorBranch +computeWarnings appState editorBranch = + let + warnings = + List.concatMap (computeChapterWarnings appState (getFilteredKM editorBranch)) (KnowledgeModel.getChapters editorBranch.branch.knowledgeModel) + |> flip (++) (List.concatMap (computeMetricWarnings appState) (KnowledgeModel.getMetrics editorBranch.branch.knowledgeModel)) + |> flip (++) (List.concatMap (computePhaseWarnings appState) (KnowledgeModel.getPhases editorBranch.branch.knowledgeModel)) + |> flip (++) (List.concatMap (computeTagWarnings appState) (KnowledgeModel.getTags editorBranch.branch.knowledgeModel)) + |> flip (++) (List.concatMap (computeIntegrationWarnings appState) (KnowledgeModel.getIntegrations editorBranch.branch.knowledgeModel)) + in + { editorBranch | warnings = warnings } + + +computeChapterWarnings : AppState -> KnowledgeModel -> Chapter -> List EditorBranchWarning +computeChapterWarnings appState km chapter = + let + titleWarning = + if String.isEmpty chapter.title then + [ { editorUuid = chapter.uuid + , message = l_ "warning.chapterTitleEmpty" appState + } + ] + + else + [] + + questionWarnings = + List.concatMap + (computeQuestionWarnings appState km) + (KnowledgeModel.getChapterQuestions chapter.uuid km) + in + titleWarning ++ questionWarnings + + +computeQuestionWarnings : AppState -> KnowledgeModel -> Question -> List EditorBranchWarning +computeQuestionWarnings appState km question = + let + questionUuid = + Question.getUuid question + + createError message = + [ { editorUuid = questionUuid + , message = message + } + ] + + titleWarning = + if String.isEmpty (Question.getTitle question) then + createError (l_ "warning.questionTitleEmpty" appState) + + else + [] + + typeWarnings = + case question of + Question.OptionsQuestion _ data -> + if List.isEmpty data.answerUuids then + createError (l_ "warning.questionEmptyAnswers" appState) + + else + List.concatMap + (computeAnswerWarnings appState km) + (KnowledgeModel.getQuestionAnswers questionUuid km) + + Question.ListQuestion _ data -> + if List.isEmpty data.itemTemplateQuestionUuids then + createError (l_ "warning.questionEmptyItemQuestions" appState) + + else + List.concatMap + (computeQuestionWarnings appState km) + (KnowledgeModel.getQuestionItemTemplateQuestions questionUuid km) + + Question.IntegrationQuestion _ data -> + if data.integrationUuid == Uuid.toString Uuid.nil then + createError (l_ "warning.questionEmptyIntegration" appState) + + else + [] + + Question.MultiChoiceQuestion _ data -> + if List.isEmpty data.choiceUuids then + createError (l_ "warning.questionEmptyChoices" appState) + + else + List.concatMap + (computeChoiceWarnings appState) + (KnowledgeModel.getQuestionChoices questionUuid km) + + _ -> + [] + + referencesWarnings = + List.concatMap + (computeReferenceWarnings appState) + (KnowledgeModel.getQuestionReferences questionUuid km) + + expertWarnings = + List.concatMap + (computeExpertWarnings appState) + (KnowledgeModel.getQuestionExperts questionUuid km) + in + titleWarning ++ typeWarnings ++ referencesWarnings ++ expertWarnings + + +computeAnswerWarnings : AppState -> KnowledgeModel -> Answer -> List EditorBranchWarning +computeAnswerWarnings appState km answer = + let + labelWarning = + if String.isEmpty answer.label then + [ { editorUuid = answer.uuid + , message = l_ "warning.answerEmptyLabel" appState + } + ] + + else + [] + + followUpQuestionsWarnings = + List.concatMap + (computeQuestionWarnings appState km) + (KnowledgeModel.getAnswerFollowupQuestions answer.uuid km) + in + labelWarning ++ followUpQuestionsWarnings + + +computeChoiceWarnings : AppState -> Choice -> List EditorBranchWarning +computeChoiceWarnings appState choice = + if String.isEmpty choice.label then + [ { editorUuid = choice.uuid + , message = l_ "warning.choiceEmptyLabel" appState + } + ] + + else + [] + + +computeReferenceWarnings : AppState -> Reference -> List EditorBranchWarning +computeReferenceWarnings appState reference = + let + createError message = + [ { editorUuid = Reference.getUuid reference + , message = message + } + ] + in + case reference of + Reference.ResourcePageReference data -> + if String.isEmpty data.shortUuid then + createError (l_ "warning.referenceEmptyShortUuid" appState) + + else + [] + + Reference.URLReference data -> + if String.isEmpty data.url then + createError (l_ "warning.referenceEmptyUrl" appState) + + else if not (Regex.contains RegexPatterns.url data.url) then + createError (l_ "warning.referenceInvalidUrl" appState) + + else + [] + + _ -> + [] + + +computeExpertWarnings : AppState -> Expert -> List EditorBranchWarning +computeExpertWarnings appState expert = + let + createError message = + [ { editorUuid = expert.uuid + , message = message + } + ] + in + if String.isEmpty expert.email then + createError (l_ "warning.expertEmptyEmail" appState) + + else if not (Regex.contains RegexPatterns.email expert.email) then + createError (l_ "warning.expertInvalidEmail" appState) + + else + [] + + +computeMetricWarnings : AppState -> Metric -> List EditorBranchWarning +computeMetricWarnings appState metric = + if String.isEmpty metric.title then + [ { editorUuid = metric.uuid + , message = l_ "warning.metricEmptyTitle" appState + } + ] + + else + [] + + +computePhaseWarnings : AppState -> Phase -> List EditorBranchWarning +computePhaseWarnings appState phase = + if String.isEmpty phase.title then + [ { editorUuid = phase.uuid + , message = l_ "warning.phaseEmptyTitle" appState + } + ] + + else + [] + + +computeTagWarnings : AppState -> Tag -> List EditorBranchWarning +computeTagWarnings appState tag = + if String.isEmpty tag.name then + [ { editorUuid = tag.uuid + , message = l_ "warning.tagEmptyName" appState + } + ] + + else + [] + + +computeIntegrationWarnings : AppState -> Integration -> List EditorBranchWarning +computeIntegrationWarnings appState integration = + let + createError message = + [ { editorUuid = Integration.getUuid integration + , message = message + } + ] + + idWarning = + if String.isEmpty (Integration.getId integration) then + createError (l_ "warning.integrationEmptyId" appState) + + else + [] + + itemUrlWarning = + if String.isEmpty (Integration.getItemUrl integration) then + createError (l_ "warning.integrationEmptyItemUrl" appState) + + else + [] + + typeWarnings = + case integration of + Integration.ApiIntegration _ data -> + let + urlError = + if String.isEmpty data.requestUrl then + createError (l_ "warning.integrationEmptyRequestUrl" appState) + + else + [] + + requestMethod = + if String.isEmpty data.requestMethod then + createError (l_ "warning.integrationEmptyRequestHttpMethod" appState) + + else + [] + + responseItemId = + if String.isEmpty data.responseItemId then + createError (l_ "warning.integrationEmptyResponseItemID" appState) + + else + [] + + responseItemTemplate = + if String.isEmpty data.responseItemTemplate then + createError (l_ "warning.integrationEmptyResponseItemTemplate" appState) + + else + [] + in + urlError ++ requestMethod ++ responseItemId ++ responseItemTemplate + + Integration.WidgetIntegration _ data -> + if String.isEmpty data.widgetUrl then + createError (l_ "warning.integrationEmptyWidgetUrl" appState) + + else + [] + in + idWarning ++ typeWarnings ++ itemUrlWarning diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm index 35a77fffd..da80074ff 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm @@ -13,12 +13,13 @@ module Wizard.KMEditor.Editor.Components.KMEditor exposing import Dict exposing (Dict) import Html exposing (Html, a, button, div, h3, h5, i, img, label, li, small, span, strong, text, ul) -import Html.Attributes exposing (class, disabled, id, src) +import Html.Attributes exposing (class, classList, disabled, id, src) import Html.Events exposing (onClick) import Html.Keyed import Maybe.Extra as Maybe import Reorderable import Set +import Shared.Components.Badge as Badge import Shared.Copy as Copy import Shared.Data.Event exposing (Event(..)) import Shared.Data.Event.AddAnswerEventData as AddAnswerEventData @@ -108,6 +109,7 @@ type alias Model = , reorderableStates : Dict String Reorderable.State , deleteModalState : DeleteModalState , moveModalState : Maybe MoveModalState + , warningsPanelOpen : Bool } @@ -139,6 +141,7 @@ initialModel = , reorderableStates = Dict.empty , deleteModalState = Closed , moveModalState = Nothing + , warningsPanelOpen = False } @@ -164,6 +167,7 @@ type Msg | OpenMoveModal TreeInput.MovingEntity String | MoveModalMsg TreeInput.Msg | CloseMoveModal + | SetWarningPanelsOpen Bool update : (Bool -> msg) -> Msg -> Model -> EditorBranch -> ( EditorBranch, Model, Cmd msg ) @@ -239,6 +243,9 @@ update setFullscreenMsg msg model editorBranch = CloseMoveModal -> ( editorBranch, { model | moveModalState = Nothing }, Cmd.none ) + SetWarningPanelsOpen open -> + ( editorBranch, { model | warningsPanelOpen = open }, Cmd.none ) + -- SUBSCRIPTIONS @@ -293,21 +300,67 @@ view appState wrapMsg eventMsg model integrationPrefabs editorBranch = { toMsg = wrapMsg << SplitPaneMsg , customSplitter = Nothing } + + warningsCount = + List.length editorBranch.warnings + + warningsButton = + if warningsCount > 0 || model.warningsPanelOpen then + a + [ class "item" + , classList [ ( "selected", model.warningsPanelOpen ) ] + , onClick (wrapMsg (SetWarningPanelsOpen (not model.warningsPanelOpen))) + ] + [ lx_ "navbar.warnings" appState + , Badge.danger [ class "rounded-pill" ] [ text (String.fromInt warningsCount) ] + ] + + else + emptyNode + + warningsPanel = + if model.warningsPanelOpen then + Html.map wrapMsg <| + viewWarningsPanel appState editorBranch + + else + emptyNode in div [ class "KMEditor__Editor__KMEditor", dataCy "km-editor_km" ] [ div [ class "editor-breadcrumbs" ] [ Breadcrumbs.view appState editorBranch + , warningsButton , a [ class "breadcrumb-button", onClick expandMsg ] [ expandIcon ] ] - , SplitPane.view splitPaneConfig - (Tree.view treeViewProps appState editorBranch) - (viewEditor appState wrapMsg eventMsg model integrationPrefabs editorBranch) - model.splitPane + , div [ class "editor-body" ] + [ SplitPane.view splitPaneConfig + (Tree.view treeViewProps appState editorBranch) + (viewEditor appState wrapMsg eventMsg model integrationPrefabs editorBranch) + model.splitPane + , warningsPanel + ] , deleteModal appState wrapMsg eventMsg editorBranch model.deleteModalState , moveModal appState wrapMsg eventMsg editorBranch model.moveModalState ] +viewWarningsPanel : AppState -> EditorBranch -> Html Msg +viewWarningsPanel appState editorBranch = + let + viewWarning warning = + li [] [ linkTo appState (editorRoute editorBranch warning.editorUuid) [] [ text warning.message ] ] + + warnings = + if List.isEmpty editorBranch.warnings then + Flash.info appState (l_ "warnings.empty" appState) + + else + ul [] (List.map viewWarning editorBranch.warnings) + in + div [ class "right-panel" ] + [ warnings ] + + type alias EditorConfig msg = { appState : AppState , wrapMsg : Msg -> msg diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm index c89591f31..2c0de6f3d 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm @@ -10,7 +10,7 @@ import Shared.Data.KnowledgeModel as KnowledgeModel import Shared.Data.KnowledgeModel.Answer exposing (Answer) import Shared.Data.KnowledgeModel.Chapter exposing (Chapter) import Shared.Data.KnowledgeModel.Choice exposing (Choice) -import Shared.Data.KnowledgeModel.Expert exposing (Expert) +import Shared.Data.KnowledgeModel.Expert as Expert exposing (Expert) import Shared.Data.KnowledgeModel.Integration as Integration exposing (Integration) import Shared.Data.KnowledgeModel.Metric exposing (Metric) import Shared.Data.KnowledgeModel.Phase exposing (Phase) @@ -275,7 +275,7 @@ treeNodeExperts props appState editorBranch expert = config = { uuid = expert.uuid , icon = faSet "km.expert" appState - , label = expert.name + , label = Expert.getVisibleName expert , children = [] , untitledLabel = lg "expert.untitled" appState } diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm index 1db507651..1b6a30082 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm @@ -124,7 +124,7 @@ update wrapMsg msg appState model = fetchSubrouteDataFromAfter wrapMsg appState { model - | branchModel = Success (EditorBranch.init branch model.mbEditorUuid) + | branchModel = Success (EditorBranch.init appState branch model.mbEditorUuid) , settingsModel = Settings.setBranchDetail branch model.settingsModel } in @@ -249,7 +249,7 @@ update wrapMsg msg appState model = |> WebSocket.send model.websocket newBranchModel = - ActionResult.map (EditorBranch.applyEvent True event) model.branchModel + ActionResult.map (EditorBranch.applyEvent appState True event) model.branchModel setUnloadMessageCmd = Ports.setUnloadMessage (l_ "unloadMessage" appState) @@ -276,7 +276,7 @@ handleWebSocketMsg websocketMsg appState model = newModel2 = if not removed then - { newModel | branchModel = ActionResult.map (EditorBranch.applyEvent False eventData.event) newModel.branchModel } + { newModel | branchModel = ActionResult.map (EditorBranch.applyEvent appState False eventData.event) newModel.branchModel } else newModel diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm index f520c0a0b..47d22b8d5 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm @@ -152,8 +152,6 @@ viewKMEditorNavigationNav appState route editorBranch = branchUuid = editorBranch.branch.uuid - --editorRoute subroute = - -- Wizard.Routes.KMEditorRoute (KMEditorRoutes.EditorRoute editorBranch.branch.uuid subroute) isEditorRoute = case route of Edit _ -> diff --git a/engine-wizard/scss/modules/KMEditor/Editor/_KMEditor.scss b/engine-wizard/scss/modules/KMEditor/Editor/_KMEditor.scss index 9b7c466b1..34d7a23f7 100644 --- a/engine-wizard/scss/modules/KMEditor/Editor/_KMEditor.scss +++ b/engine-wizard/scss/modules/KMEditor/Editor/_KMEditor.scss @@ -51,6 +51,42 @@ $breadcrumbs-height: 40px; content: '〉'; padding: 0; } + + .item { + @include border-radius($border-radius); + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; + padding: 8px; + color: $gray-900 !important; + text-decoration: none !important; + display: flex; + align-items: center; + margin-right: 0.5rem; + + &:hover, &:focus { + background: $gray-200; + box-shadow: none; + } + + &.selected { + background: $primary-bg; + color: $primary !important; + } + + .badge { + margin-left: 0.5rem; + } + } + } + + .editor-body { + display: flex; + + .right-panel { + flex: 0 0 20rem; + overflow: auto; + padding: 1rem; + border-left: 1px solid $gray-400; + } } .tree-col { From 356779df17a36a08d916ba5a8d13e8c0470d3d75 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Wed, 12 Oct 2022 12:25:49 +0200 Subject: [PATCH 02/21] [DSW-1536] Filter projects by KM --- engine-shared/elm/Shared/Api/Packages.elm | 17 +++ .../elm/Shared/Api/Questionnaires.elm | 4 + .../elm/Shared/Data/PackageSuggestion.elm | 35 ++++++ .../elm/Shared/Data/PaginationQueryString.elm | 33 ++++-- .../Common/Provisioning/DefaultLocale.elm | 7 +- .../Dashboards/ResearcherDashboard.elm | 2 + .../Projects/Create/TemplateCreate/Update.elm | 11 +- .../elm/Wizard/Projects/Index/Models.elm | 15 ++- .../elm/Wizard/Projects/Index/Msgs.elm | 5 + .../elm/Wizard/Projects/Index/Update.elm | 64 ++++++++++- .../elm/Wizard/Projects/Index/View.elm | 108 +++++++++++++++++- engine-wizard/elm/Wizard/Projects/Models.elm | 6 +- engine-wizard/elm/Wizard/Projects/Routes.elm | 8 +- engine-wizard/elm/Wizard/Projects/Routing.elm | 18 +-- .../elm/Wizard/Projects/Subscriptions.elm | 2 +- engine-wizard/elm/Wizard/Projects/Update.elm | 2 +- engine-wizard/elm/Wizard/Projects/View.elm | 2 +- engine-wizard/elm/Wizard/Routes.elm | 6 +- 18 files changed, 315 insertions(+), 30 deletions(-) diff --git a/engine-shared/elm/Shared/Api/Packages.elm b/engine-shared/elm/Shared/Api/Packages.elm index 4c85c5607..4156ba150 100644 --- a/engine-shared/elm/Shared/Api/Packages.elm +++ b/engine-shared/elm/Shared/Api/Packages.elm @@ -5,6 +5,7 @@ module Shared.Api.Packages exposing , getPackage , getPackages , getPackagesSuggestions + , getPackagesSuggestionsWithOptions , importFromOwl , importPackage , pullPackage @@ -45,6 +46,22 @@ getPackagesSuggestions qs = jwtGet url (Pagination.decoder "packages" PackageSuggestion.decoder) +getPackagesSuggestionsWithOptions : PaginationQueryString -> List String -> List String -> AbstractAppState a -> ToMsg (Pagination PackageSuggestion) msg -> Cmd msg +getPackagesSuggestionsWithOptions qs select exclude = + let + queryString = + PaginationQueryString.toApiUrlWith + [ ( "select", String.join "," select ) + , ( "exclude", String.join "," exclude ) + ] + qs + + url = + "/packages/suggestions" ++ queryString + in + jwtGet url (Pagination.decoder "packages" PackageSuggestion.decoder) + + getPackage : String -> AbstractAppState a -> ToMsg PackageDetail msg -> Cmd msg getPackage packageId = jwtOrHttpGet ("/packages/" ++ packageId) PackageDetail.decoder diff --git a/engine-shared/elm/Shared/Api/Questionnaires.elm b/engine-shared/elm/Shared/Api/Questionnaires.elm index 0fed7f9af..b134082a7 100644 --- a/engine-shared/elm/Shared/Api/Questionnaires.elm +++ b/engine-shared/elm/Shared/Api/Questionnaires.elm @@ -54,6 +54,8 @@ type alias GetQuestionnairesFilters = , userUuidsOp : Maybe FilterOperator , projectTags : Maybe String , projectTagsOp : Maybe FilterOperator + , packageIds : Maybe String + , packageIdsOp : Maybe FilterOperator } @@ -67,6 +69,8 @@ getQuestionnaires filters qs = , ( "userUuidsOp", Maybe.map FilterOperator.toString filters.userUuidsOp ) , ( "projectTags", filters.projectTags ) , ( "projectTagsOp", Maybe.map FilterOperator.toString filters.projectTagsOp ) + , ( "packageIds", filters.packageIds ) + , ( "packageIdsOp", Maybe.map FilterOperator.toString filters.packageIdsOp ) ] queryString = diff --git a/engine-shared/elm/Shared/Data/PackageSuggestion.elm b/engine-shared/elm/Shared/Data/PackageSuggestion.elm index 8da51478e..7884528a6 100644 --- a/engine-shared/elm/Shared/Data/PackageSuggestion.elm +++ b/engine-shared/elm/Shared/Data/PackageSuggestion.elm @@ -2,10 +2,13 @@ module Shared.Data.PackageSuggestion exposing ( PackageSuggestion , decoder , fromPackage + , isSamePackage + , packageIdAll ) import Json.Decode as D exposing (Decoder) import Json.Decode.Pipeline as D +import Maybe.Extra as Maybe import Shared.Data.Package exposing (Package) import Version exposing (Version) @@ -37,3 +40,35 @@ fromPackage package packageVersions = , version = package.version , versions = packageVersions } + + +isSamePackage : String -> String -> Bool +isSamePackage packageId1 packageId2 = + let + ( mbOrgId1, mbKmId1 ) = + getPackageIdValues packageId1 + + ( mbOrgId2, mbKmId2 ) = + getPackageIdValues packageId2 + in + Maybe.isJust mbOrgId1 && mbOrgId1 == mbOrgId2 && Maybe.isJust mbKmId1 && mbKmId1 == mbKmId2 + + +packageIdAll : String -> String +packageIdAll packageId = + case getPackageIdValues packageId of + ( Just orgId, Just kmId ) -> + orgId ++ ":" ++ kmId ++ ":all" + + _ -> + packageId + + +getPackageIdValues : String -> ( Maybe String, Maybe String ) +getPackageIdValues packageId = + case String.split ":" packageId of + orgId :: kmId :: _ -> + ( Just orgId, Just kmId ) + + _ -> + ( Nothing, Nothing ) diff --git a/engine-shared/elm/Shared/Data/PaginationQueryString.elm b/engine-shared/elm/Shared/Data/PaginationQueryString.elm index fe254d167..1b2ad55ae 100644 --- a/engine-shared/elm/Shared/Data/PaginationQueryString.elm +++ b/engine-shared/elm/Shared/Data/PaginationQueryString.elm @@ -6,7 +6,7 @@ module Shared.Data.PaginationQueryString exposing , fromQ , parser , parser1 - , parser5 + , parser7 , resetPage , setPage , toApiUrl @@ -17,7 +17,7 @@ module Shared.Data.PaginationQueryString exposing , withSort , wrapRoute , wrapRoute1 - , wrapRoute5 + , wrapRoute7 ) import List.Extra as List @@ -93,8 +93,8 @@ wrapRoute1 route defaultSortBy page q sort = route (PaginationQueryString page q sortBy sortDirection (Just defaultPageSize)) -wrapRoute5 : (PaginationQueryString -> f -> e -> d -> c -> b -> a) -> Maybe String -> Maybe Int -> Maybe String -> Maybe String -> (f -> e -> d -> c -> b -> a) -wrapRoute5 route defaultSortBy page q sort = +wrapRoute7 : (PaginationQueryString -> h -> g -> f -> e -> d -> c -> b -> a) -> Maybe String -> Maybe Int -> Maybe String -> Maybe String -> (h -> g -> f -> e -> d -> c -> b -> a) +wrapRoute7 route defaultSortBy page q sort = let ( sortBy, sortDirection ) = parseSort defaultSortBy sort @@ -112,9 +112,28 @@ parser1 p qs = p Query.int "page" Query.string "q" Query.string "sort" qs -parser5 : Parser a (Maybe Int -> Maybe String -> Maybe String -> g -> f -> e -> d -> c -> b) -> Query.Parser g -> Query.Parser f -> Query.Parser e -> Query.Parser d -> Query.Parser c -> Parser a b -parser5 p qs1 qs2 qs3 qs4 qs5 = - p Query.int "page" Query.string "q" Query.string "sort" qs1 qs2 qs3 qs4 qs5 +parser7 : + Parser a (Maybe Int -> Maybe String -> Maybe String -> i -> h -> g -> f -> e -> d -> c -> b) + -> Query.Parser i + -> Query.Parser h + -> Query.Parser g + -> Query.Parser f + -> Query.Parser e + -> Query.Parser d + -> Query.Parser c + -> Parser a b +parser7 p qs1 qs2 qs3 qs4 qs5 qs6 qs7 = + p + Query.int "page" + Query.string "q" + Query.string "sort" + qs1 + qs2 + qs3 + qs4 + qs5 + qs6 + qs7 toUrl : PaginationQueryString -> String diff --git a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm index 4b0afa64e..9a5596509 100644 --- a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm +++ b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm @@ -100,8 +100,8 @@ locale = , ( "_global.apiError.questionnaires.deleteError", "Questionnaire could not be deleted." ) , ( "_global.apiError.questionnaires.events.getError", "Unable to get questionnaire event." ) , ( "_global.apiError.questionnaires.events.getListError", "Unable to get version history." ) - , ( "_global.apiError.questionnaires.getError", "Unable to get the Questionnaire." ) - , ( "_global.apiError.questionnaires.getListError", "Unable to get Questionnaires." ) + , ( "_global.apiError.questionnaires.getError", "Unable to get the project." ) + , ( "_global.apiError.questionnaires.getListError", "Unable to get projects." ) , ( "_global.apiError.questionnaires.getProjectTagsSuggestionsError", "Unable to get project tags." ) , ( "_global.apiError.questionnaires.headDocumentPreview", "Unable to get the document preview." ) , ( "_global.apiError.questionnaires.migrations.deleteError", "Questionnaire migration could not be deleted." ) @@ -1031,6 +1031,9 @@ locale = , ( "Wizard.Projects.Index.View.filter.projectTags.empty", "No project tags found" ) , ( "Wizard.Projects.Index.View.filter.projectTags.searchPlaceholder", "Search project tags..." ) , ( "Wizard.Projects.Index.View.filter.projectTags.title", "Project Tags" ) + , ( "Wizard.Projects.Index.View.filter.packages.empty", "No knowledge models found" ) + , ( "Wizard.Projects.Index.View.filter.packages.searchPlaceholder", "Search knowledge models..." ) + , ( "Wizard.Projects.Index.View.filter.packages.title", "Knowledge Models" ) , ( "Wizard.Projects.Index.View.filter.template.name", "Project Template" ) , ( "Wizard.Projects.Index.View.filter.template.projectsOnly", "Projects only" ) , ( "Wizard.Projects.Index.View.filter.template.templatesOnly", "Templates only" ) diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm index ed10ce1fa..dbae78efb 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm @@ -53,6 +53,8 @@ fetchData appState = , userUuidsOp = Nothing , projectTags = Nothing , projectTagsOp = Nothing + , packageIds = Nothing + , packageIdsOp = Nothing } pagination appState diff --git a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm index 66b1c11ac..130da1054 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm @@ -93,7 +93,16 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = cfg = { wrapMsg = wrapMsg << QuestionnaireTypeHintInputMsg - , getTypeHints = QuestionnairesApi.getQuestionnaires { isTemplate = Just True, userUuids = Nothing, userUuidsOp = Nothing, projectTags = Nothing, projectTagsOp = Nothing } + , getTypeHints = + QuestionnairesApi.getQuestionnaires + { isTemplate = Just True + , userUuids = Nothing + , userUuidsOp = Nothing + , projectTags = Nothing + , projectTagsOp = Nothing + , packageIds = Nothing + , packageIdsOp = Nothing + } , getError = lg "apiError.packages.getListError" appState , setReply = formMsg << Uuid.toString << .uuid , clearReply = Just <| formMsg "" diff --git a/engine-wizard/elm/Wizard/Projects/Index/Models.elm b/engine-wizard/elm/Wizard/Projects/Index/Models.elm index f8fa66459..475b266e3 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/Models.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/Models.elm @@ -5,6 +5,7 @@ module Wizard.Projects.Index.Models exposing import ActionResult exposing (ActionResult(..)) import Debouncer.Extra as Debounce exposing (Debouncer) +import Shared.Data.PackageSuggestion exposing (PackageSuggestion) import Shared.Data.Pagination exposing (Pagination) import Shared.Data.PaginationQueryFilters as PaginationQueryFilters import Shared.Data.PaginationQueryFilters.FilterOperator exposing (FilterOperator) @@ -15,7 +16,7 @@ import Wizard.Common.Components.Listing.Models as Listing import Wizard.Projects.Common.CloneProjectModal.Models as CloneProjectModal import Wizard.Projects.Common.DeleteProjectModal.Models as DeleteProjectModal import Wizard.Projects.Index.Msgs exposing (Msg) -import Wizard.Projects.Routes exposing (indexRouteIsTemplateFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) +import Wizard.Projects.Routes exposing (indexRouteIsTemplateFilterId, indexRoutePackagesFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) type alias Model = @@ -30,6 +31,9 @@ type alias Model = , userFilterSearchValue : String , userFilterSelectedUsers : ActionResult (Pagination UserSuggestion) , userFilterUsers : ActionResult (Pagination UserSuggestion) + , packagesFilterSearchValue : String + , packagesFilterSelectedPackages : ActionResult (Pagination PackageSuggestion) + , packagesFilterPackages : ActionResult (Pagination PackageSuggestion) } @@ -40,19 +44,23 @@ initialModel : -> Maybe FilterOperator -> Maybe String -> Maybe FilterOperator + -> Maybe String + -> Maybe FilterOperator -> Maybe Model -> Model -initialModel paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbOldModel = +initialModel paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp mbOldModel = let values = [ ( indexRouteIsTemplateFilterId, mbIsTemplate ) , ( indexRouteUsersFilterId, mbUser ) , ( indexRouteProjectTagsFilterId, mbProjectTags ) + , ( indexRoutePackagesFilterId, mbPackages ) ] operators = [ ( indexRouteUsersFilterId, mbUserOp ) , ( indexRouteProjectTagsFilterId, mbProjectTagsOp ) + , ( indexRoutePackagesFilterId, mbPackagesOp ) ] paginationQueryFilters = @@ -69,4 +77,7 @@ initialModel paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mb , userFilterSearchValue = "" , userFilterSelectedUsers = ActionResult.Loading , userFilterUsers = ActionResult.Loading + , packagesFilterSearchValue = "" + , packagesFilterSelectedPackages = ActionResult.Loading + , packagesFilterPackages = ActionResult.Loading } diff --git a/engine-wizard/elm/Wizard/Projects/Index/Msgs.elm b/engine-wizard/elm/Wizard/Projects/Index/Msgs.elm index b81454b3f..d82ac1708 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/Msgs.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/Msgs.elm @@ -1,6 +1,7 @@ module Wizard.Projects.Index.Msgs exposing (Msg(..)) import Debouncer.Extra as Debouncer +import Shared.Data.PackageSuggestion exposing (PackageSuggestion) import Shared.Data.Pagination exposing (Pagination) import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Data.UserSuggestion exposing (UserSuggestion) @@ -24,5 +25,9 @@ type Msg | UsersFilterInput String | UsersFilterSearch String | UsersFilterSearchComplete (Result ApiError (Pagination UserSuggestion)) + | PackagesFilterGetValuesComplete (Result ApiError (Pagination PackageSuggestion)) + | PackagesFilterInput String + | PackagesFilterSearch String + | PackagesFilterSearchComplete (Result ApiError (Pagination PackageSuggestion)) | DebouncerMsg (Debouncer.Msg Msg) | NoOp diff --git a/engine-wizard/elm/Wizard/Projects/Index/Update.elm b/engine-wizard/elm/Wizard/Projects/Index/Update.elm index 19fa52ee2..ce6766fa5 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/Update.elm @@ -7,6 +7,7 @@ import ActionResult exposing (ActionResult(..)) import Debouncer.Extra as Debouncer import Dict import Maybe.Extra as Maybe +import Shared.Api.Packages as PackagesApi import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Api.Users as UsersApi import Shared.Data.PaginationQueryFilters as PaginationQueryFilters @@ -26,7 +27,7 @@ import Wizard.Projects.Common.CloneProjectModal.Update as CloneProjectModal import Wizard.Projects.Common.DeleteProjectModal.Update as DeleteProjectModal import Wizard.Projects.Index.Models exposing (Model) import Wizard.Projects.Index.Msgs exposing (Msg(..)) -import Wizard.Projects.Routes exposing (indexRouteIsTemplateFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) +import Wizard.Projects.Routes exposing (indexRouteIsTemplateFilterId, indexRoutePackagesFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) import Wizard.Routes as Routes import Wizard.Routing exposing (cmdNavigate) @@ -46,12 +47,27 @@ fetchData appState model = Nothing -> Cmd.none + + selectedPackagesCmd = + case Dict.get indexRoutePackagesFilterId model.questionnaires.filters.values of + Just packageIds -> + PackagesApi.getPackagesSuggestionsWithOptions + PaginationQueryString.empty + (String.split "," packageIds) + [] + appState + PackagesFilterGetValuesComplete + + Nothing -> + Cmd.none in Cmd.batch [ Cmd.map ListingMsg Listing.fetchData , dispatch (ProjectTagsFilterSearch "") , dispatch (UsersFilterSearch "") + , dispatch (PackagesFilterSearch "") , selectedUsersCmd + , selectedPackagesCmd ] @@ -184,6 +200,44 @@ update wrapMsg msg appState model = , result = result } + PackagesFilterGetValuesComplete result -> + applyResult appState + { setResult = \r m -> { m | packagesFilterSelectedPackages = r } + , defaultError = lg "apiError.packages.getListError" appState + , model = model + , result = result + } + + PackagesFilterInput value -> + ( { model | packagesFilterSearchValue = value } + , dispatch (wrapMsg <| DebouncerMsg <| Debouncer.provideInput <| PackagesFilterSearch value) + ) + + PackagesFilterSearch value -> + let + queryString = + PaginationQueryString.fromQ value + |> PaginationQueryString.withSize (Just 10) + + selectedKMs = + model.questionnaires.filters.values + |> Dict.get indexRoutePackagesFilterId + |> Maybe.unwrap [] (String.split ",") + + cmd = + Cmd.map wrapMsg <| + PackagesApi.getPackagesSuggestionsWithOptions queryString [] selectedKMs appState PackagesFilterSearchComplete + in + ( model, cmd ) + + PackagesFilterSearchComplete result -> + applyResult appState + { setResult = \r m -> { m | packagesFilterPackages = r } + , defaultError = lg "apiError.packages.getListError" appState + , model = model + , result = result + } + DebouncerMsg debounceMsg -> let updateConfig = @@ -262,6 +316,12 @@ listingUpdateConfig wrapMsg appState model = projectTagsOp = PaginationQueryFilters.getOp indexRouteProjectTagsFilterId model.questionnaires.filters + + packageIds = + PaginationQueryFilters.getValue indexRoutePackagesFilterId model.questionnaires.filters + + packageIdsOp = + PaginationQueryFilters.getOp indexRoutePackagesFilterId model.questionnaires.filters in { getRequest = QuestionnairesApi.getQuestionnaires @@ -270,6 +330,8 @@ listingUpdateConfig wrapMsg appState model = , userUuidsOp = usersOp , projectTags = projectTags , projectTagsOp = projectTagsOp + , packageIds = packageIds + , packageIdsOp = packageIdsOp } , getError = lg "apiError.questionnaires.getListError" appState , wrapMsg = wrapMsg << ListingMsg diff --git a/engine-wizard/elm/Wizard/Projects/Index/View.elm b/engine-wizard/elm/Wizard/Projects/Index/View.elm index 3c2ee087c..682748e0a 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/View.elm @@ -9,6 +9,7 @@ import Json.Decode as D import List.Extra as List import Maybe.Extra as Maybe import Shared.Components.Badge as Badge +import Shared.Data.PackageSuggestion as PackageSuggestion import Shared.Data.Pagination as Pagination import Shared.Data.PaginationQueryFilters as PaginationQueryFilter import Shared.Data.PaginationQueryFilters.FilterOperator as FilterOperator @@ -39,7 +40,7 @@ import Wizard.Projects.Common.QuestionnaireDescriptor as QuestionnaireDescriptor import Wizard.Projects.Common.View exposing (visibilityIcons) import Wizard.Projects.Index.Models exposing (Model) import Wizard.Projects.Index.Msgs exposing (Msg(..)) -import Wizard.Projects.Routes exposing (Route(..), indexRouteIsTemplateFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) +import Wizard.Projects.Routes exposing (Route(..), indexRouteIsTemplateFilterId, indexRoutePackagesFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) import Wizard.Routes as Routes import Wizard.Routing as Routing @@ -107,6 +108,9 @@ listingConfig appState model = PaginationQueryFilter.isFilterActive indexRouteProjectTagsFilterId model.questionnaires.filters || ActionResult.withDefault False model.projectTagsExist + kmsFilter = + listingKMsFilter appState model + usersFilter = listingUsersFilter appState model @@ -114,6 +118,7 @@ listingConfig appState model = [] |> listInsertIf templateFilter (Features.projectTemplatesCreate appState) |> listInsertIf tagsFilter (Features.projectTagging appState && tagsFilterVisible) + |> listInsertIf kmsFilter True |> listInsertIf usersFilter True in { title = listingTitle appState @@ -260,6 +265,107 @@ listingProjectTagsFilter appState model = } +listingKMsFilter : AppState -> Model -> Listing.Filter Msg +listingKMsFilter appState model = + let + linkWithIds packageIds = + Routing.toUrl appState <| + Routes.projectsIndexWithFilters + (PaginationQueryFilter.insertValue indexRoutePackagesFilterId (String.join "," (List.unique packageIds)) model.questionnaires.filters) + (PaginationQueryString.resetPage model.questionnaires.paginationQueryString) + + removePackageLink packageId = + linkWithIds <| List.filter ((/=) (PackageSuggestion.packageIdAll packageId)) selectedPackageIds + + addPackageLink packageId = + linkWithIds <| PackageSuggestion.packageIdAll packageId :: selectedPackageIds + + viewPackageItem link icon package = + Dropdown.anchorItem + [ href (link package.id) + , class "dropdown-item-icon" + , dataCy "project_filter_packages_option" + , alwaysStopPropagationOn "click" (D.succeed NoOp) + ] + [ icon + , text package.name + ] + + selectedPackageItem = + viewPackageItem removePackageLink (faSet "listing.filter.multi.selected" appState) + + foundSelectedPackages = + ActionResult.unwrap [] .items model.packagesFilterSelectedPackages + |> List.sortBy .name + + selectedPackageIds = + model.questionnaires.filters + |> PaginationQueryFilter.getValue indexRoutePackagesFilterId + |> Maybe.unwrap [] (String.split ",") + + selectedPackages = + selectedPackageIds + |> List.map (\a -> List.find (PackageSuggestion.isSamePackage a << .id) foundSelectedPackages) + |> listFilterJust + |> List.sortBy .name + + foundPackages = + model.packagesFilterPackages + |> ActionResult.unwrap [] (List.sortBy .name << .items) + + badge = + filterBadge selectedPackages + + searchInputItem = + [ Dropdown.customItem <| + div [ class "dropdown-item-search" ] + [ input + [ type_ "text" + , class "form-control" + , placeholder (l_ "filter.packages.searchPlaceholder" appState) + , alwaysStopPropagationOn "click" (D.succeed (PackagesFilterInput model.packagesFilterSearchValue)) + , onInput PackagesFilterInput + , value model.packagesFilterSearchValue + ] + [] + ] + , Dropdown.divider + ] + + selectedPackagesItems = + List.map selectedPackageItem selectedPackages + + foundPackagesItems = + if not (List.isEmpty foundPackages) then + let + addPackageItem = + viewPackageItem addPackageLink (faSet "listing.filter.multi.notSelected" appState) + in + List.map addPackageItem foundPackages + + else if not (String.isEmpty model.packagesFilterSearchValue) then + [ Dropdown.customItem <| + div [ class "dropdown-item-empty" ] + [ lx_ "filter.packages.empty" appState ] + ] + + else + [] + + label = + case List.head selectedPackages of + Just selectedPackage -> + selectedPackage.name + + Nothing -> + l_ "filter.packages.title" appState + in + Listing.CustomFilter indexRoutePackagesFilterId + { label = [ span [ class "filter-text-label" ] [ text label ], badge ] + , items = searchInputItem ++ selectedPackagesItems ++ foundPackagesItems + } + + listingUsersFilter : AppState -> Model -> Listing.Filter Msg listingUsersFilter appState model = let diff --git a/engine-wizard/elm/Wizard/Projects/Models.elm b/engine-wizard/elm/Wizard/Projects/Models.elm index 101078347..c578f0451 100644 --- a/engine-wizard/elm/Wizard/Projects/Models.elm +++ b/engine-wizard/elm/Wizard/Projects/Models.elm @@ -27,7 +27,7 @@ initialModel appState = { createModel = Wizard.Projects.Create.Models.empty , createMigrationModel = Wizard.Projects.CreateMigration.Models.initialModel Uuid.nil , detailModel = Detail.init appState Uuid.nil - , indexModel = Wizard.Projects.Index.Models.initialModel PaginationQueryString.empty Nothing Nothing Nothing Nothing Nothing Nothing + , indexModel = Wizard.Projects.Index.Models.initialModel PaginationQueryString.empty Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing , migrationModel = Wizard.Projects.Migration.Models.initialModel Uuid.nil , importModel = Wizard.Projects.Import.Models.initialModel Uuid.nil "" } @@ -49,8 +49,8 @@ initLocalModel appState route model = else { model | detailModel = Detail.initPageModel appState subroute <| Detail.init appState uuid } - IndexRoute paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp -> - { model | indexModel = Wizard.Projects.Index.Models.initialModel paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp (Just model.indexModel) } + IndexRoute paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp -> + { model | indexModel = Wizard.Projects.Index.Models.initialModel paginationQueryString mbIsTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp (Just model.indexModel) } MigrationRoute uuid -> { model | migrationModel = Wizard.Projects.Migration.Models.initialModel uuid } diff --git a/engine-wizard/elm/Wizard/Projects/Routes.elm b/engine-wizard/elm/Wizard/Projects/Routes.elm index 389c6c079..bc538c01a 100644 --- a/engine-wizard/elm/Wizard/Projects/Routes.elm +++ b/engine-wizard/elm/Wizard/Projects/Routes.elm @@ -1,6 +1,7 @@ module Wizard.Projects.Routes exposing ( Route(..) , indexRouteIsTemplateFilterId + , indexRoutePackagesFilterId , indexRouteProjectTagsFilterId , indexRouteUsersFilterId ) @@ -16,7 +17,7 @@ type Route = CreateRoute ProjectCreateRoute | CreateMigrationRoute Uuid | DetailRoute Uuid ProjectDetailRoute - | IndexRoute PaginationQueryString (Maybe String) (Maybe String) (Maybe FilterOperator) (Maybe String) (Maybe FilterOperator) + | IndexRoute PaginationQueryString (Maybe String) (Maybe String) (Maybe FilterOperator) (Maybe String) (Maybe FilterOperator) (Maybe String) (Maybe FilterOperator) | MigrationRoute Uuid | ImportRoute Uuid String @@ -34,3 +35,8 @@ indexRouteIsTemplateFilterId = indexRouteProjectTagsFilterId : String indexRouteProjectTagsFilterId = "projectTags" + + +indexRoutePackagesFilterId : String +indexRoutePackagesFilterId = + "packages" diff --git a/engine-wizard/elm/Wizard/Projects/Routing.elm b/engine-wizard/elm/Wizard/Projects/Routing.elm index e8ccde364..e6702dbb0 100644 --- a/engine-wizard/elm/Wizard/Projects/Routing.elm +++ b/engine-wizard/elm/Wizard/Projects/Routing.elm @@ -19,7 +19,7 @@ import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Feature as Feature import Wizard.Projects.Create.ProjectCreateRoute as ProjectCreateRoute import Wizard.Projects.Detail.ProjectDetailRoute as ProjectDetailRoute -import Wizard.Projects.Routes exposing (Route(..), indexRouteIsTemplateFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) +import Wizard.Projects.Routes exposing (Route(..), indexRouteIsTemplateFilterId, indexRoutePackagesFilterId, indexRouteProjectTagsFilterId, indexRouteUsersFilterId) parsers : AppState -> (Route -> a) -> List (Parser (a -> c) c) @@ -62,18 +62,20 @@ parsers appState wrapRoute = [] -- Project index - wrappedIndexRoute pqs mbTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp = - wrapRoute <| IndexRoute pqs mbTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp + wrappedIndexRoute pqs mbTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp = + wrapRoute <| IndexRoute pqs mbTemplate mbUser mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp indexRouteParser = - PaginationQueryString.parser5 (s moduleRoot) + PaginationQueryString.parser7 (s moduleRoot) (Query.string indexRouteIsTemplateFilterId) (Query.string indexRouteUsersFilterId) (FilterOperator.queryParser indexRouteUsersFilterId) (Query.string indexRouteProjectTagsFilterId) (FilterOperator.queryParser indexRouteProjectTagsFilterId) + (Query.string indexRoutePackagesFilterId) + (FilterOperator.queryParser indexRoutePackagesFilterId) - -- Projec tImport + -- Project Import projectImportRoute uuid string = wrapRoute <| ImportRoute uuid string in @@ -86,7 +88,7 @@ parsers appState wrapRoute = , map (detailDocumentsRoute wrapRoute) (PaginationQueryString.parser (s moduleRoot uuid s "documents")) , map newDocumentRoute (s moduleRoot uuid s "documents" s "new" Query.uuid "eventUuid") , map (wrapRoute << flip DetailRoute ProjectDetailRoute.Settings) (s moduleRoot uuid s "settings") - , map (PaginationQueryString.wrapRoute5 wrappedIndexRoute (Just "updatedAt,desc")) indexRouteParser + , map (PaginationQueryString.wrapRoute7 wrappedIndexRoute (Just "updatedAt,desc")) indexRouteParser , map (wrapRoute << MigrationRoute) (s moduleRoot s (lr "projects.migration" appState) uuid) , map projectImportRoute (s moduleRoot s "import" uuid string) ] @@ -150,7 +152,7 @@ toUrl appState route = ProjectDetailRoute.Settings -> [ moduleRoot, Uuid.toString uuid, "settings" ] - IndexRoute paginationQueryString mbIsTemplate mbUserUuid mbUserOp mbProjectTags mbProjectTagsOp -> + IndexRoute paginationQueryString mbIsTemplate mbUserUuid mbUserOp mbProjectTags mbProjectTagsOp mbPackages mbPackagesOp -> let params = Dict.toList <| @@ -160,6 +162,8 @@ toUrl appState route = , FilterOperator.toUrlParam indexRouteUsersFilterId mbUserOp , ( indexRouteProjectTagsFilterId, mbProjectTags ) , FilterOperator.toUrlParam indexRouteProjectTagsFilterId mbProjectTagsOp + , ( indexRoutePackagesFilterId, mbPackages ) + , FilterOperator.toUrlParam indexRoutePackagesFilterId mbPackagesOp ] in [ moduleRoot ++ PaginationQueryString.toUrlWith params paginationQueryString ] diff --git a/engine-wizard/elm/Wizard/Projects/Subscriptions.elm b/engine-wizard/elm/Wizard/Projects/Subscriptions.elm index 52df1110d..db0c99f41 100644 --- a/engine-wizard/elm/Wizard/Projects/Subscriptions.elm +++ b/engine-wizard/elm/Wizard/Projects/Subscriptions.elm @@ -26,7 +26,7 @@ subscriptions route model = Sub.map DetailMsg <| Wizard.Projects.Detail.Subscriptions.subscriptions subroute model.detailModel - IndexRoute _ _ _ _ _ _ -> + IndexRoute _ _ _ _ _ _ _ _ -> Sub.map IndexMsg <| Wizard.Projects.Index.Subscriptions.subscriptions model.indexModel MigrationRoute _ -> diff --git a/engine-wizard/elm/Wizard/Projects/Update.elm b/engine-wizard/elm/Wizard/Projects/Update.elm index 16db33825..080f3bf9b 100644 --- a/engine-wizard/elm/Wizard/Projects/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Update.elm @@ -35,7 +35,7 @@ fetchData route appState model = Cmd.map DetailMsg <| Wizard.Projects.Detail.Update.fetchData appState uuid model.detailModel - IndexRoute _ _ _ _ _ _ -> + IndexRoute _ _ _ _ _ _ _ _ -> Cmd.map IndexMsg <| Wizard.Projects.Index.Update.fetchData appState model.indexModel diff --git a/engine-wizard/elm/Wizard/Projects/View.elm b/engine-wizard/elm/Wizard/Projects/View.elm index c762a03c7..fd4e98107 100644 --- a/engine-wizard/elm/Wizard/Projects/View.elm +++ b/engine-wizard/elm/Wizard/Projects/View.elm @@ -28,7 +28,7 @@ view route appState model = Html.map DetailMsg <| Detail.view subroute appState model.detailModel - IndexRoute _ _ _ _ _ _ -> + IndexRoute _ _ _ _ _ _ _ _ -> Html.map IndexMsg <| Wizard.Projects.Index.View.view appState model.indexModel diff --git a/engine-wizard/elm/Wizard/Routes.elm b/engine-wizard/elm/Wizard/Routes.elm index 09e78ba81..a5d2cba77 100644 --- a/engine-wizard/elm/Wizard/Routes.elm +++ b/engine-wizard/elm/Wizard/Routes.elm @@ -456,7 +456,7 @@ projectsIndex appState = mbUserUuid = Session.getUserUuid appState.session in - ProjectsRoute (Wizard.Projects.Routes.IndexRoute PaginationQueryString.empty Nothing mbUserUuid Nothing Nothing Nothing) + ProjectsRoute (Wizard.Projects.Routes.IndexRoute PaginationQueryString.empty Nothing mbUserUuid Nothing Nothing Nothing Nothing Nothing) projectsIndexWithFilters : PaginationQueryFilters -> PaginationQueryString -> Route @@ -468,13 +468,15 @@ projectsIndexWithFilters filters pagination = (PaginationQueryFilters.getOp Wizard.Projects.Routes.indexRouteUsersFilterId filters) (PaginationQueryFilters.getValue Wizard.Projects.Routes.indexRouteProjectTagsFilterId filters) (PaginationQueryFilters.getOp Wizard.Projects.Routes.indexRouteProjectTagsFilterId filters) + (PaginationQueryFilters.getValue Wizard.Projects.Routes.indexRoutePackagesFilterId filters) + (PaginationQueryFilters.getOp Wizard.Projects.Routes.indexRoutePackagesFilterId filters) ) isProjectsIndex : Route -> Bool isProjectsIndex route = case route of - ProjectsRoute (Wizard.Projects.Routes.IndexRoute _ _ _ _ _ _) -> + ProjectsRoute (Wizard.Projects.Routes.IndexRoute _ _ _ _ _ _ _ _) -> True _ -> From e3893eec9333790fd739553f51d65106903caa61 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Fri, 14 Oct 2022 08:47:29 +0200 Subject: [PATCH 03/21] [DSW-1537] Fix create anonymous project view --- engine-wizard/elm/Wizard/Common/View/Layout.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine-wizard/elm/Wizard/Common/View/Layout.elm b/engine-wizard/elm/Wizard/Common/View/Layout.elm index 61fd35f22..41b703af0 100644 --- a/engine-wizard/elm/Wizard/Common/View/Layout.elm +++ b/engine-wizard/elm/Wizard/Common/View/Layout.elm @@ -84,7 +84,7 @@ publicApp model content = , classList [ ( "app-fullscreen", AppState.isFullscreen model.appState ) ] ] [ publicHeader True model - , div [ class "container-fluid" ] [ content ] + , div [ class "container-fluid d-flex justify-content-center" ] [ content ] ] in { title = LookAndFeelConfig.getAppTitle model.appState.config.lookAndFeel From 42a0fa2f6116f6be5e752ecd63e4f114113635cf Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Fri, 14 Oct 2022 08:53:04 +0200 Subject: [PATCH 04/21] [DSW-1538] Fix add to my projects button icon spacing --- .../elm/Wizard/Common/View/ActionButton.elm | 18 ------------------ .../elm/Wizard/Projects/Detail/View.elm | 4 ++-- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/engine-wizard/elm/Wizard/Common/View/ActionButton.elm b/engine-wizard/elm/Wizard/Common/View/ActionButton.elm index e92c2140e..cee8df0ab 100644 --- a/engine-wizard/elm/Wizard/Common/View/ActionButton.elm +++ b/engine-wizard/elm/Wizard/Common/View/ActionButton.elm @@ -1,12 +1,10 @@ module Wizard.Common.View.ActionButton exposing ( ButtonConfig , ButtonCustomConfig - , ButtonExtraConfig , ButtonWithAttrsConfig , SubmitConfig , button , buttonCustom - , buttonExtra , buttonWithAttrs , loader , submit @@ -54,22 +52,6 @@ buttonWithAttrs appState cfg = cfg.result -type alias ButtonExtraConfig a msg = - { content : List (Html msg) - , result : ActionResult a - , msg : msg - , dangerous : Bool - } - - -buttonExtra : AppState -> ButtonExtraConfig a msg -> Html msg -buttonExtra appState cfg = - actionButtonView appState - [ onClick cfg.msg, class <| "btn btn-with-loader " ++ buttonClass cfg.dangerous ] - cfg.content - cfg.result - - type alias ButtonCustomConfig a msg = { content : List (Html msg) , result : ActionResult a diff --git a/engine-wizard/elm/Wizard/Projects/Detail/View.elm b/engine-wizard/elm/Wizard/Projects/Detail/View.elm index 6a982ca25..801058298 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/View.elm @@ -171,14 +171,14 @@ viewProjectNavigationActions appState model questionnaire = if QuestionnaireDetail.isAnonymousProject questionnaire && Session.exists appState.session then DetailNavigation.sectionActions [ ActionResultView.error model.addingToMyProjects - , ActionButton.buttonExtra appState + , ActionButton.buttonCustom appState { content = [ fa "fas fa-plus" , lx_ "actions.add" appState ] , result = model.addingToMyProjects , msg = AddToMyProjects - , dangerous = False + , btnClass = "btn-primary with-icon" } ] From 6ccb345d86df7e1f4a6b34836e5deadec8ccfb1f Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Wed, 19 Oct 2022 15:14:29 +0200 Subject: [PATCH 05/21] [DSW-1543] Add outdated knowledge models and document templates to the dashboard --- engine-shared/elm/Shared/Api/Packages.elm | 15 ++++ engine-shared/elm/Shared/Api/Templates.elm | 15 ++++ engine-shared/elm/Shared/Components/Badge.elm | 6 ++ .../Common/Provisioning/DefaultLocale.elm | 6 ++ .../Dashboard/Dashboards/AdminDashboard.elm | 63 ++++++++++++++--- .../Dashboards/DataStewardDashboard.elm | 68 ++++++++++++++++++- engine-wizard/elm/Wizard/Dashboard/Models.elm | 3 + engine-wizard/elm/Wizard/Dashboard/Msgs.elm | 2 + engine-wizard/elm/Wizard/Dashboard/Update.elm | 10 +++ engine-wizard/elm/Wizard/Dashboard/View.elm | 2 +- .../Widgets/OutdatedPackagesWidget.elm | 60 ++++++++++++++++ .../Widgets/OutdatedTemplatesWidget.elm | 60 ++++++++++++++++ .../Widgets/RecentProjectsWidget.elm | 2 +- engine-wizard/scss/modules/_Dashboard.scss | 59 ++++++++-------- 14 files changed, 327 insertions(+), 44 deletions(-) create mode 100644 engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm create mode 100644 engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm diff --git a/engine-shared/elm/Shared/Api/Packages.elm b/engine-shared/elm/Shared/Api/Packages.elm index 4156ba150..b45f23cf5 100644 --- a/engine-shared/elm/Shared/Api/Packages.elm +++ b/engine-shared/elm/Shared/Api/Packages.elm @@ -2,6 +2,7 @@ module Shared.Api.Packages exposing ( deletePackage , deletePackageVersion , exportPackageUrl + , getOutdatedPackages , getPackage , getPackages , getPackagesSuggestions @@ -34,6 +35,20 @@ getPackages qs = jwtGet url (Pagination.decoder "packages" Package.decoder) +getOutdatedPackages : AbstractAppState a -> ToMsg (Pagination Package) msg -> Cmd msg +getOutdatedPackages = + let + queryString = + PaginationQueryString.empty + |> PaginationQueryString.withSize (Just 5) + |> PaginationQueryString.toApiUrlWith [ ( "state", "OutdatedPackageState" ) ] + + url = + "/packages" ++ queryString + in + jwtGet url (Pagination.decoder "packages" Package.decoder) + + getPackagesSuggestions : PaginationQueryString -> AbstractAppState a -> ToMsg (Pagination PackageSuggestion) msg -> Cmd msg getPackagesSuggestions qs = let diff --git a/engine-shared/elm/Shared/Api/Templates.elm b/engine-shared/elm/Shared/Api/Templates.elm index 18830fb66..5e34ac968 100644 --- a/engine-shared/elm/Shared/Api/Templates.elm +++ b/engine-shared/elm/Shared/Api/Templates.elm @@ -2,6 +2,7 @@ module Shared.Api.Templates exposing ( deleteTemplate , deleteTemplateVersion , exportTemplateUrl + , getOutdatedTemplates , getTemplate , getTemplates , getTemplatesAll @@ -38,6 +39,20 @@ getTemplatesAll = jwtGet "/templates/all" (D.list TemplateSuggestion.decoder) +getOutdatedTemplates : AbstractAppState a -> ToMsg (Pagination Template) msg -> Cmd msg +getOutdatedTemplates = + let + queryString = + PaginationQueryString.empty + |> PaginationQueryString.withSize (Just 5) + |> PaginationQueryString.toApiUrlWith [ ( "state", "OutdatedTemplateState" ) ] + + url = + "/templates" ++ queryString + in + jwtGet url (Pagination.decoder "templates" Template.decoder) + + getTemplate : String -> AbstractAppState a -> ToMsg TemplateDetail msg -> Cmd msg getTemplate templateId = jwtOrHttpGet ("/templates/" ++ templateId) TemplateDetail.decoder diff --git a/engine-shared/elm/Shared/Components/Badge.elm b/engine-shared/elm/Shared/Components/Badge.elm index 353a6c399..54afda15c 100644 --- a/engine-shared/elm/Shared/Components/Badge.elm +++ b/engine-shared/elm/Shared/Components/Badge.elm @@ -6,6 +6,7 @@ module Shared.Components.Badge exposing , light , secondary , success + , warning , warningClass ) @@ -43,6 +44,11 @@ dangerClass = badgeClass "bg-danger" +warning : List (Html.Attribute msg) -> List (Html msg) -> Html msg +warning = + render warningClass + + warningClass : String warningClass = badgeClass "bg-warning text-dark" diff --git a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm index 9a5596509..46f96f0be 100644 --- a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm +++ b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm @@ -659,6 +659,12 @@ locale = , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.title", "Import Knowledge Model" ) , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.text", "Knowledge models are published in [DSW Registry](https://registry.ds-wizard.org). You can easily import them into your instance to make them available for researchers. You can also import other knowledge models exported from different instances." ) , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.actionLabel", "Import" ) + , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.title", "Update Knowledge Models" ) + , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.description", "There are updates available for some knowledge models." ) + , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.updateBadge", "update available" ) + , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.title", "Update Document Templates" ) + , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.description", "There are updates available for some document templates." ) + , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.updateBadge", "update available" ) , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.heading", "Recent Projects" ) , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.empty", "You have no projects yet, start by creating some." ) , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.viewAll", "View all" ) diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm index 0a9ea59c0..69357bf63 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm @@ -11,8 +11,13 @@ import ActionResult exposing (ActionResult) import Html exposing (Html, div) import Html.Attributes exposing (class) import Maybe.Extra as Maybe +import Shared.Api.Packages as PackagesApi +import Shared.Api.Templates as TemplatesApi import Shared.Api.Usage as UsageApi import Shared.Data.BootstrapConfig.RegistryConfig as RegistryConfig +import Shared.Data.Package exposing (Package) +import Shared.Data.Pagination exposing (Pagination) +import Shared.Data.Template exposing (Template) import Shared.Data.Usage exposing (Usage) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Locale exposing (lg) @@ -22,36 +27,74 @@ import Wizard.Dashboard.Widgets.AddOpenIDWidget as AddOpenIDWidget import Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget as ConfigureLookAndFeel import Wizard.Dashboard.Widgets.ConfigureOrganizationWidget as ConfigureOrganizationWidget import Wizard.Dashboard.Widgets.ConnectRegistryWidget as ConnectRegistryWidget +import Wizard.Dashboard.Widgets.OutdatedPackagesWidget as OutdatedPackagesWidget +import Wizard.Dashboard.Widgets.OutdatedTemplatesWidget as OutdatedTemplatesWidget import Wizard.Dashboard.Widgets.UsageWidget as UsageWidget import Wizard.Dashboard.Widgets.WelcomeWidget as WelcomeWidget type alias Model = - { usage : ActionResult Usage } + { usage : ActionResult Usage + , packages : ActionResult (List Package) + , templates : ActionResult (List Template) + } initialModel : Model initialModel = - { usage = ActionResult.Loading } + { usage = ActionResult.Loading + , packages = ActionResult.Loading + , templates = ActionResult.Loading + } type Msg = GetUsageComplete (Result ApiError Usage) + | GetPackagesComplete (Result ApiError (Pagination Package)) + | GetTemplatesComplete (Result ApiError (Pagination Template)) fetchData : AppState -> Cmd Msg fetchData appState = - UsageApi.getUsage appState GetUsageComplete + let + packagesCmd = + PackagesApi.getOutdatedPackages appState GetPackagesComplete + + templatesCmd = + TemplatesApi.getOutdatedTemplates appState GetTemplatesComplete + + usageCmd = + UsageApi.getUsage appState GetUsageComplete + in + Cmd.batch [ packagesCmd, templatesCmd, usageCmd ] update : Msg -> AppState -> Model -> Model -update (GetUsageComplete result) appState model = - case result of - Ok data -> - { model | usage = ActionResult.Success data } +update msg appState model = + case msg of + GetUsageComplete result -> + case result of + Ok data -> + { model | usage = ActionResult.Success data } + + Err error -> + { model | usage = ApiError.toActionResult appState (lg "apiError.usage.getError" appState) error } + + GetPackagesComplete result -> + case result of + Ok data -> + { model | packages = ActionResult.Success data.items } + + Err error -> + { model | packages = ApiError.toActionResult appState (lg "apiError.packages.getListError" appState) error } + + GetTemplatesComplete result -> + case result of + Ok data -> + { model | templates = ActionResult.Success data.items } - Err error -> - { model | usage = ApiError.toActionResult appState (lg "apiError.usage.getError" appState) error } + Err error -> + { model | templates = ApiError.toActionResult appState (lg "apiError.templates.getListError" appState) error } view : AppState -> Model -> Html msg @@ -79,6 +122,8 @@ view appState model = div [] [ div [ class "row gx-3" ] (WelcomeWidget.view appState + :: OutdatedPackagesWidget.view appState model.packages + :: OutdatedTemplatesWidget.view appState model.templates :: ctaWidgets ++ [ UsageWidget.view appState model.usage ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm index 885c565ab..0fb862429 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm @@ -1,20 +1,82 @@ -module Wizard.Dashboard.Dashboards.DataStewardDashboard exposing (view) +module Wizard.Dashboard.Dashboards.DataStewardDashboard exposing (Model, Msg, fetchData, initialModel, update, view) +import ActionResult exposing (ActionResult) import Html exposing (Html, div) import Html.Attributes exposing (class) +import Shared.Api.Packages as PackagesApi +import Shared.Api.Templates as TemplatesApi +import Shared.Data.Package exposing (Package) +import Shared.Data.Pagination exposing (Pagination) +import Shared.Data.Template exposing (Template) +import Shared.Error.ApiError as ApiError exposing (ApiError) +import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget as CreateKnowledgeModelWidget import Wizard.Dashboard.Widgets.CreateProjectTemplateWidget as CreateProjectTemplateWidget import Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget as ImportDocumentTemplateWidget import Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget as ImportKnowledgeModelWidget +import Wizard.Dashboard.Widgets.OutdatedPackagesWidget as OutdatedPackagesWidget +import Wizard.Dashboard.Widgets.OutdatedTemplatesWidget as OutdatedTemplatesWidget import Wizard.Dashboard.Widgets.WelcomeWidget as WelcomeWidget -view : AppState -> Html msg -view appState = +type alias Model = + { packages : ActionResult (List Package) + , templates : ActionResult (List Template) + } + + +initialModel : Model +initialModel = + { packages = ActionResult.Loading + , templates = ActionResult.Loading + } + + +type Msg + = GetPackagesComplete (Result ApiError (Pagination Package)) + | GetTemplatesComplete (Result ApiError (Pagination Template)) + + +fetchData : AppState -> Cmd Msg +fetchData appState = + let + packagesCmd = + PackagesApi.getOutdatedPackages appState GetPackagesComplete + + templatesCmd = + TemplatesApi.getOutdatedTemplates appState GetTemplatesComplete + in + Cmd.batch [ packagesCmd, templatesCmd ] + + +update : Msg -> AppState -> Model -> Model +update msg appState model = + case msg of + GetPackagesComplete result -> + case result of + Ok data -> + { model | packages = ActionResult.Success data.items } + + Err error -> + { model | packages = ApiError.toActionResult appState (lg "apiError.packages.getListError" appState) error } + + GetTemplatesComplete result -> + case result of + Ok data -> + { model | templates = ActionResult.Success data.items } + + Err error -> + { model | templates = ApiError.toActionResult appState (lg "apiError.templates.getListError" appState) error } + + +view : AppState -> Model -> Html msg +view appState model = div [] [ div [ class "row gx-3" ] [ WelcomeWidget.view appState + , OutdatedPackagesWidget.view appState model.packages + , OutdatedTemplatesWidget.view appState model.templates , CreateKnowledgeModelWidget.view appState , CreateProjectTemplateWidget.view appState , ImportKnowledgeModelWidget.view appState diff --git a/engine-wizard/elm/Wizard/Dashboard/Models.elm b/engine-wizard/elm/Wizard/Dashboard/Models.elm index 2675c7d4f..604c9ba39 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Models.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Models.elm @@ -9,12 +9,14 @@ import Shared.Auth.Session as Session import Shared.Data.BootstrapConfig.DashboardConfig.DashboardType as DashboardType import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Dashboards.AdminDashboard as AdminDashboard +import Wizard.Dashboard.Dashboards.DataStewardDashboard as DataStewardDashboard import Wizard.Dashboard.Dashboards.ResearcherDashboard as ResearcherDashboard type alias Model = { currentDashboard : CurrentDashboard , researcherDashboardModel : ResearcherDashboard.Model + , dataStewardDashboardModel : DataStewardDashboard.Model , adminDashboardModel : AdminDashboard.Model } @@ -43,5 +45,6 @@ initialModel appState = in { currentDashboard = currentDashboard , researcherDashboardModel = ResearcherDashboard.initialModel + , dataStewardDashboardModel = DataStewardDashboard.initialModel , adminDashboardModel = AdminDashboard.initialModel } diff --git a/engine-wizard/elm/Wizard/Dashboard/Msgs.elm b/engine-wizard/elm/Wizard/Dashboard/Msgs.elm index d912d7193..4afb53dcf 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Msgs.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Msgs.elm @@ -1,9 +1,11 @@ module Wizard.Dashboard.Msgs exposing (Msg(..)) import Wizard.Dashboard.Dashboards.AdminDashboard as AdminDashboard +import Wizard.Dashboard.Dashboards.DataStewardDashboard as DataStewardDashboard import Wizard.Dashboard.Dashboards.ResearcherDashboard as ResearcherDashboard type Msg = ResearcherDashboardMsg ResearcherDashboard.Msg + | DataStewardDashboardMsg DataStewardDashboard.Msg | AdminDashboardMsg AdminDashboard.Msg diff --git a/engine-wizard/elm/Wizard/Dashboard/Update.elm b/engine-wizard/elm/Wizard/Dashboard/Update.elm index dba05a301..4f4222a41 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Update.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Update.elm @@ -5,6 +5,7 @@ module Wizard.Dashboard.Update exposing import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Dashboards.AdminDashboard as AdminDashboard +import Wizard.Dashboard.Dashboards.DataStewardDashboard as DataStewardDashboard import Wizard.Dashboard.Dashboards.ResearcherDashboard as ResearcherDashboard import Wizard.Dashboard.Models exposing (CurrentDashboard(..), Model) import Wizard.Dashboard.Msgs exposing (Msg(..)) @@ -18,6 +19,10 @@ fetchData appState model = Cmd.map ResearcherDashboardMsg <| ResearcherDashboard.fetchData appState + DataStewardDashboard -> + Cmd.map DataStewardDashboardMsg <| + DataStewardDashboard.fetchData appState + AdminDashboard -> Cmd.map AdminDashboardMsg <| AdminDashboard.fetchData appState @@ -34,6 +39,11 @@ update msg appState model = , Cmd.none ) + DataStewardDashboardMsg dataStewardDashboardMsg -> + ( { model | dataStewardDashboardModel = DataStewardDashboard.update dataStewardDashboardMsg appState model.dataStewardDashboardModel } + , Cmd.none + ) + AdminDashboardMsg adminDashboardMsg -> ( { model | adminDashboardModel = AdminDashboard.update adminDashboardMsg appState model.adminDashboardModel } , Cmd.none diff --git a/engine-wizard/elm/Wizard/Dashboard/View.elm b/engine-wizard/elm/Wizard/Dashboard/View.elm index 6c0e3713b..b9b03070d 100644 --- a/engine-wizard/elm/Wizard/Dashboard/View.elm +++ b/engine-wizard/elm/Wizard/Dashboard/View.elm @@ -26,7 +26,7 @@ view appState model = ResearcherDashboard.view appState model.researcherDashboardModel DataStewardDashboard -> - DataStewardDashboard.view appState + DataStewardDashboard.view appState model.dataStewardDashboardModel AdminDashboard -> AdminDashboard.view appState model.adminDashboardModel diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm new file mode 100644 index 000000000..5c6dcc940 --- /dev/null +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm @@ -0,0 +1,60 @@ +module Wizard.Dashboard.Widgets.OutdatedPackagesWidget exposing (view) + +import ActionResult exposing (ActionResult) +import Html exposing (Html, code, div, h2, strong, text) +import Html.Attributes exposing (class) +import Shared.Components.Badge as Badge +import Shared.Data.Package exposing (Package) +import Shared.Html exposing (emptyNode) +import Shared.Locale exposing (lx) +import Wizard.Common.AppState exposing (AppState) +import Wizard.Common.Html exposing (linkTo) +import Wizard.Common.View.ItemIcon as ItemIcon +import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers +import Wizard.Routes as Routes + + +lx_ : String -> AppState -> Html msg +lx_ = + lx "Wizard.Dashboard.Widgets.OutdatedPackagesWidget" + + +view : AppState -> ActionResult (List Package) -> Html msg +view appState packages = + case packages of + ActionResult.Success packageList -> + if not (List.isEmpty packageList) then + viewWidget appState packageList + + else + emptyNode + + _ -> + emptyNode + + +viewWidget : AppState -> List Package -> Html msg +viewWidget appState packages = + WidgetHelpers.widget + [ div [ class "d-flex flex-column h-100" ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "title" appState ] + , div [ class "mb-4" ] [ lx_ "description" appState ] + , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewPackage appState) packages) + ] + ] + + +viewPackage : AppState -> Package -> Html msg +viewPackage appState package = + linkTo appState + (Routes.knowledgeModelsDetail package.id) + [ class "p-2 py-2 d-flex rounded-3" ] + [ ItemIcon.view { text = package.name, image = Nothing } + , div [ class "ms-2 flex-grow-1 content" ] + [ strong [] [ text package.name ] + , div [ class "d-flex align-items-center mt-1" ] + [ code [] [ text package.id ] + , Badge.warning [ class "ms-2" ] [ lx_ "updateBadge" appState ] + ] + ] + ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm new file mode 100644 index 000000000..c118bd635 --- /dev/null +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm @@ -0,0 +1,60 @@ +module Wizard.Dashboard.Widgets.OutdatedTemplatesWidget exposing (view) + +import ActionResult exposing (ActionResult) +import Html exposing (Html, code, div, h2, strong, text) +import Html.Attributes exposing (class) +import Shared.Components.Badge as Badge +import Shared.Data.Template exposing (Template) +import Shared.Html exposing (emptyNode) +import Shared.Locale exposing (lx) +import Wizard.Common.AppState exposing (AppState) +import Wizard.Common.Html exposing (linkTo) +import Wizard.Common.View.ItemIcon as ItemIcon +import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers +import Wizard.Routes as Routes + + +lx_ : String -> AppState -> Html msg +lx_ = + lx "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget" + + +view : AppState -> ActionResult (List Template) -> Html msg +view appState templates = + case templates of + ActionResult.Success templateList -> + if not (List.isEmpty templateList) then + viewWidget appState templateList + + else + emptyNode + + _ -> + emptyNode + + +viewWidget : AppState -> List Template -> Html msg +viewWidget appState templates = + WidgetHelpers.widget + [ div [ class "d-flex flex-column h-100" ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "title" appState ] + , div [ class "mb-4" ] [ lx_ "description" appState ] + , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewTemplate appState) templates) + ] + ] + + +viewTemplate : AppState -> Template -> Html msg +viewTemplate appState template = + linkTo appState + (Routes.templatesDetail template.id) + [ class "p-2 py-2 d-flex rounded-3" ] + [ ItemIcon.view { text = template.name, image = Nothing } + , div [ class "ms-2 flex-grow-1 content" ] + [ strong [] [ text template.name ] + , div [ class "d-flex align-items-center mt-1" ] + [ code [] [ text template.id ] + , Badge.warning [ class "ms-2" ] [ lx_ "updateBadge" appState ] + ] + ] + ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm index b1ed54526..269ff3e18 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm @@ -45,7 +45,7 @@ viewRecentProjects : AppState -> List Questionnaire -> List (Html msg) viewRecentProjects appState questionnaires = [ div [ class "RecentProjectsWidget d-flex flex-column h-100" ] [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "heading" appState ] - , div [ class "RecentProjectsWidget__ProjectList flex-grow-1" ] (List.map (viewProject appState) questionnaires) + , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewProject appState) questionnaires) , div [ class "mt-4" ] [ linkTo appState (Routes.projectsIndex appState) [] [ lx_ "viewAll" appState ] ] ] diff --git a/engine-wizard/scss/modules/_Dashboard.scss b/engine-wizard/scss/modules/_Dashboard.scss index 5cdf7897d..fca8c544b 100644 --- a/engine-wizard/scss/modules/_Dashboard.scss +++ b/engine-wizard/scss/modules/_Dashboard.scss @@ -32,44 +32,43 @@ } } - .RecentProjectsWidget { - &__ProjectList { - a { - color: $body-color; - text-decoration: none !important; - position: relative; + &__ItemList { + a { + color: $body-color; + text-decoration: none !important; + position: relative; - &:not(:last-child):after { - content: ' '; - border-bottom: 1px solid $gray-200; - position: absolute; - bottom: -1px; - left: 0.3rem; - right: 0.3rem; - } + &:not(:last-child):after { + content: ' '; + border-bottom: 1px solid $gray-200; + position: absolute; + bottom: -1px; + left: 0.3rem; + right: 0.3rem; + } - &:hover { - background-color: $gray-200; - border-bottom-color: transparent; + &:hover { + background-color: $gray-200; + border-bottom-color: transparent; - &:after { - display: none; - } + &:after { + display: none; } + } - .content { - flex-basis: 0; - min-width: 0; + .content { + flex-basis: 0; + min-width: 0; - strong { - white-space: nowrap; - overflow: hidden; - display: block; - max-width: 100%; - text-overflow: ellipsis; - } + strong { + white-space: nowrap; + overflow: hidden; + display: block; + max-width: 100%; + text-overflow: ellipsis; } } } } } + From 40bb74319ee525783f5047b55416f306ff4efb85 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Fri, 21 Oct 2022 15:54:40 +0200 Subject: [PATCH 06/21] Add session state to auth callback --- engine-shared/elm/Shared/Api/Auth.elm | 6 +++--- engine-wizard/elm/Wizard/Public/Auth/Update.elm | 6 +++--- engine-wizard/elm/Wizard/Public/Models.elm | 2 +- engine-wizard/elm/Wizard/Public/Routes.elm | 2 +- engine-wizard/elm/Wizard/Public/Routing.elm | 16 ++++++++++------ engine-wizard/elm/Wizard/Public/Update.elm | 4 ++-- engine-wizard/elm/Wizard/Public/View.elm | 2 +- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/engine-shared/elm/Shared/Api/Auth.elm b/engine-shared/elm/Shared/Api/Auth.elm index ee6b14172..4e47e8c67 100644 --- a/engine-shared/elm/Shared/Api/Auth.elm +++ b/engine-shared/elm/Shared/Api/Auth.elm @@ -7,9 +7,9 @@ import Shared.Data.Token as Token exposing (Token) import String.Extra as String -getToken : String -> Maybe String -> Maybe String -> AbstractAppState a -> ToMsg Token msg -> Cmd msg -getToken id mbError mbCode = - httpGet ("/auth/" ++ id ++ "/callback?error=" ++ String.fromMaybe mbError ++ "&code=" ++ String.fromMaybe mbCode ++ "&nonce=FtEIbRdfFc7z2bNjCTaZKDcWNeUKUelvs13K21VL") Token.decoder +getToken : String -> Maybe String -> Maybe String -> Maybe String -> AbstractAppState a -> ToMsg Token msg -> Cmd msg +getToken id mbError mbCode mbSessionState = + httpGet ("/auth/" ++ id ++ "/callback?error=" ++ String.fromMaybe mbError ++ "&code=" ++ String.fromMaybe mbCode ++ "&session_state=" ++ String.fromMaybe mbSessionState ++ "&nonce=FtEIbRdfFc7z2bNjCTaZKDcWNeUKUelvs13K21VL") Token.decoder authRedirectUrl : OpenIDServiceConfig -> AbstractAppState a -> String diff --git a/engine-wizard/elm/Wizard/Public/Auth/Update.elm b/engine-wizard/elm/Wizard/Public/Auth/Update.elm index e30fa2cd3..3859d53e0 100644 --- a/engine-wizard/elm/Wizard/Public/Auth/Update.elm +++ b/engine-wizard/elm/Wizard/Public/Auth/Update.elm @@ -11,9 +11,9 @@ import Wizard.Public.Auth.Models exposing (Model) import Wizard.Public.Auth.Msgs exposing (Msg(..)) -fetchData : String -> Maybe String -> Maybe String -> AppState -> Cmd Msg -fetchData id error code appState = - AuthApi.getToken id error code appState AuthenticationCompleted +fetchData : String -> Maybe String -> Maybe String -> Maybe String -> AppState -> Cmd Msg +fetchData id error code appState sessionState = + AuthApi.getToken id error code appState sessionState AuthenticationCompleted update : Msg -> AppState -> Model -> ( Model, Cmd Wizard.Msgs.Msg ) diff --git a/engine-wizard/elm/Wizard/Public/Models.elm b/engine-wizard/elm/Wizard/Public/Models.elm index 4a3eb0c9c..ba3aacabb 100644 --- a/engine-wizard/elm/Wizard/Public/Models.elm +++ b/engine-wizard/elm/Wizard/Public/Models.elm @@ -37,7 +37,7 @@ initialModel appState = initLocalModel : AppState -> Route -> Model -> Model initLocalModel appState route model = case route of - AuthCallback _ _ _ -> + AuthCallback _ _ _ _ -> { model | authModel = Wizard.Public.Auth.Models.initialModel } BookReferenceRoute _ -> diff --git a/engine-wizard/elm/Wizard/Public/Routes.elm b/engine-wizard/elm/Wizard/Public/Routes.elm index 5ef0aee5b..add92e819 100644 --- a/engine-wizard/elm/Wizard/Public/Routes.elm +++ b/engine-wizard/elm/Wizard/Public/Routes.elm @@ -2,7 +2,7 @@ module Wizard.Public.Routes exposing (Route(..)) type Route - = AuthCallback String (Maybe String) (Maybe String) + = AuthCallback String (Maybe String) (Maybe String) (Maybe String) | BookReferenceRoute String | ForgottenPasswordRoute | ForgottenPasswordConfirmationRoute String String diff --git a/engine-wizard/elm/Wizard/Public/Routing.elm b/engine-wizard/elm/Wizard/Public/Routing.elm index 74c8893d3..09b8db8ed 100644 --- a/engine-wizard/elm/Wizard/Public/Routing.elm +++ b/engine-wizard/elm/Wizard/Public/Routing.elm @@ -23,7 +23,7 @@ parsers appState wrapRoute = else [] in - [ map (authCallback wrapRoute) (s "auth" string s "callback" Query.string "error" Query.string "code") + [ map (authCallback wrapRoute) (s "auth" string s "callback" Query.string "error" Query.string "code" Query.string "session_state") , map (wrapRoute << BookReferenceRoute) (s (lr "public.bookReferences" appState) string) , map (wrapRoute <| ForgottenPasswordRoute) (s (lr "public.forgottenPassword" appState)) , map (forgottenPasswordConfirmation wrapRoute) (s (lr "public.forgottenPassword" appState) string string) @@ -32,9 +32,9 @@ parsers appState wrapRoute = ++ signUpRoutes -authCallback : (Route -> a) -> String -> Maybe String -> Maybe String -> a -authCallback wrapRoute id error code = - AuthCallback id error code |> wrapRoute +authCallback : (Route -> a) -> String -> Maybe String -> Maybe String -> Maybe String -> a +authCallback wrapRoute id error code sessionState = + AuthCallback id error code sessionState |> wrapRoute signupConfirmation : (Route -> a) -> String -> String -> a @@ -50,8 +50,12 @@ forgottenPasswordConfirmation wrapRoute userId hash = toUrl : AppState -> Route -> List String toUrl appState route = case route of - AuthCallback id error code -> - [ "auth", id, "callback", "?error=" ++ Maybe.withDefault "" error ++ "&code=" ++ Maybe.withDefault "" code ] + AuthCallback id error code sessionState -> + [ "auth" + , id + , "callback" + , "?error=" ++ Maybe.withDefault "" error ++ "&code=" ++ Maybe.withDefault "" code ++ "&session_state=" ++ Maybe.withDefault "" sessionState + ] BookReferenceRoute uuid -> [ lr "public.bookReferences" appState, uuid ] diff --git a/engine-wizard/elm/Wizard/Public/Update.elm b/engine-wizard/elm/Wizard/Public/Update.elm index 064062521..a3edd2837 100644 --- a/engine-wizard/elm/Wizard/Public/Update.elm +++ b/engine-wizard/elm/Wizard/Public/Update.elm @@ -17,9 +17,9 @@ import Wizard.Public.SignupConfirmation.Update fetchData : Route -> AppState -> Cmd Msg fetchData route appState = case route of - AuthCallback id error code -> + AuthCallback id error code sessionState -> Cmd.map AuthMsg <| - Wizard.Public.Auth.Update.fetchData id error code appState + Wizard.Public.Auth.Update.fetchData id error code sessionState appState BookReferenceRoute uuid -> Cmd.map BookReferenceMsg <| diff --git a/engine-wizard/elm/Wizard/Public/View.elm b/engine-wizard/elm/Wizard/Public/View.elm index 662a81c61..8716be645 100644 --- a/engine-wizard/elm/Wizard/Public/View.elm +++ b/engine-wizard/elm/Wizard/Public/View.elm @@ -17,7 +17,7 @@ import Wizard.Public.SignupConfirmation.View view : Route -> AppState -> Model -> Html Msg view route appState model = case route of - AuthCallback _ _ _ -> + AuthCallback _ _ _ _ -> Html.map AuthMsg <| Wizard.Public.Auth.View.view appState model.authModel From 01bd6acfb819694cb0c0955e06b7e32a02e19e5d Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Fri, 28 Oct 2022 14:14:14 +0200 Subject: [PATCH 07/21] [DSW-1552] Add gettext --- .github/workflows/pot.yml | 57 + engine-registry/elm/Registry.elm | 38 +- .../elm/Registry/Common/AppState.elm | 6 +- .../Common/Provisioning/DefaultLocale.elm | 82 +- .../elm/Registry/Pages/ForgottenToken.elm | 26 +- .../Pages/ForgottenTokenConfirmation.elm | 32 +- engine-registry/elm/Registry/Pages/Index.elm | 9 +- .../elm/Registry/Pages/KMDetail.elm | 32 +- engine-registry/elm/Registry/Pages/Login.elm | 26 +- .../elm/Registry/Pages/Organization.elm | 30 +- engine-registry/elm/Registry/Pages/Signup.elm | 48 +- .../elm/Registry/Pages/SignupConfirmation.elm | 31 +- .../elm/Registry/Pages/TemplateDetail.elm | 30 +- .../elm/Registry/Pages/Templates.elm | 9 +- engine-shared/elm/Shared/Auth/Role.elm | 31 +- .../Common/Provisioning/DefaultIconSet.elm | 6 - .../Common/Provisioning/DefaultLocale.elm | 87 -- engine-shared/elm/Shared/Common/TimeUtils.elm | 29 +- .../Questionnaire/QuestionnaireCreation.elm | 17 +- .../Questionnaire/QuestionnaireSharing.elm | 21 +- .../Questionnaire/QuestionnaireVisibility.elm | 21 +- .../Shared/Data/QuestionnairePermission.elm | 11 +- engine-shared/elm/Shared/Error/ApiError.elm | 4 +- .../elm/Shared/Error/ServerError.elm | 66 +- engine-shared/elm/Shared/Form.elm | 40 +- engine-shared/elm/Shared/Form/Validate.elm | 22 +- engine-shared/elm/Shared/Locale.elm | 49 +- .../elm/Wizard/Apps/Create/Update.elm | 4 +- engine-wizard/elm/Wizard/Apps/Create/View.elm | 21 +- .../elm/Wizard/Apps/Detail/Update.elm | 12 +- engine-wizard/elm/Wizard/Apps/Detail/View.elm | 95 +- .../elm/Wizard/Apps/Index/Update.elm | 4 +- engine-wizard/elm/Wizard/Apps/Index/View.elm | 36 +- engine-wizard/elm/Wizard/Auth/Update.elm | 4 +- engine-wizard/elm/Wizard/Common/Api.elm | 10 +- engine-wizard/elm/Wizard/Common/AppState.elm | 3 + .../Wizard/Common/Components/Listing/View.elm | 32 +- .../Wizard/Common/Components/OnlineUser.elm | 44 +- .../Wizard/Common/Components/PlansList.elm | 26 +- .../Common/Components/Questionnaire.elm | 186 +-- .../DefaultQuestionnaireRenderer.elm | 26 +- .../Questionnaire/DeleteVersionModal.elm | 32 +- .../Questionnaire/FeedbackModal.elm | 64 +- .../Components/Questionnaire/History.elm | 33 +- .../Questionnaire/NavigationTree.elm | 12 +- .../Components/Questionnaire/VersionModal.elm | 17 +- .../Components/QuestionnaireVersionTag.elm | 9 +- .../Common/Components/SummaryReport.elm | 33 +- .../Common/Components/TypeHintInput.elm | 11 +- .../Components/TypeHintInput/TypeHintItem.elm | 4 +- .../Wizard/Common/Components/UsageTable.elm | 23 +- engine-wizard/elm/Wizard/Common/Flags.elm | 4 + .../elm/Wizard/Common/Menu/Update.elm | 9 +- engine-wizard/elm/Wizard/Common/Menu/View.elm | 88 +- .../Common/Provisioning/DefaultIconSet.elm | 271 ++-- .../Common/Provisioning/DefaultLocale.elm | 1375 +---------------- .../elm/Wizard/Common/TimeDistance.elm | 94 +- .../elm/Wizard/Common/View/Flash.elm | 9 +- .../elm/Wizard/Common/View/FormActions.elm | 15 +- .../elm/Wizard/Common/View/FormGroup.elm | 28 +- .../elm/Wizard/Common/View/Layout.elm | 26 +- .../elm/Wizard/Common/View/Modal.elm | 11 +- engine-wizard/elm/Wizard/Common/View/Page.elm | 16 +- engine-wizard/elm/Wizard/Common/View/Tag.elm | 24 +- .../Dashboard/Dashboards/AdminDashboard.elm | 8 +- .../Dashboards/DataStewardDashboard.elm | 6 +- .../Dashboards/ResearcherDashboard.elm | 4 +- .../Dashboard/Dashboards/WelcomeDashboard.elm | 10 +- .../Dashboard/Widgets/AddOpenIDWidget.elm | 13 +- .../Widgets/ConfigureLookAndFeelWidget.elm | 15 +- .../Widgets/ConfigureOrganizationWidget.elm | 13 +- .../Widgets/ConnectRegistryWidget.elm | 13 +- .../Widgets/CreateKnowledgeModelWidget.elm | 13 +- .../Widgets/CreateProjectTemplateWidget.elm | 13 +- .../Dashboard/Widgets/CreateProjectWidget.elm | 13 +- .../Widgets/ImportDocumentTemplateWidget.elm | 13 +- .../Widgets/ImportKnowledgeModelWidget.elm | 13 +- .../Widgets/OutdatedPackagesWidget.elm | 13 +- .../Widgets/OutdatedTemplatesWidget.elm | 13 +- .../Widgets/RecentProjectsWidget.elm | 13 +- .../Wizard/Dashboard/Widgets/UsageWidget.elm | 6 +- .../Dashboard/Widgets/WelcomeWidget.elm | 23 +- .../elm/Wizard/Documents/Index/Update.elm | 12 +- .../elm/Wizard/Documents/Index/View.elm | 89 +- .../Wizard/KMEditor/Common/DeleteModal.elm | 21 +- .../Wizard/KMEditor/Common/UpgradeModal.elm | 27 +- .../elm/Wizard/KMEditor/Create/Update.elm | 8 +- .../elm/Wizard/KMEditor/Create/View.elm | 21 +- .../KMEditor/Editor/Common/EditorBranch.elm | 73 +- .../KMEditor/Editor/Components/KMEditor.elm | 324 ++-- .../Editor/Components/KMEditor/Input.elm | 35 +- .../Editor/Components/KMEditor/Tree.elm | 31 +- .../Editor/Components/KMEditor/TreeInput.elm | 17 +- .../KMEditor/Editor/Components/Preview.elm | 15 +- .../KMEditor/Editor/Components/Settings.elm | 38 +- .../KMEditor/Editor/Components/TagEditor.elm | 21 +- .../elm/Wizard/KMEditor/Editor/Update.elm | 13 +- .../elm/Wizard/KMEditor/Editor/View.elm | 34 +- .../elm/Wizard/KMEditor/Index/Update.elm | 8 +- .../elm/Wizard/KMEditor/Index/View.elm | 56 +- .../elm/Wizard/KMEditor/Migration/Update.elm | 6 +- .../elm/Wizard/KMEditor/Migration/View.elm | 520 +++---- .../elm/Wizard/KMEditor/Publish/Update.elm | 6 +- .../elm/Wizard/KMEditor/Publish/View.elm | 53 +- .../Wizard/KnowledgeModels/Detail/Update.elm | 6 +- .../Wizard/KnowledgeModels/Detail/View.elm | 68 +- .../Import/FileImport/Update.elm | 4 +- .../Import/FileImport/View.elm | 20 +- .../Import/OwlImport/Update.elm | 4 +- .../KnowledgeModels/Import/OwlImport/View.elm | 32 +- .../Import/RegistryImport/Update.elm | 4 +- .../Import/RegistryImport/View.elm | 36 +- .../Wizard/KnowledgeModels/Import/View.elm | 22 +- .../Wizard/KnowledgeModels/Index/Update.elm | 6 +- .../elm/Wizard/KnowledgeModels/Index/View.elm | 57 +- .../Wizard/KnowledgeModels/Preview/Update.elm | 10 +- .../Wizard/KnowledgeModels/Preview/View.elm | 9 +- .../Wizard/ProjectImporters/Index/Update.elm | 8 +- .../Wizard/ProjectImporters/Index/View.elm | 28 +- .../Common/CloneProjectModal/Update.elm | 6 +- .../Common/CloneProjectModal/View.elm | 29 +- .../Common/DeleteProjectModal/Update.elm | 6 +- .../Common/DeleteProjectModal/View.elm | 22 +- .../QuestionnaireEditFormMemberPerms.elm | 10 +- .../elm/Wizard/Projects/Common/View.elm | 15 +- .../Projects/Create/CustomCreate/Update.elm | 8 +- .../Projects/Create/CustomCreate/View.elm | 13 +- .../Projects/Create/TemplateCreate/Update.elm | 8 +- .../Projects/Create/TemplateCreate/View.elm | 15 +- .../elm/Wizard/Projects/Create/View.elm | 20 +- .../Projects/CreateMigration/Update.elm | 10 +- .../Wizard/Projects/CreateMigration/View.elm | 32 +- .../Detail/Components/NewDocument.elm | 43 +- .../Projects/Detail/Components/Preview.elm | 45 +- .../Detail/Components/ProjectSaving.elm | 13 +- .../Detail/Components/RevertModal.elm | 24 +- .../Projects/Detail/Components/Settings.elm | 52 +- .../Components/Settings/DeleteModal.elm | 26 +- .../Projects/Detail/Components/ShareModal.elm | 43 +- .../Projects/Detail/Documents/Update.elm | 12 +- .../Wizard/Projects/Detail/Documents/View.elm | 92 +- .../elm/Wizard/Projects/Detail/Update.elm | 15 +- .../elm/Wizard/Projects/Detail/View.elm | 42 +- .../elm/Wizard/Projects/Import/Update.elm | 8 +- .../elm/Wizard/Projects/Import/View.elm | 32 +- .../elm/Wizard/Projects/Index/Update.elm | 18 +- .../elm/Wizard/Projects/Index/View.elm | 78 +- .../elm/Wizard/Projects/Migration/Update.elm | 6 +- .../elm/Wizard/Projects/Migration/View.elm | 48 +- .../elm/Wizard/Public/Auth/Update.elm | 4 +- .../Wizard/Public/BookReference/Update.elm | 4 +- .../elm/Wizard/Public/BookReference/View.elm | 19 +- .../Public/ForgottenPassword/Update.elm | 4 +- .../Wizard/Public/ForgottenPassword/View.elm | 17 +- .../ForgottenPasswordConfirmation/Update.elm | 4 +- .../ForgottenPasswordConfirmation/View.elm | 39 +- .../elm/Wizard/Public/Login/Update.elm | 4 +- .../elm/Wizard/Public/Login/View.elm | 26 +- .../elm/Wizard/Public/Signup/Update.elm | 4 +- .../elm/Wizard/Public/Signup/View.elm | 62 +- .../Public/SignupConfirmation/Update.elm | 4 +- .../Wizard/Public/SignupConfirmation/View.elm | 24 +- .../RegistrySignupConfirmation/Update.elm | 4 +- .../RegistrySignupConfirmation/View.elm | 24 +- .../Wizard/Settings/Authentication/View.elm | 62 +- .../elm/Wizard/Settings/Dashboard/View.elm | 36 +- .../elm/Wizard/Settings/Generic/Update.elm | 6 +- .../elm/Wizard/Settings/Generic/View.elm | 9 +- .../Wizard/Settings/KnowledgeModels/View.elm | 34 +- .../Settings/LookAndFeel/LogoUploadModal.elm | 26 +- .../elm/Wizard/Settings/LookAndFeel/View.elm | 40 +- .../elm/Wizard/Settings/Organization/View.elm | 25 +- .../elm/Wizard/Settings/Plans/Update.elm | 4 +- .../elm/Wizard/Settings/Plans/View.elm | 9 +- .../Settings/PrivacyAndSupport/View.elm | 40 +- .../elm/Wizard/Settings/Projects/View.elm | 61 +- .../elm/Wizard/Settings/Registry/Update.elm | 6 +- .../elm/Wizard/Settings/Registry/View.elm | 48 +- .../elm/Wizard/Settings/Submission/Update.elm | 4 +- .../elm/Wizard/Settings/Submission/View.elm | 66 +- .../elm/Wizard/Settings/Template/Update.elm | 4 +- .../elm/Wizard/Settings/Template/View.elm | 13 +- .../elm/Wizard/Settings/Usage/Update.elm | 4 +- .../elm/Wizard/Settings/Usage/View.elm | 9 +- engine-wizard/elm/Wizard/Settings/View.elm | 44 +- .../elm/Wizard/Templates/Detail/Update.elm | 6 +- .../elm/Wizard/Templates/Detail/View.elm | 69 +- .../Templates/Import/FileImport/Update.elm | 4 +- .../Templates/Import/FileImport/View.elm | 20 +- .../Import/RegistryImport/Update.elm | 4 +- .../Templates/Import/RegistryImport/View.elm | 35 +- .../elm/Wizard/Templates/Import/View.elm | 20 +- .../elm/Wizard/Templates/Index/Update.elm | 6 +- .../elm/Wizard/Templates/Index/View.elm | 51 +- .../elm/Wizard/Users/Create/Update.elm | 4 +- .../elm/Wizard/Users/Create/View.elm | 23 +- .../elm/Wizard/Users/Edit/Update.elm | 12 +- engine-wizard/elm/Wizard/Users/Edit/View.elm | 54 +- .../elm/Wizard/Users/Index/Update.elm | 6 +- engine-wizard/elm/Wizard/Users/Index/View.elm | 42 +- engine-wizard/elm/Wizard/View.elm | 15 +- engine-wizard/index.js | 45 +- package-lock.json | 142 +- package.json | 18 +- scripts/apply-locale.js | 19 - scripts/create-pot-file.js | 90 ++ scripts/extract-locale.js | 23 - scripts/test-locale.js | 2 +- vendor/Gettext.elm | 105 ++ vendor/Gettext/Plural.elm | 458 ++++++ 210 files changed, 3314 insertions(+), 5071 deletions(-) create mode 100644 .github/workflows/pot.yml delete mode 100644 engine-shared/elm/Shared/Common/Provisioning/DefaultIconSet.elm delete mode 100644 engine-shared/elm/Shared/Common/Provisioning/DefaultLocale.elm delete mode 100644 scripts/apply-locale.js create mode 100644 scripts/create-pot-file.js delete mode 100644 scripts/extract-locale.js create mode 100644 vendor/Gettext.elm create mode 100644 vendor/Gettext/Plural.elm diff --git a/.github/workflows/pot.yml b/.github/workflows/pot.yml new file mode 100644 index 000000000..f3d2a35b6 --- /dev/null +++ b/.github/workflows/pot.yml @@ -0,0 +1,57 @@ +name: Gettext CI + +on: + push: + tags: + - v* + +jobs: + pot: + name: Create pot files + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 18.1.0 ] + + steps: + - uses: actions/checkout@v3 + + # (1) -> Preparations + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + # (2) -> Install dependencies + - name: Install + run: | + npm ci + cd wizard-style-builder + npm install fs-extra@10.1.0 sass@1.54.0 + + # (3) -> Build app and Docker image + - name: Build + run: | + npm run pot + + # (4) -> Check prerelease + - name: Check Prerelease + id: check_prerelease + run: | + GITHUB_TAG=`echo $GITHUB_REF | cut -d/ -f3` + if [[ $GITHUB_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::set-output name=is_prerelease::false" + else + echo "::set-output name=is_prerelease::true" + fi + + # (5) -> Create release & upload artifacts + - uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: "locale/wizard.pot,locale/registry.pot" + artifactContentType: text/plain + prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }} + replacesArtifacts: true diff --git a/engine-registry/elm/Registry.elm b/engine-registry/elm/Registry.elm index f84d5fdaf..0359ee21f 100644 --- a/engine-registry/elm/Registry.elm +++ b/engine-registry/elm/Registry.elm @@ -2,7 +2,8 @@ module Registry exposing (Model, Msg, PageModel, main) import Browser exposing (Document, UrlRequest) import Browser.Navigation as Nav -import Html exposing (Html, a, div, img, li, ul) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, img, li, text, ul) import Html.Attributes exposing (class, classList, href, src) import Html.Events exposing (onClick) import Json.Decode as D @@ -23,21 +24,10 @@ import Registry.Pages.Templates as Templates import Registry.Ports as Ports import Registry.Routing as Routing import Registry.Utils exposing (dispatch) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw import Url -l_ : String -> AppState -> String -l_ = - l "Registry" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry" - - main : Program D.Value Model Msg main = Browser.application @@ -333,8 +323,8 @@ view model = if not model.appState.valid then Page.illustratedMessage { image = Undraw.bugFixing - , heading = l_ "view.invalid.heading" model.appState - , msg = l_ "view.invalid.msg" model.appState + , heading = gettext "Configuration Error" model.appState.locale + , msg = gettext "The application is not configured correctly and cannot run." model.appState.locale } else @@ -372,8 +362,8 @@ view model = NotFoundModel -> Page.illustratedMessage { image = Undraw.pageNotFound - , heading = l_ "view.notFound.heading" model.appState - , msg = l_ "view.notFound.msg" model.appState + , heading = gettext "Not Found" model.appState.locale + , msg = gettext "The page you are looking for does not exist." model.appState.locale } html = @@ -382,7 +372,7 @@ view model = [ content ] ] in - { title = l_ "view.title" model.appState + { title = gettext "DSW Registry" model.appState.locale , body = html } @@ -402,7 +392,7 @@ header model = [ div [ class "container" ] [ a [ class "navbar-brand", href <| Routing.toString Routing.Index ] [ img [ class "logo", src "/img/logo.svg" ] [] - , lx_ "header.brandTitle" appState + , text (gettext "DSW Registry" appState.locale) ] , ul [ class "nav navbar-nav" ] [ li @@ -410,14 +400,14 @@ header model = , classList [ ( "active", model.route == Routing.Index ) ] ] [ a [ href <| Routing.toString Routing.Index, class "nav-link" ] - [ lx_ "header.knowledgeModels" appState ] + [ text (gettext "Knowledge Models" appState.locale) ] ] , li [ class "nav-item" , classList [ ( "active", model.route == Routing.Templates ) ] ] [ a [ href <| Routing.toString Routing.Templates, class "nav-link" ] - [ lx_ "header.templates" appState ] + [ text (gettext "Document Templates" appState.locale) ] ] ] , navigation @@ -433,14 +423,14 @@ loggedInHeaderNavigation appState = [ href <| Routing.toString Routing.Organization , class "nav-link" ] - [ lx_ "loggedInNavigation.profile" appState ] + [ text (gettext "Profile" appState.locale) ] ] , li [ class "nav-item" ] [ a [ onClick <| SetCredentials Nothing , class "nav-link" ] - [ lx_ "loggedInNavigation.logOut" appState ] + [ text (gettext "Log Out" appState.locale) ] ] ] @@ -450,11 +440,11 @@ publicHeaderNavigation appState = ul [ class "nav navbar-nav ms-auto" ] [ li [ class "nav-item" ] [ a [ href <| Routing.toString Routing.Login, class "nav-link" ] - [ lx_ "publicHeaderNavigation.logIn" appState ] + [ text (gettext "Log In" appState.locale) ] ] , li [ class "nav-item" ] [ a [ href <| Routing.toString Routing.Signup, class "nav-link" ] - [ lx_ "publicHeaderNavigation.signUp" appState ] + [ text (gettext "Sign Up" appState.locale) ] ] ] diff --git a/engine-registry/elm/Registry/Common/AppState.elm b/engine-registry/elm/Registry/Common/AppState.elm index 04a2639f1..8b19b9785 100644 --- a/engine-registry/elm/Registry/Common/AppState.elm +++ b/engine-registry/elm/Registry/Common/AppState.elm @@ -4,6 +4,7 @@ module Registry.Common.AppState exposing , setCredentials ) +import Gettext import Json.Decode as D import Registry.Common.Credentials exposing (Credentials) import Registry.Common.Flags as Flags @@ -17,6 +18,7 @@ type alias AppState = , valid : Bool , credentials : Maybe Credentials , provisioning : Provisioning + , locale : Gettext.Locale } @@ -41,10 +43,10 @@ init flagsValue = , flags.provisioning ] in - AppState flags.apiUrl True flags.credentials provisioning + AppState flags.apiUrl True flags.credentials provisioning Gettext.defaultLocale Err _ -> - AppState "" False Nothing defaultProvisioning + AppState "" False Nothing defaultProvisioning Gettext.defaultLocale setCredentials : Maybe Credentials -> AppState -> AppState diff --git a/engine-registry/elm/Registry/Common/Provisioning/DefaultLocale.elm b/engine-registry/elm/Registry/Common/Provisioning/DefaultLocale.elm index bdc7e2575..7bbd0dca9 100644 --- a/engine-registry/elm/Registry/Common/Provisioning/DefaultLocale.elm +++ b/engine-registry/elm/Registry/Common/Provisioning/DefaultLocale.elm @@ -1,88 +1,8 @@ module Registry.Common.Provisioning.DefaultLocale exposing (locale) import Dict exposing (Dict) -import Shared.Common.Provisioning.DefaultLocale as SharedLocale locale : Dict String String locale = - Dict.fromList - (SharedLocale.locale - ++ [ ( "Registry.header.brandTitle", "DSW Registry" ) - , ( "Registry.header.knowledgeModels", "Knowledge Models" ) - , ( "Registry.header.templates", "Document Templates" ) - , ( "Registry.loggedInNavigation.logOut", "Log Out" ) - , ( "Registry.loggedInNavigation.profile", "Profile" ) - , ( "Registry.publicHeaderNavigation.logIn", "Log In" ) - , ( "Registry.publicHeaderNavigation.signUp", "Sign Up" ) - , ( "Registry.view.invalid.heading", "Configuration Error" ) - , ( "Registry.view.invalid.msg", "The application is not configured correctly and cannot run." ) - , ( "Registry.view.notFound.heading", "Not Found" ) - , ( "Registry.view.notFound.msg", "The page you are looking for does not exist." ) - , ( "Registry.view.title", "DSW Registry" ) - , ( "Registry.Pages.ForgottenToken.formView.email.label", "Email" ) - , ( "Registry.Pages.ForgottenToken.formView.email.help", "Enter the email you used to register your organization." ) - , ( "Registry.Pages.ForgottenToken.formView.header", "Forgotten Token" ) - , ( "Registry.Pages.ForgottenToken.formView.submit", "Submit" ) - , ( "Registry.Pages.ForgottenToken.success.heading", "Token recovery successful!" ) - , ( "Registry.Pages.ForgottenToken.success.msg", "Check your email address for the recovery link." ) - , ( "Registry.Pages.ForgottenTokenConfirmation.update.putError", "Unable to recover your organization token." ) - , ( "Registry.Pages.ForgottenTokenConfirmation.view.info", "You will use the following token for authentication. Save it to a safe place. You will not be able to see it again." ) - , ( "Registry.Pages.ForgottenTokenConfirmation.view.text", "A new token for your organization %s has been generated!" ) - , ( "Registry.Pages.ForgottenTokenConfirmation.view.title", "Recovered" ) - , ( "Registry.Pages.ForgottenTokenConfirmation.view.token", "Token" ) - , ( "Registry.Pages.Index.update.getError", "Unable to get the packages." ) - , ( "Registry.Pages.KMDetail.update.getError", "Unable to get the package." ) - , ( "Registry.Pages.KMDetail.view.forkOf", "Fork of" ) - , ( "Registry.Pages.KMDetail.view.kmId", "Knowledge Model ID" ) - , ( "Registry.Pages.KMDetail.view.kmId.copied", "Copied!" ) - , ( "Registry.Pages.KMDetail.view.kmId.copy", "Click to copy Knowledge Model ID" ) - , ( "Registry.Pages.KMDetail.view.license", "License" ) - , ( "Registry.Pages.KMDetail.view.metamodelVersion", "Metamodel version" ) - , ( "Registry.Pages.KMDetail.view.otherVersions", "Other versions" ) - , ( "Registry.Pages.KMDetail.view.publishedBy", "Published by" ) - , ( "Registry.Pages.KMDetail.view.version", "Version" ) - , ( "Registry.Pages.Login.update.error", "Login failed." ) - , ( "Registry.Pages.Login.view.header", "Log In" ) - , ( "Registry.Pages.Login.view.organizationId", "Organization ID" ) - , ( "Registry.Pages.Login.view.token", "Token" ) - , ( "Registry.Pages.Login.view.logIn", "Log In" ) - , ( "Registry.Pages.Login.view.forgottenToken", "Forgot your token?" ) - , ( "Registry.Pages.Organization.update.getError", "Unable to get organization detail." ) - , ( "Registry.Pages.Organization.update.putError", "Unable to save changes." ) - , ( "Registry.Pages.Organization.update.putSuccess", "Your changes have been saved." ) - , ( "Registry.Pages.Organization.view.title", "Edit Organization" ) - , ( "Registry.Pages.Organization.view.organizationName", "Organization Name" ) - , ( "Registry.Pages.Organization.view.description", "Organization Description" ) - , ( "Registry.Pages.Organization.view.email", "Email" ) - , ( "Registry.Pages.Organization.view.save", "Save" ) - , ( "Registry.Pages.Signup.update.postError", "Registration was not successful." ) - , ( "Registry.Pages.Signup.success.heading", "Sign up was successful!" ) - , ( "Registry.Pages.Signup.success.msg", "Check your email address for the activation link." ) - , ( "Registry.Pages.Signup.formView.privacyRead", "I have read %s and %s." ) - , ( "Registry.Pages.Signup.formView.privacy", "Privacy" ) - , ( "Registry.Pages.Signup.formView.privacyError", "You have to read Privacy and Terms of Service first." ) - , ( "Registry.Pages.Signup.formView.termsOfService", "Terms of Service" ) - , ( "Registry.Pages.Signup.formView.title", "Sign Up" ) - , ( "Registry.Pages.Signup.formView.organizationId", "Organization ID" ) - , ( "Registry.Pages.Signup.formView.name", "Organization Name" ) - , ( "Registry.Pages.Signup.formView.email", "Email" ) - , ( "Registry.Pages.Signup.formView.description", "Organization Description" ) - , ( "Registry.Pages.Signup.formView.signUp", "Sign Up" ) - , ( "Registry.Pages.SignupConfirmation.update.putError", "Unable to activate your organization account." ) - , ( "Registry.Pages.SignupConfirmation.viewOrganization.title", "Activated" ) - , ( "Registry.Pages.SignupConfirmation.viewOrganization.activated", "The account for your organization %s has been successfully activated!" ) - , ( "Registry.Pages.SignupConfirmation.viewOrganization.tokenInfo", "You will use the following token for authentication. Save it to a safe place. You will not be able to see it again." ) - , ( "Registry.Pages.SignupConfirmation.viewOrganization.token", "Token" ) - , ( "Registry.Pages.TemplateDetail.update.getError", "Unable to get the template." ) - , ( "Registry.Pages.TemplateDetail.view.templateId", "Template ID" ) - , ( "Registry.Pages.TemplateDetail.view.templateId.copied", "Copied!" ) - , ( "Registry.Pages.TemplateDetail.view.templateId.copy", "Click to copy Template ID" ) - , ( "Registry.Pages.TemplateDetail.view.license", "License" ) - , ( "Registry.Pages.TemplateDetail.view.metamodelVersion", "Metamodel version" ) - , ( "Registry.Pages.TemplateDetail.view.otherVersions", "Other versions" ) - , ( "Registry.Pages.TemplateDetail.view.publishedBy", "Published by" ) - , ( "Registry.Pages.TemplateDetail.view.version", "Version" ) - , ( "Registry.Pages.Templates.update.getError", "Unable to get templates." ) - ] - ) + Dict.empty diff --git a/engine-registry/elm/Registry/Pages/ForgottenToken.elm b/engine-registry/elm/Registry/Pages/ForgottenToken.elm index 1e2f10261..ab37d0517 100644 --- a/engine-registry/elm/Registry/Pages/ForgottenToken.elm +++ b/engine-registry/elm/Registry/Pages/ForgottenToken.elm @@ -10,7 +10,8 @@ module Registry.Pages.ForgottenToken exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Validate as Validate exposing (Validation) -import Html exposing (Html, div, form, p) +import Gettext exposing (gettext) +import Html exposing (Html, div, form, p, text) import Html.Attributes exposing (class) import Html.Events exposing (onSubmit) import Registry.Common.AppState exposing (AppState) @@ -22,20 +23,9 @@ import Registry.Common.View.Page as Page import Result exposing (Result) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.ForgottenToken" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.ForgottenToken" - - init : Model init = { form = initRecoveryForm @@ -125,22 +115,22 @@ successView : AppState -> Html Msg successView appState = Page.illustratedMessage { image = Undraw.confirmation - , heading = l_ "success.heading" appState - , msg = l_ "success.msg" appState + , heading = gettext "Token recovery successful!" appState.locale + , msg = gettext "Check your email address for the recovery link." appState.locale } formView : AppState -> Model -> Html Msg formView appState model = div [ class "card card-form bg-light" ] - [ div [ class "card-header" ] [ lx_ "formView.header" appState ] + [ div [ class "card-header" ] [ text (gettext "Forgotten Token" appState.locale) ] , div [ class "card-body" ] [ form [ onSubmit <| FormMsg Form.Submit ] [ FormResult.errorOnlyView model.submitting - , Html.map FormMsg <| FormGroup.input appState model.form "email" <| l_ "formView.email.label" appState + , Html.map FormMsg <| FormGroup.input appState model.form "email" <| gettext "Email" appState.locale , p [ class "text-muted" ] - [ lx_ "formView.email.help" appState ] - , ActionButton.submit ( l_ "formView.submit" appState, model.submitting ) + [ text (gettext "Enter the email you used to register your organization." appState.locale) ] + , ActionButton.submit ( gettext "Submit" appState.locale, model.submitting ) ] ] ] diff --git a/engine-registry/elm/Registry/Pages/ForgottenTokenConfirmation.elm b/engine-registry/elm/Registry/Pages/ForgottenTokenConfirmation.elm index 315374a24..a74302cd2 100644 --- a/engine-registry/elm/Registry/Pages/ForgottenTokenConfirmation.elm +++ b/engine-registry/elm/Registry/Pages/ForgottenTokenConfirmation.elm @@ -7,6 +7,7 @@ module Registry.Pages.ForgottenTokenConfirmation exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, div, h1, p, strong, text) import Html.Attributes exposing (class) import Registry.Common.AppState exposing (AppState) @@ -14,22 +15,7 @@ import Registry.Common.Entities.OrganizationDetail exposing (OrganizationDetail) import Registry.Common.Requests as Requests import Registry.Common.View.Page as Page import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lh, lx) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.ForgottenTokenConfirmation" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.ForgottenTokenConfirmation" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Registry.Pages.ForgottenTokenConfirmation" +import String.Format as String init : AppState -> String -> String -> ( Model, Cmd Msg ) @@ -70,7 +56,7 @@ update msg appState = case msg of PutOrganizationTokenCompleted result -> ActionResult.apply setOrganization - (ApiError.toActionResult appState (l_ "update.putError" appState)) + (ApiError.toActionResult appState (gettext "Unable to recover your organization token." appState.locale)) result @@ -86,12 +72,16 @@ view appState model = viewOrganization : AppState -> OrganizationDetail -> Html Msg viewOrganization appState organization = div [] - [ h1 [] [ lx_ "view.title" appState ] - , p [] (lh_ "view.text" [ strong [] [ text organization.name ] ] appState) + [ h1 [] [ text (gettext "Recovered" appState.locale) ] + , p [] + (String.formatHtml + (gettext "A new token for your organization %s has been generated!" appState.locale) + [ strong [] [ text organization.name ] ] + ) , div [ class "alert alert-info" ] - [ lx_ "view.info" appState ] + [ text (gettext "You will use the following token for authentication. Save it to a safe place. You will not be able to see it again." appState.locale) ] , div [ class "card" ] - [ div [ class "card-header" ] [ lx_ "view.token" appState ] + [ div [ class "card-header" ] [ text (gettext "Token" appState.locale) ] , div [ class "card-body" ] [ text organization.token ] ] ] diff --git a/engine-registry/elm/Registry/Pages/Index.elm b/engine-registry/elm/Registry/Pages/Index.elm index 1987c1b67..c99cdd006 100644 --- a/engine-registry/elm/Registry/Pages/Index.elm +++ b/engine-registry/elm/Registry/Pages/Index.elm @@ -7,6 +7,7 @@ module Registry.Pages.Index exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, div, h5, p, small, text) import Html.Attributes exposing (class, href) import Registry.Common.AppState exposing (AppState) @@ -15,12 +16,6 @@ import Registry.Common.Requests as Requests import Registry.Common.View.Page as Page import Registry.Routing as Routing import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.Index" init : AppState -> ( Model, Cmd Msg ) @@ -55,7 +50,7 @@ update : Msg -> AppState -> Model -> Model update msg appState = case msg of GetPackagesCompleted result -> - ActionResult.apply setPackages (ApiError.toActionResult appState (l_ "update.getError" appState)) result + ActionResult.apply setPackages (ApiError.toActionResult appState (gettext "Unable to get the packages." appState.locale)) result diff --git a/engine-registry/elm/Registry/Pages/KMDetail.elm b/engine-registry/elm/Registry/Pages/KMDetail.elm index 385bbeb2a..75681e5b0 100644 --- a/engine-registry/elm/Registry/Pages/KMDetail.elm +++ b/engine-registry/elm/Registry/Pages/KMDetail.elm @@ -7,6 +7,7 @@ module Registry.Pages.KMDetail exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, br, code, div, h5, li, p, span, strong, text, ul) import Html.Attributes exposing (class, href, target, title) import Html.Events exposing (onClick) @@ -20,21 +21,10 @@ import Registry.Routing as Routing import Shared.Copy as Copy import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown import Version -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.KMDetail" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.KMDetail" - - init : AppState -> String -> ( Model, Cmd Msg ) init appState packageId = ( { package = Loading @@ -72,7 +62,7 @@ update : Msg -> AppState -> Model -> ( Model, Cmd msg ) update msg appState model = case msg of GetPackageCompleted result -> - ( ActionResult.apply setPackage (ApiError.toActionResult appState (l_ "update.getError" appState)) result model + ( ActionResult.apply setPackage (ApiError.toActionResult appState (gettext "Unable to get the package." appState.locale)) result model , Cmd.none ) @@ -94,17 +84,17 @@ viewDetail appState model package = let viewKmIdCopied = if model.copied then - span [ class "ms-2 text-muted" ] [ lx_ "view.kmId.copied" appState ] + span [ class "ms-2 text-muted" ] [ text (gettext "Copied!" appState.locale) ] else emptyNode viewKmId = - [ h5 [] [ lx_ "view.kmId" appState ] + [ h5 [] [ text (gettext "Knowledge Model ID" appState.locale) ] , p [] [ code [ onClick (CopyKmId package.id) - , title (l_ "view.kmId.copy" appState) + , title (gettext "Click to copy Knowledge Model ID" appState.locale) , class "entity-id" ] [ text package.id ] @@ -113,12 +103,12 @@ viewDetail appState model package = ] viewPublishedBy = - [ h5 [] [ lx_ "view.publishedBy" appState ] + [ h5 [] [ text (gettext "Published by" appState.locale) ] , viewOrganization package.organization ] viewLicense = - [ h5 [] [ lx_ "view.license" appState ] + [ h5 [] [ text (gettext "License" appState.locale) ] , p [] [ a [ href <| "https://spdx.org/licenses/" ++ package.license ++ ".html", target "_blank" ] [ text package.license ] @@ -126,7 +116,7 @@ viewDetail appState model package = ] viewCurrentVersion = - [ h5 [] [ lx_ "view.version" appState ] + [ h5 [] [ text (gettext "Version" appState.locale) ] , p [] [ text <| Version.toString package.version ] ] @@ -142,7 +132,7 @@ viewDetail appState model package = [] versions -> - [ h5 [] [ lx_ "view.otherVersions" appState ] + [ h5 [] [ text (gettext "Other versions" appState.locale) ] , ul [] (List.map viewVersion versions) ] @@ -154,14 +144,14 @@ viewDetail appState model package = ] viewSupportedMetamodel = - [ h5 [] [ lx_ "view.metamodelVersion" appState ] + [ h5 [] [ text (gettext "Metamodel version" appState.locale) ] , p [] [ text <| String.fromInt package.metamodelVersion ] ] viewParentKnowledgeModel = case package.forkOfPackageId of Just parentPackageId -> - [ h5 [] [ lx_ "view.forkOf" appState ] + [ h5 [] [ text (gettext "Fork of" appState.locale) ] , p [] [ a [ href <| Routing.toString <| Routing.KMDetail parentPackageId ] [ text parentPackageId diff --git a/engine-registry/elm/Registry/Pages/Login.elm b/engine-registry/elm/Registry/Pages/Login.elm index 29b9c086a..35bb75998 100644 --- a/engine-registry/elm/Registry/Pages/Login.elm +++ b/engine-registry/elm/Registry/Pages/Login.elm @@ -10,7 +10,8 @@ module Registry.Pages.Login exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Validate as Validate exposing (Validation) -import Html exposing (Html, a, div, form) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, form, text) import Html.Attributes exposing (class, href) import Html.Events exposing (onSubmit) import Registry.Common.AppState exposing (AppState) @@ -22,17 +23,6 @@ import Registry.Common.View.FormResult as FormResult import Registry.Routing as Routing import Shared.Error.ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lx) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.Login" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.Login" init : Model @@ -98,7 +88,7 @@ update { tagger, loginCmd } msg appState model = ( model, loginCmd loginForm ) _ -> - ( { model | loggingIn = Error <| l_ "update.error" appState } + ( { model | loggingIn = Error <| gettext "Login failed." appState.locale } , Cmd.none ) @@ -125,15 +115,15 @@ handleFormMsg tagger formMsg appState model = view : AppState -> Model -> Html Msg view appState model = div [ class "card card-form bg-light" ] - [ div [ class "card-header" ] [ lx_ "view.header" appState ] + [ div [ class "card-header" ] [ text (gettext "Log In" appState.locale) ] , div [ class "card-body" ] [ form [ onSubmit <| FormMsg Form.Submit ] [ FormResult.errorOnlyView model.loggingIn - , Html.map FormMsg <| FormGroup.input appState model.form "organizationId" <| l_ "view.organizationId" appState - , Html.map FormMsg <| FormGroup.password appState model.form "token" <| l_ "view.token" appState + , Html.map FormMsg <| FormGroup.input appState model.form "organizationId" <| gettext "Organization ID" appState.locale + , Html.map FormMsg <| FormGroup.password appState model.form "token" <| gettext "Token" appState.locale , div [ class "d-flex justify-content-between align-items-center" ] - [ ActionButton.submit ( l_ "view.logIn" appState, model.loggingIn ) - , a [ href <| Routing.toString Routing.ForgottenToken ] [ lx_ "view.forgottenToken" appState ] + [ ActionButton.submit ( gettext "Log In" appState.locale, model.loggingIn ) + , a [ href <| Routing.toString Routing.ForgottenToken ] [ text (gettext "Forgot your token?" appState.locale) ] ] ] ] diff --git a/engine-registry/elm/Registry/Pages/Organization.elm b/engine-registry/elm/Registry/Pages/Organization.elm index 91e1527aa..9e7343711 100644 --- a/engine-registry/elm/Registry/Pages/Organization.elm +++ b/engine-registry/elm/Registry/Pages/Organization.elm @@ -11,7 +11,8 @@ import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Field as Field exposing (Field) import Form.Validate as Validate exposing (Validation) -import Html exposing (Html, div, form, h1) +import Gettext exposing (gettext) +import Html exposing (Html, div, form, h1, text) import Html.Events exposing (onSubmit) import Registry.Common.AppState exposing (AppState) import Registry.Common.Credentials exposing (Credentials) @@ -23,17 +24,6 @@ import Registry.Common.View.FormResult as FormResult import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lx) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.Organization" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.Organization" init : AppState -> Credentials -> ( Model, Cmd Msg ) @@ -119,7 +109,7 @@ update msg appState model = handleFormMsg formMsg appState model GetOrganizationCompleted result -> - ( ActionResult.apply setOrganization (ApiError.toActionResult appState (l_ "update.getError" appState)) result model + ( ActionResult.apply setOrganization (ApiError.toActionResult appState (gettext "Unable to get organization detail." appState.locale)) result model , Cmd.none ) @@ -129,13 +119,13 @@ update msg appState model = case result of Ok organization -> { model - | saving = Success <| l_ "update.putSuccess" appState + | saving = Success <| gettext "Your changes have been saved." appState.locale , form = initOrganizationForm <| organizationFormInitials organization } Err err -> { model - | saving = ApiError.toActionResult appState (l_ "update.putError" appState) err + | saving = ApiError.toActionResult appState (gettext "Unable to save changes." appState.locale) err , form = setFormErrors appState err model.form } in @@ -163,12 +153,12 @@ handleFormMsg formMsg appState model = view : AppState -> Model -> Html Msg view appState model = div [] - [ h1 [] [ lx_ "view.title" appState ] + [ h1 [] [ text (gettext "Edit Organization" appState.locale) ] , form [ onSubmit <| FormMsg Form.Submit ] [ FormResult.view model.saving - , Html.map FormMsg <| FormGroup.input appState model.form "name" <| l_ "view.organizationName" appState - , Html.map FormMsg <| FormGroup.textarea appState model.form "description" <| l_ "view.description" appState - , Html.map FormMsg <| FormGroup.input appState model.form "email" <| l_ "view.email" appState - , ActionButton.submit ( l_ "view.save" appState, model.saving ) + , Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Organization Name" appState.locale + , Html.map FormMsg <| FormGroup.textarea appState model.form "description" <| gettext "Organization Description" appState.locale + , Html.map FormMsg <| FormGroup.input appState model.form "email" <| gettext "Email" appState.locale + , ActionButton.submit ( gettext "Save" appState.locale, model.saving ) ] ] diff --git a/engine-registry/elm/Registry/Pages/Signup.elm b/engine-registry/elm/Registry/Pages/Signup.elm index f3af921ee..0b8275477 100644 --- a/engine-registry/elm/Registry/Pages/Signup.elm +++ b/engine-registry/elm/Registry/Pages/Signup.elm @@ -13,7 +13,8 @@ import Form.Error as Error exposing (Error, ErrorValue(..)) import Form.Field as Field exposing (Field) import Form.Input as Input import Form.Validate as Validate exposing (Validation) -import Html exposing (Html, a, div, form, label, p) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, form, label, p, text) import Html.Attributes exposing (class, classList, for, href, id, name, target) import Html.Events exposing (onSubmit) import Registry.Common.AppState exposing (AppState) @@ -27,23 +28,8 @@ import Result exposing (Result) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lh, lx) import Shared.Undraw as Undraw - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.Signup" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.Signup" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Registry.Pages.Signup" +import String.Format as String init : Model @@ -118,7 +104,7 @@ update msg appState model = Err err -> ( { model - | signingUp = ApiError.toActionResult appState (l_ "update.postError" appState) err + | signingUp = ApiError.toActionResult appState (gettext "Registration was not successful." appState.locale) err , form = setFormErrors appState err model.form } , Cmd.none @@ -158,8 +144,8 @@ successView : AppState -> Html Msg successView appState = Page.illustratedMessage { image = Undraw.confirmation - , heading = l_ "success.heading" appState - , msg = l_ "success.msg" appState + , heading = gettext "Sign up was successful!" appState.locale + , msg = gettext "Check your email address for the activation link." appState.locale } @@ -181,28 +167,28 @@ formView appState model = div [ class "form-group form-group-accept", classList [ ( "has-error", hasError ) ] ] [ label [ for "accept" ] (Input.checkboxInput acceptField [ id "accept", name "accept" ] - :: lh_ "formView.privacyRead" + :: String.formatHtml + (gettext "I have read %s and %s." appState.locale) [ a [ href "https://ds-wizard.org/privacy.html", target "_blank" ] - [ lx_ "formView.privacy" appState ] + [ text (gettext "Privacy" appState.locale) ] , a [ href "https://ds-wizard.org/terms.html", target "_blank" ] - [ lx_ "formView.termsOfService" appState ] + [ text (gettext "Terms of Service" appState.locale) ] ] - appState ) - , p [ class "invalid-feedback" ] [ lx_ "formView.privacyError" appState ] + , p [ class "invalid-feedback" ] [ text (gettext "You have to read Privacy and Terms of Service first." appState.locale) ] ] in div [ class "card card-form bg-light" ] - [ div [ class "card-header" ] [ lx_ "formView.title" appState ] + [ div [ class "card-header" ] [ text (gettext "Sign Up" appState.locale) ] , div [ class "card-body" ] [ form [ onSubmit <| FormMsg Form.Submit ] [ FormResult.errorOnlyView model.signingUp - , Html.map FormMsg <| FormGroup.input appState model.form "organizationId" <| l_ "formView.organizationId" appState - , Html.map FormMsg <| FormGroup.input appState model.form "name" <| l_ "formView.name" appState - , Html.map FormMsg <| FormGroup.input appState model.form "email" <| l_ "formView.email" appState - , Html.map FormMsg <| FormGroup.textarea appState model.form "description" <| l_ "formView.description" appState + , Html.map FormMsg <| FormGroup.input appState model.form "organizationId" <| gettext "Organization ID" appState.locale + , Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Organization Name" appState.locale + , Html.map FormMsg <| FormGroup.input appState model.form "email" <| gettext "Email" appState.locale + , Html.map FormMsg <| FormGroup.textarea appState model.form "description" <| gettext "Organization Description" appState.locale , Html.map FormMsg <| acceptGroup - , ActionButton.submit ( l_ "formView.signUp" appState, model.signingUp ) + , ActionButton.submit ( gettext "Sign Up" appState.locale, model.signingUp ) ] ] ] diff --git a/engine-registry/elm/Registry/Pages/SignupConfirmation.elm b/engine-registry/elm/Registry/Pages/SignupConfirmation.elm index c57317c1c..013763116 100644 --- a/engine-registry/elm/Registry/Pages/SignupConfirmation.elm +++ b/engine-registry/elm/Registry/Pages/SignupConfirmation.elm @@ -7,6 +7,7 @@ module Registry.Pages.SignupConfirmation exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, div, h1, p, strong, text) import Html.Attributes exposing (class) import Registry.Common.AppState exposing (AppState) @@ -14,22 +15,7 @@ import Registry.Common.Entities.OrganizationDetail exposing (OrganizationDetail) import Registry.Common.Requests as Requests import Registry.Common.View.Page as Page import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lh, lx) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.SignupConfirmation" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.SignupConfirmation" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Registry.Pages.SignupConfirmation" +import String.Format as String init : AppState -> String -> String -> ( Model, Cmd Msg ) @@ -70,7 +56,7 @@ update : Msg -> AppState -> Model -> Model update msg appState = case msg of PutOrganizationStateCompleted result -> - ActionResult.apply setOrganization (ApiError.toActionResult appState (l_ "update.putError" appState)) result + ActionResult.apply setOrganization (ApiError.toActionResult appState (gettext "Unable to activate your organization account." appState.locale)) result @@ -85,13 +71,16 @@ view appState model = viewOrganization : AppState -> OrganizationDetail -> Html Msg viewOrganization appState organization = div [] - [ h1 [] [ lx_ "viewOrganization.title" appState ] + [ h1 [] [ text (gettext "Activated" appState.locale) ] , p [] - (lh_ "viewOrganization.activated" [ strong [] [ text organization.name ] ] appState) + (String.formatHtml + (gettext "The account for your organization %s has been successfully activated!" appState.locale) + [ strong [] [ text organization.name ] ] + ) , div [ class "alert alert-info" ] - [ lx_ "viewOrganization.tokenInfo" appState ] + [ text (gettext "You will use the following token for authentication. Save it to a safe place. You will not be able to see it again." appState.locale) ] , div [ class "card" ] - [ div [ class "card-header" ] [ lx_ "viewOrganization.token" appState ] + [ div [ class "card-header" ] [ text (gettext "Token" appState.locale) ] , div [ class "card-body" ] [ text organization.token ] ] ] diff --git a/engine-registry/elm/Registry/Pages/TemplateDetail.elm b/engine-registry/elm/Registry/Pages/TemplateDetail.elm index a3c7fa2f9..3baca3b09 100644 --- a/engine-registry/elm/Registry/Pages/TemplateDetail.elm +++ b/engine-registry/elm/Registry/Pages/TemplateDetail.elm @@ -7,6 +7,7 @@ module Registry.Pages.TemplateDetail exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, br, code, div, h5, li, p, span, strong, text, ul) import Html.Attributes exposing (class, href, target, title) import Html.Events exposing (onClick) @@ -20,21 +21,10 @@ import Registry.Routing as Routing import Shared.Copy as Copy import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown import Version -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.TemplateDetail" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Registry.Pages.TemplateDetail" - - init : AppState -> String -> ( Model, Cmd Msg ) init appState templateId = ( { template = Loading @@ -72,7 +62,7 @@ update : Msg -> AppState -> Model -> ( Model, Cmd msg ) update msg appState model = case msg of GetTemplateCompleted result -> - ( ActionResult.apply setTemplate (ApiError.toActionResult appState (l_ "update.getError" appState)) result model + ( ActionResult.apply setTemplate (ApiError.toActionResult appState (gettext "Unable to get the template." appState.locale)) result model , Cmd.none ) @@ -94,17 +84,17 @@ viewDetail appState model template = let viewTemplateIdCopied = if model.copied then - span [ class "ms-2 text-muted" ] [ lx_ "view.templateId.copied" appState ] + span [ class "ms-2 text-muted" ] [ text (gettext "Copied!" appState.locale) ] else emptyNode viewTemplateId = - [ h5 [] [ lx_ "view.templateId" appState ] + [ h5 [] [ text (gettext "Template ID" appState.locale) ] , p [] [ code [ onClick (CopyTemplateId template.id) - , title (l_ "view.templateId.copy" appState) + , title (gettext "Click to copy Template ID" appState.locale) , class "entity-id" ] [ text template.id ] @@ -113,12 +103,12 @@ viewDetail appState model template = ] viewPublishedBy = - [ h5 [] [ lx_ "view.publishedBy" appState ] + [ h5 [] [ text (gettext "Published by" appState.locale) ] , viewOrganization template.organization ] viewLicense = - [ h5 [] [ lx_ "view.license" appState ] + [ h5 [] [ text (gettext "License" appState.locale) ] , p [] [ a [ href <| "https://spdx.org/licenses/" ++ template.license ++ ".html", target "_blank" ] [ text template.license ] @@ -126,7 +116,7 @@ viewDetail appState model template = ] viewCurrentVersion = - [ h5 [] [ lx_ "view.version" appState ] + [ h5 [] [ text (gettext "Version" appState.locale) ] , p [] [ text <| Version.toString template.version ] ] @@ -142,7 +132,7 @@ viewDetail appState model template = [] versions -> - [ h5 [] [ lx_ "view.otherVersions" appState ] + [ h5 [] [ text (gettext "Other versions" appState.locale) ] , ul [] (List.map viewVersion versions) ] @@ -154,7 +144,7 @@ viewDetail appState model template = ] viewSupportedMetamodel = - [ h5 [] [ lx_ "view.metamodelVersion" appState ] + [ h5 [] [ text (gettext "Metamodel version" appState.locale) ] , p [] [ text <| String.fromInt template.metamodelVersion ] ] in diff --git a/engine-registry/elm/Registry/Pages/Templates.elm b/engine-registry/elm/Registry/Pages/Templates.elm index 382495baf..be2f76e59 100644 --- a/engine-registry/elm/Registry/Pages/Templates.elm +++ b/engine-registry/elm/Registry/Pages/Templates.elm @@ -7,6 +7,7 @@ module Registry.Pages.Templates exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, div, h5, p, small, text) import Html.Attributes exposing (class, href) import Registry.Common.AppState exposing (AppState) @@ -15,12 +16,6 @@ import Registry.Common.Requests as Requests import Registry.Common.View.Page as Page import Registry.Routing as Routing import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l) - - -l_ : String -> AppState -> String -l_ = - l "Registry.Pages.Templates" init : AppState -> ( Model, Cmd Msg ) @@ -55,7 +50,7 @@ update : Msg -> AppState -> Model -> Model update msg appState = case msg of GetTemplatesCompleted result -> - ActionResult.apply setPackages (ApiError.toActionResult appState (l_ "update.getError" appState)) result + ActionResult.apply setPackages (ApiError.toActionResult appState (gettext "Unable to get templates." appState.locale)) result diff --git a/engine-shared/elm/Shared/Auth/Role.elm b/engine-shared/elm/Shared/Auth/Role.elm index b40454b5c..7a37ae3ff 100644 --- a/engine-shared/elm/Shared/Auth/Role.elm +++ b/engine-shared/elm/Shared/Auth/Role.elm @@ -6,8 +6,7 @@ module Shared.Auth.Role exposing , toReadableString ) -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) +import Gettext exposing (gettext) admin : String @@ -25,39 +24,39 @@ researcher = "researcher" -adminLocale : { a | provisioning : Provisioning } -> String +adminLocale : Gettext.Locale -> String adminLocale = - lg "role.admin" + gettext "Admin" -dataStewardLocale : { a | provisioning : Provisioning } -> String +dataStewardLocale : Gettext.Locale -> String dataStewardLocale = - lg "role.dataSteward" + gettext "Data Steward" -researcherLocale : { a | provisioning : Provisioning } -> String +researcherLocale : Gettext.Locale -> String researcherLocale = - lg "role.researcher" + gettext "Researcher" -options : { a | provisioning : Provisioning } -> List ( String, String ) +options : { a | locale : Gettext.Locale } -> List ( String, String ) options appState = - [ ( researcher, researcherLocale appState ) - , ( dataSteward, dataStewardLocale appState ) - , ( admin, adminLocale appState ) + [ ( researcher, researcherLocale appState.locale ) + , ( dataSteward, dataStewardLocale appState.locale ) + , ( admin, adminLocale appState.locale ) ] -toReadableString : { a | provisioning : Provisioning } -> String -> String +toReadableString : { a | locale : Gettext.Locale } -> String -> String toReadableString appState role = if role == admin then - adminLocale appState + adminLocale appState.locale else if role == dataSteward then - dataStewardLocale appState + dataStewardLocale appState.locale else - researcherLocale appState + researcherLocale appState.locale switch : String -> a -> a -> a -> a -> a diff --git a/engine-shared/elm/Shared/Common/Provisioning/DefaultIconSet.elm b/engine-shared/elm/Shared/Common/Provisioning/DefaultIconSet.elm deleted file mode 100644 index 9ee33889b..000000000 --- a/engine-shared/elm/Shared/Common/Provisioning/DefaultIconSet.elm +++ /dev/null @@ -1,6 +0,0 @@ -module Shared.Common.Provisioning.DefaultIconSet exposing (iconSet) - - -iconSet : List ( String, String ) -iconSet = - [] diff --git a/engine-shared/elm/Shared/Common/Provisioning/DefaultLocale.elm b/engine-shared/elm/Shared/Common/Provisioning/DefaultLocale.elm deleted file mode 100644 index ce1efb7e7..000000000 --- a/engine-shared/elm/Shared/Common/Provisioning/DefaultLocale.elm +++ /dev/null @@ -1,87 +0,0 @@ -module Shared.Common.Provisioning.DefaultLocale exposing (locale) - - -locale : List ( String, String ) -locale = - [ ( "_global.apiError.forbidden", "You do not have permission to view this page." ) - , ( "_global.apiError.service.app.limit_exceeded", "Limit of %s reached (current: %s, limit: %s)." ) - , ( "_global.apiError.service.organization.required_hash_in_query_params", "A hash query param has to be provided." ) - , ( "_global.apiError.service.pb.pull_non_existing_pkg", "The Knowledge Model was not found in the Registry." ) - , ( "_global.apiError.service.pkg.highest_number_in_new_version", "New version has to be higher than the previous one." ) - , ( "_global.apiError.service.pkg.pkg_cant_be_deleted_because_it_is_used_by_some_other_entity", "Knowledge Model cannot be deleted because it is used in some Projects or Knowledge Model Editors." ) - , ( "_global.apiError.service.qtn.qtn_cant_be_deleted_because_it_is_used_in_migration", "Questionnaire cannot be deleted because it is used in some Questionnaire migration." ) - , ( "_global.apiError.service.tb.missing_asset", "Asset \"%s\" was not found in archive." ) - , ( "_global.apiError.service.tb.missing_template_json", "\"template.json\" was not found in archive." ) - , ( "_global.apiError.service.tb.unable_to_decode_template_json", "Error while parsing template.json: \"%s\"." ) - , ( "_global.apiError.service.tb.pull_non_existing_tml", "The template was not found in the Registry." ) - , ( "_global.apiError.service.token.Incorrect_email_or_password", "Incorrect email or password" ) - , ( "_global.apiError.service.token.account_is_not_activated", "The account is not activated." ) - , ( "_global.apiError.service.user.required_admin_role_or_hash_in_query_params", "A hash query param has to be provided." ) - , ( "_global.apiError.service.user.required_hash_in_query_params", "A hash query param has to be provided." ) - , ( "_global.apiError.validation.app_id_uniqueness", "App ID is already used." ) - , ( "_global.apiError.validation.email_uniqueness", "Email is already used." ) - , ( "_global.apiError.validation.hash_absence", "Link is not valid." ) - , ( "_global.apiError.validation.km_id_uniqueness", "Knowledge Model ID is already used." ) - , ( "_global.apiError.validation.openid_code_absence", "Authentication Code is not provided." ) - , ( "_global.apiError.validation.openid_profile_info_absence", "Profile Information from OpenID service is missing." ) - , ( "_global.apiError.validation.organization_email_absence", "This email is not connected to any organization." ) - , ( "_global.apiError.validation.organization_email_uniqueness", "Organization email is already used." ) - , ( "_global.apiError.validation.organization_id_uniqueness", "Organization ID is already used." ) - , ( "_global.apiError.validation.pkg_id_uniqueness", "Knowledge Model already exists." ) - , ( "_global.apiError.validation.tml_deletation", "Template cannot be deleted because it is used in some Projects or documents." ) - , ( "_global.apiError.validation.tml_id_uniqueness", "Template already exists." ) - , ( "_global.apiError.validation.tml_unsupported_version", "Template version is not supported." ) - , ( "_global.apiError.validation.user_email_uniqueness", "Email is already used." ) - , ( "_global.month.january", "January" ) - , ( "_global.month.february", "February" ) - , ( "_global.month.march", "March" ) - , ( "_global.month.april", "April" ) - , ( "_global.month.may", "May" ) - , ( "_global.month.june", "June" ) - , ( "_global.month.july", "July" ) - , ( "_global.month.august", "August" ) - , ( "_global.month.september", "September" ) - , ( "_global.month.october", "October" ) - , ( "_global.month.november", "November" ) - , ( "_global.month.december", "December" ) - , ( "_global.questionnairePermission.comment", "comment" ) - , ( "_global.questionnairePermission.edit", "edit" ) - , ( "_global.questionnairePermission.view", "view" ) - , ( "_global.questionnaireCreation.templateAndCustom", "Templates & Custom" ) - , ( "_global.questionnaireCreation.templateAndCustom.description", "Projects can be created from project templates or with custom settings." ) - , ( "_global.questionnaireCreation.template", "Templates only" ) - , ( "_global.questionnaireCreation.template.description", "Only project templates can be used for creating new projects." ) - , ( "_global.questionnaireCreation.custom", "Custom only" ) - , ( "_global.questionnaireCreation.custom.description", "Project templates feature is disabled, researchers have to choose knowledge model and set up everything." ) - , ( "_global.questionnaireSharing.restricted", "Restricted" ) - , ( "_global.questionnaireSharing.restricted.description", "Only logged-in users can access the project depending on the project visibility." ) - , ( "_global.questionnaireSharing.anyoneWithLinkComment", "Comment with the link" ) - , ( "_global.questionnaireSharing.anyoneWithLinkComment.description", "Anyone on the internet with the link can view and comment." ) - , ( "_global.questionnaireSharing.anyoneWithLinkEdit", "Edit with the link" ) - , ( "_global.questionnaireSharing.anyoneWithLinkEdit.description", "Anyone on the internet with the link can edit." ) - , ( "_global.questionnaireSharing.anyoneWithLinkView", "View with the link" ) - , ( "_global.questionnaireSharing.anyoneWithLinkView.description", "Anyone on the internet with the link can view." ) - , ( "_global.questionnaireVisibility.private", "Private" ) - , ( "_global.questionnaireVisibility.private.description", "Visible only to the owner." ) - , ( "_global.questionnaireVisibility.publicComment", "Visible - Comment" ) - , ( "_global.questionnaireVisibility.publicComment.description", "Other logged-in users can view and comment the project." ) - , ( "_global.questionnaireVisibility.publicReadOnly", "Visible - View" ) - , ( "_global.questionnaireVisibility.publicReadOnly.description", "Other logged-in users can view the project." ) - , ( "_global.questionnaireVisibility.public", "Visible - Edit" ) - , ( "_global.questionnaireVisibility.public.description", "Other logged-in users can edit the project." ) - , ( "_global.role.admin", "Admin" ) - , ( "_global.role.dataSteward", "Data Steward" ) - , ( "_global.role.researcher", "Researcher" ) - , ( "Shared.Form.error.confirmationError", "Passwords do not match!" ) - , ( "Shared.Form.error.default", "Invalid value" ) - , ( "Shared.Form.error.empty", "%s cannot be empty." ) - , ( "Shared.Form.error.greaterFloatThan", "This should not be more than %s." ) - , ( "Shared.Form.error.invalidEmail", "This is not a valid email." ) - , ( "Shared.Form.error.invalidFloat", "This is not a valid number." ) - , ( "Shared.Form.error.invalidString", "%s cannot be empty." ) - , ( "Shared.Form.error.invalidUuid", "This is not a valid UUID." ) - , ( "Shared.Form.error.smallerFloatThan", "This should not be less than %s." ) - , ( "Shared.Form.Validate.projectTagError", "Comma (,) is not allowed in project tags." ) - , ( "Shared.Form.Validate.passwordVeryWeak", "This is a very weak password." ) - , ( "Shared.Form.Validate.passwordWeak", "This is a weak password." ) - ] diff --git a/engine-shared/elm/Shared/Common/TimeUtils.elm b/engine-shared/elm/Shared/Common/TimeUtils.elm index 978cd2616..5882572d7 100644 --- a/engine-shared/elm/Shared/Common/TimeUtils.elm +++ b/engine-shared/elm/Shared/Common/TimeUtils.elm @@ -10,8 +10,7 @@ module Shared.Common.TimeUtils exposing , toReadableTime ) -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) +import Gettext exposing (gettext) import Time exposing (Month(..)) import Time.Extra as Time @@ -150,44 +149,44 @@ intToMonth month = Dec -monthToString : { a | provisioning : Provisioning } -> Month -> String +monthToString : { a | locale : Gettext.Locale } -> Month -> String monthToString appState month = case month of Jan -> - lg "month.january" appState + gettext "January" appState.locale Feb -> - lg "month.february" appState + gettext "February" appState.locale Mar -> - lg "month.march" appState + gettext "March" appState.locale Apr -> - lg "month.april" appState + gettext "April" appState.locale May -> - lg "month.may" appState + gettext "May" appState.locale Jun -> - lg "month.june" appState + gettext "June" appState.locale Jul -> - lg "month.july" appState + gettext "July" appState.locale Aug -> - lg "month.august" appState + gettext "August" appState.locale Sep -> - lg "month.september" appState + gettext "September" appState.locale Oct -> - lg "month.october" appState + gettext "October" appState.locale Nov -> - lg "month.november" appState + gettext "November" appState.locale Dec -> - lg "month.december" appState + gettext "December" appState.locale isBetween : Time.Posix -> Time.Posix -> Time.Posix -> Bool diff --git a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireCreation.elm b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireCreation.elm index 4c16f4952..35b011c16 100644 --- a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireCreation.elm +++ b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireCreation.elm @@ -12,10 +12,9 @@ module Shared.Data.Questionnaire.QuestionnaireCreation exposing import Form.Error as Error exposing (ErrorValue(..)) import Form.Field as Field exposing (Field) import Form.Validate as V exposing (Validation) +import Gettext exposing (gettext) import Json.Decode as D exposing (Decoder) import Json.Encode as E -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) type QuestionnaireCreation @@ -111,18 +110,18 @@ validation = ) -richFormOptions : { a | provisioning : Provisioning } -> List ( String, String, String ) +richFormOptions : { a | locale : Gettext.Locale } -> List ( String, String, String ) richFormOptions appState = [ ( toString TemplateAndCustomQuestionnaireCreation - , lg "questionnaireCreation.templateAndCustom" appState - , lg "questionnaireCreation.templateAndCustom.description" appState + , gettext "Templates & Custom" appState.locale + , gettext "Projects can be created from project templates or with custom settings." appState.locale ) , ( toString TemplateQuestionnaireCreation - , lg "questionnaireCreation.template" appState - , lg "questionnaireCreation.template.description" appState + , gettext "Templates only" appState.locale + , gettext "Only project templates can be used for creating new projects." appState.locale ) , ( toString CustomQuestionnaireCreation - , lg "questionnaireCreation.custom" appState - , lg "questionnaireCreation.custom.description" appState + , gettext "Custom only" appState.locale + , gettext "Project templates feature is disabled, researchers have to choose knowledge model and set up everything." appState.locale ) ] diff --git a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireSharing.elm b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireSharing.elm index 4f6504526..505baed17 100644 --- a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireSharing.elm +++ b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireSharing.elm @@ -12,11 +12,10 @@ module Shared.Data.Questionnaire.QuestionnaireSharing exposing import Form.Error as Error exposing (ErrorValue(..)) import Form.Field as Field exposing (Field) import Form.Validate as Validate exposing (Validation) +import Gettext exposing (gettext) import Json.Decode as D exposing (Decoder) import Json.Encode as E import Shared.Data.QuestionnairePermission as QuestionnairePermission exposing (QuestionnairePermission) -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) type QuestionnaireSharing @@ -130,22 +129,22 @@ validation = ) -richFormOptions : { a | provisioning : Provisioning } -> List ( String, String, String ) +richFormOptions : { a | locale : Gettext.Locale } -> List ( String, String, String ) richFormOptions appState = [ ( toString RestrictedQuestionnaire - , lg "questionnaireSharing.restricted" appState - , lg "questionnaireSharing.restricted.description" appState + , gettext "Restricted" appState.locale + , gettext "Only logged-in users can access the project depending on the project visibility." appState.locale ) , ( toString AnyoneWithLinkViewQuestionnaire - , lg "questionnaireSharing.anyoneWithLinkView" appState - , lg "questionnaireSharing.anyoneWithLinkView.description" appState + , gettext "View with the link" appState.locale + , gettext "Anyone on the internet with the link can view." appState.locale ) , ( toString AnyoneWithLinkCommentQuestionnaire - , lg "questionnaireSharing.anyoneWithLinkComment" appState - , lg "questionnaireSharing.anyoneWithLinkComment.description" appState + , gettext "Comment with the link" appState.locale + , gettext "Anyone on the internet with the link can view and comment." appState.locale ) , ( toString AnyoneWithLinkEditQuestionnaire - , lg "questionnaireSharing.anyoneWithLinkEdit" appState - , lg "questionnaireSharing.anyoneWithLinkEdit.description" appState + , gettext "Edit with the link" appState.locale + , gettext "Anyone on the internet with the link can edit." appState.locale ) ] diff --git a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireVisibility.elm b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireVisibility.elm index 342198fbb..edf460a3d 100644 --- a/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireVisibility.elm +++ b/engine-shared/elm/Shared/Data/Questionnaire/QuestionnaireVisibility.elm @@ -12,11 +12,10 @@ module Shared.Data.Questionnaire.QuestionnaireVisibility exposing import Form.Error as Error exposing (ErrorValue(..)) import Form.Field as Field exposing (Field) import Form.Validate as Validate exposing (Validation) +import Gettext exposing (gettext) import Json.Decode as D exposing (Decoder) import Json.Encode as E import Shared.Data.QuestionnairePermission as QuestionnairePermission exposing (QuestionnairePermission) -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) type QuestionnaireVisibility @@ -140,22 +139,22 @@ validation = ) -richFormOptions : { a | provisioning : Provisioning } -> List ( String, String, String ) +richFormOptions : { a | locale : Gettext.Locale } -> List ( String, String, String ) richFormOptions appState = [ ( toString PrivateQuestionnaire - , lg "questionnaireVisibility.private" appState - , lg "questionnaireVisibility.private.description" appState + , gettext "Private" appState.locale + , gettext "Visible only to the owner." appState.locale ) , ( toString VisibleViewQuestionnaire - , lg "questionnaireVisibility.publicReadOnly" appState - , lg "questionnaireVisibility.publicReadOnly.description" appState + , gettext "Visible - View" appState.locale + , gettext "Other logged-in users can view the project." appState.locale ) , ( toString VisibleCommentQuestionnaire - , lg "questionnaireVisibility.publicComment" appState - , lg "questionnaireVisibility.publicComment.description" appState + , gettext "Visible - Comment" appState.locale + , gettext "Other logged-in users can view and comment the project." appState.locale ) , ( toString VisibleEditQuestionnaire - , lg "questionnaireVisibility.public" appState - , lg "questionnaireVisibility.public.description" appState + , gettext "Visible - Edit" appState.locale + , gettext "Other logged-in users can edit the project." appState.locale ) ] diff --git a/engine-shared/elm/Shared/Data/QuestionnairePermission.elm b/engine-shared/elm/Shared/Data/QuestionnairePermission.elm index cfd30df73..ee41a2ca2 100644 --- a/engine-shared/elm/Shared/Data/QuestionnairePermission.elm +++ b/engine-shared/elm/Shared/Data/QuestionnairePermission.elm @@ -8,8 +8,7 @@ module Shared.Data.QuestionnairePermission exposing import Form.Error as Error import Form.Field as Field exposing (Field) import Form.Validate as V exposing (Validation) -import Shared.Locale exposing (lg) -import Shared.Provisioning exposing (Provisioning) +import Gettext exposing (gettext) type QuestionnairePermission @@ -56,9 +55,9 @@ field = toString >> Field.string -formOptions : { a | provisioning : Provisioning } -> List ( String, String ) +formOptions : { a | locale : Gettext.Locale } -> List ( String, String ) formOptions appState = - [ ( "view", lg "questionnairePermission.view" appState ) - , ( "comment", lg "questionnairePermission.comment" appState ) - , ( "edit", lg "questionnairePermission.edit" appState ) + [ ( "view", gettext "view" appState.locale ) + , ( "comment", gettext "comment" appState.locale ) + , ( "edit", gettext "edit" appState.locale ) ] diff --git a/engine-shared/elm/Shared/Error/ApiError.elm b/engine-shared/elm/Shared/Error/ApiError.elm index 033139e5d..40db20611 100644 --- a/engine-shared/elm/Shared/Error/ApiError.elm +++ b/engine-shared/elm/Shared/Error/ApiError.elm @@ -5,9 +5,9 @@ module Shared.Error.ApiError exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext import Json.Decode exposing (decodeString) import Shared.Error.ServerError as ServerError exposing (ServerError) -import Shared.Provisioning exposing (Provisioning) type ApiError @@ -34,7 +34,7 @@ toServerError error = Nothing -toActionResult : { b | provisioning : Provisioning } -> String -> ApiError -> ActionResult a +toActionResult : { b | locale : Gettext.Locale } -> String -> ApiError -> ActionResult a toActionResult appState defaultMessage error = case toServerError error of Just err -> diff --git a/engine-shared/elm/Shared/Error/ServerError.elm b/engine-shared/elm/Shared/Error/ServerError.elm index 9120b83e3..35958eb0d 100644 --- a/engine-shared/elm/Shared/Error/ServerError.elm +++ b/engine-shared/elm/Shared/Error/ServerError.elm @@ -9,10 +9,10 @@ module Shared.Error.ServerError exposing ) import Dict exposing (Dict) +import Gettext exposing (gettext) import Json.Decode as D exposing (Decoder) import Json.Decode.Pipeline as D -import Shared.Locale exposing (lg, lgf) -import Shared.Provisioning exposing (Provisioning) +import String.Format as String type ServerError @@ -96,100 +96,100 @@ systemLogErrorDataDecoder = |> D.required "params" (D.list D.string) -forbiddenMessage : { a | provisioning : Provisioning } -> String +forbiddenMessage : { a | locale : Gettext.Locale } -> String forbiddenMessage appState = - lg "apiError.forbidden" appState + gettext "You do not have permission to view this page." appState.locale -messageToReadable : { a | provisioning : Provisioning } -> Message -> Maybe String +messageToReadable : { a | locale : Gettext.Locale } -> Message -> Maybe String messageToReadable appState message = case message.code of -- Shared "error.validation.km_id_uniqueness" -> - Just <| lg "apiError.validation.km_id_uniqueness" appState + Just <| gettext "Knowledge Model ID is already used." appState.locale "error.validation.pkg_id_uniqueness" -> - Just <| lg "apiError.validation.pkg_id_uniqueness" appState + Just <| gettext "Knowledge Model already exists." appState.locale "error.validation.tml_id_uniqueness" -> - Just <| lg "apiError.validation.tml_id_uniqueness" appState + Just <| gettext "Template already exists." appState.locale "error.validation.user_email_uniqueness" -> - Just <| lg "apiError.validation.user_email_uniqueness" appState + Just <| gettext "Email is already used." appState.locale "error.service.pkg.highest_number_in_new_version" -> - Just <| lg "apiError.service.pkg.highest_number_in_new_version" appState + Just <| gettext "New version has to be higher than the previous one." appState.locale "error.service.tb.missing_template_json" -> - Just <| lg "apiError.service.tb.missing_template_json" appState + Just <| gettext "\"template.json\" was not found in archive." appState.locale "error.service.tb.unable_to_decode_template_json" -> - Just <| lgf "apiError.service.tb.unable_to_decode_template_json" message.params appState + Just <| String.format (gettext "Error while parsing template.json: \"%s\"." appState.locale) message.params "error.service.tb.missing_asset" -> - Just <| lgf "apiError.service.tb.missing_asset" message.params appState + Just <| String.format (gettext "Asset \"%s\" was not found in archive." appState.locale) message.params -- Registry "error.validation.email_uniqueness" -> - Just <| lg "apiError.validation.email_uniqueness" appState + Just <| gettext "Email is already used." appState.locale "error.validation.hash_absence" -> - Just <| lg "apiError.validation.hash_absence" appState + Just <| gettext "Link is not valid." appState.locale "error.validation.organization_email_absence" -> - Just <| lg "apiError.validation.organization_email_absence" appState + Just <| gettext "This email is not connected to any organization." appState.locale "error.validation.organization_email_uniqueness" -> - Just <| lg "apiError.validation.organization_email_uniqueness" appState + Just <| gettext "Organization email is already used." appState.locale "error.validation.organization_id_uniqueness" -> - Just <| lg "apiError.validation.organization_id_uniqueness" appState + Just <| gettext "Organization ID is already used." appState.locale "error.service.organization.required_hash_in_query_params" -> - Just <| lg "apiError.service.organization.required_hash_in_query_params" appState + Just <| gettext "A hash query param has to be provided." appState.locale -- Wizard "error.validation.app_id_uniqueness" -> - Just <| lg "apiError.validation.app_id_uniqueness" appState + Just <| gettext "App ID is already used." appState.locale "error.validation.openid_code_absence" -> - Just <| lg "apiError.validation.openid_code_absence" appState + Just <| gettext "Authentication Code is not provided." appState.locale "error.validation.openid_profile_info_absence" -> - Just <| lg "apiError.validation.openid_profile_info_absence" appState + Just <| gettext "Profile Information from OpenID service is missing." appState.locale "error.validation.tml_deletation" -> - Just <| lg "apiError.validation.tml_deletation" appState + Just <| gettext "Template cannot be deleted because it is used in some Projects or documents." appState.locale "error.validation.tml_unsupported_version" -> - Just <| lg "apiError.validation.tml_unsupported_version" appState + Just <| gettext "Template version is not supported." appState.locale "error.service.app.limit_exceeded" -> - Just <| lgf "apiError.service.app.limit_exceeded" message.params appState + Just <| String.format (gettext "Limit of %s reached (current: %s, limit: %s)" appState.locale) message.params "error.service.pkg.pkg_cant_be_deleted_because_it_is_used_by_some_other_entity" -> - Just <| lg "apiError.service.pkg.pkg_cant_be_deleted_because_it_is_used_by_some_other_entity" appState + Just <| gettext "Knowledge Model cannot be deleted because it is used in some Projects or Knowledge Model Editors." appState.locale "error.service.pb.pull_non_existing_pkg" -> - Just <| lg "apiError.service.pb.pull_non_existing_pkg" appState + Just <| gettext "The Knowledge Model was not found in the Registry." appState.locale "error.service.qtn.qtn_cant_be_deleted_because_it_is_used_in_migration" -> - Just <| lg "apiError.service.qtn.qtn_cant_be_deleted_because_it_is_used_in_migration" appState + Just <| gettext "Project cannot be deleted because it is used in some project migration." appState.locale "error.service.tb.pull_non_existing_tml" -> - Just <| lg "apiError.service.tb.pull_non_existing_tml" appState + Just <| gettext "The template was not found in the Registry." appState.locale "error.service.token.Incorrect_email_or_password" -> - Just <| lg "apiError.service.token.Incorrect_email_or_password" appState + Just <| gettext "Incorrect email or password" appState.locale "error.service.token.account_is_not_activated" -> - Just <| lg "apiError.service.token.account_is_not_activated" appState + Just <| gettext "The account is not activated." appState.locale "error.service.user.required_admin_role_or_hash_in_query_params" -> - Just <| lg "apiError.service.user.required_admin_role_or_hash_in_query_params" appState + Just <| gettext "A hash query param has to be provided." appState.locale "error.service.user.required_hash_in_query_params" -> - Just <| lg "apiError.service.user.required_hash_in_query_params" appState + Just <| gettext "A hash query param has to be provided." appState.locale _ -> Nothing diff --git a/engine-shared/elm/Shared/Form.elm b/engine-shared/elm/Shared/Form.elm index 363ff7c38..4021b316f 100644 --- a/engine-shared/elm/Shared/Form.elm +++ b/engine-shared/elm/Shared/Form.elm @@ -7,51 +7,41 @@ import Dict import Form exposing (Form) import Form.Error exposing (ErrorValue(..)) import Form.Validate as V exposing (Validation, customError) +import Gettext exposing (gettext) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Error.ServerError as ServerError import Shared.Form.FormError exposing (FormError(..)) -import Shared.Locale exposing (l, lf) -import Shared.Provisioning exposing (Provisioning) +import String.Format as String -l_ : String -> { a | provisioning : Provisioning } -> String -l_ = - l "Shared.Form" - - -lf_ : String -> List String -> { a | provisioning : Provisioning } -> String -lf_ = - lf "Shared.Form" - - -errorToString : { a | provisioning : Provisioning } -> String -> ErrorValue FormError -> String +errorToString : { a | locale : Gettext.Locale } -> String -> ErrorValue FormError -> String errorToString appState labelText error = case error of Empty -> - lf_ "error.empty" [ labelText ] appState + String.format (gettext "%s cannot be empty." appState.locale) [ labelText ] InvalidString -> - lf_ "error.invalidString" [ labelText ] appState + String.format (gettext "%s cannot be empty." appState.locale) [ labelText ] InvalidEmail -> - l_ "error.invalidEmail" appState + gettext "This is not a valid email." appState.locale InvalidFloat -> - l_ "error.invalidFloat" appState + gettext "This is not a valid number." appState.locale SmallerFloatThan n -> - lf_ "error.smallerFloatThan" [ String.fromFloat n ] appState + String.format (gettext "This should not be less than %s." appState.locale) [ String.fromFloat n ] GreaterFloatThan n -> - lf_ "error.greaterFloatThan" [ String.fromFloat n ] appState + String.format (gettext "This should not be more than %s." appState.locale) [ String.fromFloat n ] CustomError err -> case err of ConfirmationError -> - l_ "error.confirmationError" appState + gettext "Passwords do not match!" appState.locale InvalidUuid -> - l_ "error.invalidUuid" appState + gettext "This is not a valid UUID." appState.locale ServerValidationError msg -> msg @@ -60,10 +50,10 @@ errorToString appState labelText error = msg _ -> - l_ "error.default" appState + gettext "Invalid value." appState.locale -setFormErrors : { b | provisioning : Provisioning } -> ApiError -> Form FormError a -> Form FormError a +setFormErrors : { b | locale : Gettext.Locale } -> ApiError -> Form FormError a -> Form FormError a setFormErrors appState apiError form = case ApiError.toServerError apiError of Just (ServerError.UserFormError error) -> @@ -73,7 +63,7 @@ setFormErrors appState apiError form = form -setFormError : { b | provisioning : Provisioning } -> ( String, List ServerError.Message ) -> Form FormError a -> Form FormError a +setFormError : { b | locale : Gettext.Locale } -> ( String, List ServerError.Message ) -> Form FormError a -> Form FormError a setFormError appState ( fieldName, fieldErrors ) form = case List.head fieldErrors of Just fieldError -> @@ -83,7 +73,7 @@ setFormError appState ( fieldName, fieldErrors ) form = form -createFieldValidation : { b | provisioning : Provisioning } -> String -> ServerError.Message -> Validation FormError a +createFieldValidation : { b | locale : Gettext.Locale } -> String -> ServerError.Message -> Validation FormError a createFieldValidation appState fieldName fieldError = let error = diff --git a/engine-shared/elm/Shared/Form/Validate.elm b/engine-shared/elm/Shared/Form/Validate.elm index c4c28e9ac..6dcdc5483 100644 --- a/engine-shared/elm/Shared/Form/Validate.elm +++ b/engine-shared/elm/Shared/Form/Validate.elm @@ -16,20 +16,14 @@ module Shared.Form.Validate exposing import Dict exposing (Dict) import Form.Error as Error exposing (ErrorValue(..)) import Form.Validate as V exposing (Validation) +import Gettext exposing (gettext) import Regex exposing (Regex) import Rumkin import Shared.Form.FormError as FormError exposing (FormError(..)) -import Shared.Locale exposing (l) -import Shared.Provisioning exposing (Provisioning) import Shared.RegexPatterns as RegexPatterns import Uuid exposing (Uuid) -l_ : String -> { a | provisioning : Provisioning } -> String -l_ = - l "Shared.Form.Validate" - - confirmation : String -> Validation FormError String -> Validation FormError String confirmation confirmationField = let @@ -49,17 +43,17 @@ confirmation confirmationField = V.andThen validate -password : { a | provisioning : Provisioning } -> Validation FormError String +password : { a | locale : Gettext.Locale } -> Validation FormError String password appState = V.string |> V.andThen (\value -> case (Rumkin.getStats value).strength of Rumkin.VeryWeak -> - V.fail (V.customError (FormError.Error (l_ "passwordVeryWeak" appState))) + V.fail (V.customError (FormError.Error (gettext "This is a very weak password." appState.locale))) Rumkin.Weak -> - V.fail (V.customError (FormError.Error (l_ "passwordWeak" appState))) + V.fail (V.customError (FormError.Error (gettext "This is a weak password." appState.locale))) _ -> V.succeed value @@ -130,14 +124,14 @@ kmId = regex RegexPatterns.kmId -projectTag : { a | provisioning : Provisioning } -> Validation FormError String +projectTag : { a | locale : Gettext.Locale } -> Validation FormError String projectTag appState = - validateRegexWithCustomError RegexPatterns.projectTag (FormError.Error (l_ "projectTagError" appState)) + validateRegexWithCustomError RegexPatterns.projectTag (FormError.Error (gettext "Comma (,) is not allowed in project tags." appState.locale)) -projectTags : { a | provisioning : Provisioning } -> Validation FormError (Maybe String) +projectTags : { a | locale : Gettext.Locale } -> Validation FormError (Maybe String) projectTags appState = - maybeRegex RegexPatterns.projectTag (l_ "projectTagError" appState) + maybeRegex RegexPatterns.projectTag (gettext "Comma (,) is not allowed in project tags." appState.locale) validateRegexWithCustomError : Regex -> e -> Validation e String diff --git a/engine-shared/elm/Shared/Locale.elm b/engine-shared/elm/Shared/Locale.elm index 3f29c07b6..55c09a32a 100644 --- a/engine-shared/elm/Shared/Locale.elm +++ b/engine-shared/elm/Shared/Locale.elm @@ -1,19 +1,7 @@ -module Shared.Locale exposing - ( l - , lf - , lg - , lgf - , lgh - , lgx - , lh - , lr - , lx - ) +module Shared.Locale exposing (lr) import Dict -import Html exposing (Html, text) import Shared.Provisioning exposing (Provisioning) -import String.Format as String l : String -> String -> { a | provisioning : Provisioning } -> String @@ -26,41 +14,6 @@ l moduleKey termKey appState = |> Maybe.withDefault "" -lx : String -> String -> { a | provisioning : Provisioning } -> Html msg -lx m t = - text << l m t - - -lg : String -> { a | provisioning : Provisioning } -> String -lg = - l "_global" - - lr : String -> { a | provisioning : Provisioning } -> String lr = l "__routing" - - -lgx : String -> { a | provisioning : Provisioning } -> Html msg -lgx t = - text << lg t - - -lgf : String -> List String -> { a | provisioning : Provisioning } -> String -lgf = - lf "_global" - - -lf : String -> String -> List String -> { a | provisioning : Provisioning } -> String -lf moduleKey termKey terms appState = - String.format (l moduleKey termKey appState) terms - - -lh : String -> String -> List (Html msg) -> { a | provisioning : Provisioning } -> List (Html msg) -lh moduleKey termKey elements appState = - String.formatHtml (l moduleKey termKey appState) elements - - -lgh : String -> List (Html msg) -> { a | provisioning : Provisioning } -> List (Html msg) -lgh = - lh "_global" diff --git a/engine-wizard/elm/Wizard/Apps/Create/Update.elm b/engine-wizard/elm/Wizard/Apps/Create/Update.elm index 4763cd2ee..f5ba12aa0 100644 --- a/engine-wizard/elm/Wizard/Apps/Create/Update.elm +++ b/engine-wizard/elm/Wizard/Apps/Create/Update.elm @@ -2,10 +2,10 @@ module Wizard.Apps.Create.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.Apps as AppsApi import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Apps.Common.AppCreateForm as AppCreateForm import Wizard.Apps.Create.Models exposing (Model) import Wizard.Apps.Create.Msgs exposing (Msg(..)) @@ -56,7 +56,7 @@ postAppCompleted appState model result = Err error -> ( { model - | savingApp = ApiError.toActionResult appState (lg "apiError.apps.postError" appState) error + | savingApp = ApiError.toActionResult appState (gettext "App could not be created." appState.locale) error , form = setFormErrors appState error model.form } , getResultCmd result diff --git a/engine-wizard/elm/Wizard/Apps/Create/View.elm b/engine-wizard/elm/Wizard/Apps/Create/View.elm index 685d51501..eb5476f50 100644 --- a/engine-wizard/elm/Wizard/Apps/Create/View.elm +++ b/engine-wizard/elm/Wizard/Apps/Create/View.elm @@ -1,10 +1,10 @@ module Wizard.Apps.Create.View exposing (view) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, div, form) import Html.Events exposing (onSubmit) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lg) import Wizard.Apps.Common.AppCreateForm exposing (AppCreateForm) import Wizard.Apps.Create.Models exposing (Model) import Wizard.Apps.Create.Msgs exposing (Msg(..)) @@ -18,29 +18,24 @@ import Wizard.Common.View.Page as Page import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Apps.Create.View" - - view : AppState -> Model -> Html Msg view appState model = form [ onSubmit (FormMsg Form.Submit), detailClass "Apps__Create" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Create app" appState.locale) [] , FormResult.view appState model.savingApp , Html.map FormMsg <| formView appState model.form , FormActions.viewSubmit appState Routes.appsIndex - (ActionButton.SubmitConfig (l_ "form.create" appState) model.savingApp) + (ActionButton.SubmitConfig (gettext "Create" appState.locale) model.savingApp) ] formView : AppState -> Form FormError AppCreateForm -> Html Form.Msg formView appState form = div [] - [ FormGroup.input appState form "appId" <| lg "app.appId" appState - , FormGroup.input appState form "appName" <| lg "app.name" appState - , FormGroup.input appState form "email" <| lg "user.email" appState - , FormGroup.input appState form "firstName" <| lg "user.firstName" appState - , FormGroup.input appState form "lastName" <| lg "user.lastName" appState + [ FormGroup.input appState form "appId" (gettext "App ID" appState.locale) + , FormGroup.input appState form "appName" (gettext "Name" appState.locale) + , FormGroup.input appState form "email" (gettext "Email" appState.locale) + , FormGroup.input appState form "firstName" (gettext "First name" appState.locale) + , FormGroup.input appState form "lastName" (gettext "Last name" appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Apps/Detail/Update.elm b/engine-wizard/elm/Wizard/Apps/Detail/Update.elm index 95dcb5489..c67dbd3d6 100644 --- a/engine-wizard/elm/Wizard/Apps/Detail/Update.elm +++ b/engine-wizard/elm/Wizard/Apps/Detail/Update.elm @@ -5,10 +5,10 @@ module Wizard.Apps.Detail.Update exposing import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.Apps as AppsApi import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setApp) import Uuid exposing (Uuid) import Wizard.Apps.Common.AppEditForm as AppEditForm @@ -33,7 +33,7 @@ update msg wrapMsg appState model = GetAppComplete result -> applyResult appState { setResult = setApp - , defaultError = lg "apiError.apps.getError" appState + , defaultError = gettext "Unable to get app." appState.locale , model = model , result = result } @@ -122,7 +122,7 @@ handlePutAppComplete appState model result = Err error -> ( { model - | savingApp = ApiError.toActionResult appState (lg "apiError.apps.putError" appState) error + | savingApp = ApiError.toActionResult appState (gettext "App could not be saved." appState.locale) error , editForm = Maybe.map (setFormErrors appState error) model.editForm } , getResultCmd result @@ -164,7 +164,7 @@ handlePostPlanComplete appState model result = Err error -> ( { model - | addingPlan = ApiError.toActionResult appState (lg "apiError.apps.postPlanError" appState) error + | addingPlan = ApiError.toActionResult appState (gettext "Plan could not be created." appState.locale) error , addPlanForm = Maybe.map (setFormErrors appState error) model.addPlanForm } , getResultCmd result @@ -206,7 +206,7 @@ handlePutPlanComplete appState model result = Err error -> ( { model - | editingPlan = ApiError.toActionResult appState (lg "apiError.apps.putPlanError" appState) error + | editingPlan = ApiError.toActionResult appState (gettext "Plan could not be saved." appState.locale) error , editPlanForm = Maybe.map (Tuple.mapSecond (setFormErrors appState error)) model.editPlanForm } , getResultCmd result @@ -236,7 +236,7 @@ handleDeletePlanComplete appState model result = Err error -> ( { model - | deletingPlan = ApiError.toActionResult appState (lg "apiError.apps.deletePlanError" appState) error + | deletingPlan = ApiError.toActionResult appState (gettext "Plan could not be deleted." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/Apps/Detail/View.elm b/engine-wizard/elm/Wizard/Apps/Detail/View.elm index a224d57d9..7c91ec60b 100644 --- a/engine-wizard/elm/Wizard/Apps/Detail/View.elm +++ b/engine-wizard/elm/Wizard/Apps/Detail/View.elm @@ -1,6 +1,7 @@ module Wizard.Apps.Detail.View exposing (view) import Form +import Gettext exposing (gettext) import Html exposing (Html, a, div, h3, hr, span, text) import Html.Attributes exposing (class, href, target) import Html.Events exposing (onClick) @@ -10,9 +11,9 @@ import Shared.Components.Badge as Badge import Shared.Data.AppDetail exposing (AppDetail) import Shared.Data.User as User exposing (User) import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lf, lg, lx) import Shared.Markdown as Markdown -import Shared.Utils exposing (listFilterJust) +import Shared.Utils exposing (flip, listFilterJust) +import String.Format as String import Wizard.Apps.Detail.Models exposing (Model) import Wizard.Apps.Detail.Msgs exposing (Msg(..)) import Wizard.Common.AppState exposing (AppState) @@ -27,21 +28,6 @@ import Wizard.Common.View.Page as Page import Wizard.Common.View.UserIcon as UserIcon -l_ : String -> AppState -> String -l_ = - l "Wizard.Apps.Detail.View" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Apps.Detail.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Apps.Detail.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewApp appState model) model.app @@ -66,7 +52,7 @@ header appState app = editAction = a [ onClick EditModalOpen, dataCy "app-detail_edit" ] [ faSet "_global.edit" appState - , lx_ "actions.edit" appState + , text (gettext "Edit" appState.locale) ] title = @@ -88,13 +74,13 @@ content appState appDetail = in DetailPage.content [ div [ DetailPage.contentInnerClass ] - [ h3 [] [ lx_ "content.title.usage" appState ] + [ h3 [] [ text (gettext "Usage" appState.locale) ] , UsageTable.view appState appDetail.usage , hr [ class "my-5" ] [] - , h3 [] [ lx_ "content.title.plans" appState ] + , h3 [] [ text (gettext "Plans" appState.locale) ] , PlansList.view appState { actions = Just planActions } appDetail.plans , a [ class "with-icon", onClick AddPlanModalOpen, dataCy "app-detail_add-plan" ] - [ faSet "_global.add" appState, lx_ "content.plans.add" appState ] + [ faSet "_global.add" appState, text (gettext "Add plan" appState.locale) ] ] ] @@ -117,30 +103,30 @@ sidePanelInfo appState appDetail = let enabledBadge = if appDetail.enabled then - Badge.success [] [ lx_ "badge.enabled" appState ] + Badge.success [] [ text (gettext "Enabled" appState.locale) ] else - Badge.danger [] [ lx_ "badge.disabled" appState ] + Badge.danger [] [ text (gettext "Disabled" appState.locale) ] infoList = - [ ( l_ "sidePanel.appId" appState, "app-id", text appDetail.appId ) - , ( l_ "sidePanel.enabled" appState, "enabled", enabledBadge ) - , ( l_ "sidePanel.createdAt" appState, "created-at", text <| TimeUtils.toReadableDateTime appState.timeZone appDetail.createdAt ) - , ( l_ "sidePanel.updatedAt" appState, "updated-at", text <| TimeUtils.toReadableDateTime appState.timeZone appDetail.updatedAt ) + [ ( gettext "App ID" appState.locale, "app-id", text appDetail.appId ) + , ( gettext "Enabled" appState.locale, "enabled", enabledBadge ) + , ( gettext "Created at" appState.locale, "created-at", text <| TimeUtils.toReadableDateTime appState.timeZone appDetail.createdAt ) + , ( gettext "Updated at" appState.locale, "updated-at", text <| TimeUtils.toReadableDateTime appState.timeZone appDetail.updatedAt ) ] in - Just ( l_ "sidePanel.info" appState, "info", DetailPage.sidePanelList 4 8 infoList ) + Just ( gettext "Info" appState.locale, "info", DetailPage.sidePanelList 4 8 infoList ) sidePanelUrls : AppState -> AppDetail -> Maybe ( String, String, Html msg ) sidePanelUrls appState appDetail = let urlsList = - [ ( l_ "sidePanel.clientUrl" appState, "client-url", a [ href appDetail.clientUrl, target "_blank" ] [ text appDetail.clientUrl ] ) - , ( l_ "sidePanel.serverUrl" appState, "server-url", a [ href appDetail.serverUrl, target "_blank" ] [ text appDetail.serverUrl ] ) + [ ( gettext "Client URL" appState.locale, "client-url", a [ href appDetail.clientUrl, target "_blank" ] [ text appDetail.clientUrl ] ) + , ( gettext "Server URL" appState.locale, "server-url", a [ href appDetail.serverUrl, target "_blank" ] [ text appDetail.serverUrl ] ) ] in - Just ( l_ "sidePanel.urls" appState, "urls", DetailPage.sidePanelList 4 8 urlsList ) + Just ( gettext "URLs" appState.locale, "urls", DetailPage.sidePanelList 4 8 urlsList ) sidePanelAdmins : AppState -> AppDetail -> Maybe ( String, String, Html msg ) @@ -152,7 +138,7 @@ sidePanelAdmins appState appDetail = |> List.sortWith User.compare |> List.map viewUser in - Just ( l_ "sidePanel.admins" appState, "admins", div [] users ) + Just ( gettext "Admins" appState.locale, "admins", div [] users ) viewUser : User -> Html msg @@ -168,19 +154,19 @@ viewEditModal appState model = modalContent = case model.editForm of Just form -> - [ Html.map EditModalFormMsg <| FormGroup.input appState form "appId" <| lg "app.appId" appState - , Html.map EditModalFormMsg <| FormGroup.input appState form "name" <| lg "app.name" appState + [ Html.map EditModalFormMsg <| FormGroup.input appState form "appId" <| gettext "App ID" appState.locale + , Html.map EditModalFormMsg <| FormGroup.input appState form "name" <| gettext "Name" appState.locale ] Nothing -> [] config = - { modalTitle = l_ "editModal.title" appState + { modalTitle = gettext "Edit app" appState.locale , modalContent = modalContent , visible = Maybe.isJust model.editForm , actionResult = model.savingApp - , actionName = l_ "editModal.save" appState + , actionName = gettext "Save" appState.locale , actionMsg = EditModalFormMsg Form.Submit , cancelMsg = Just EditModalClose , dangerous = False @@ -196,22 +182,22 @@ viewAddPlanModal appState model = modalContent = case model.addPlanForm of Just form -> - [ Html.map AddPlanModalFormMsg <| FormGroup.input appState form "name" <| lg "appPlan.name" appState - , Html.map AddPlanModalFormMsg <| FormGroup.input appState form "users" <| lg "appPlan.users" appState - , Html.map AddPlanModalFormMsg <| FormGroup.simpleDate appState form "sinceYear" "sinceMonth" "sinceDay" <| lg "appPlan.from" appState - , Html.map AddPlanModalFormMsg <| FormGroup.simpleDate appState form "untilYear" "untilMonth" "untilDay" <| lg "appPlan.to" appState - , Html.map AddPlanModalFormMsg <| FormGroup.toggle form "test" <| lg "appPlan.trial" appState + [ Html.map AddPlanModalFormMsg <| FormGroup.input appState form "name" <| gettext "Name" appState.locale + , Html.map AddPlanModalFormMsg <| FormGroup.input appState form "users" <| gettext "Users" appState.locale + , Html.map AddPlanModalFormMsg <| FormGroup.simpleDate appState form "sinceYear" "sinceMonth" "sinceDay" <| gettext "From" appState.locale + , Html.map AddPlanModalFormMsg <| FormGroup.simpleDate appState form "untilYear" "untilMonth" "untilDay" <| gettext "To" appState.locale + , Html.map AddPlanModalFormMsg <| FormGroup.toggle form "test" <| gettext "Trial" appState.locale ] Nothing -> [] config = - { modalTitle = l_ "addPlanModal.title" appState + { modalTitle = gettext "Add plan" appState.locale , modalContent = modalContent , visible = Maybe.isJust model.addPlanForm , actionResult = model.addingPlan - , actionName = l_ "addPlanModal.action" appState + , actionName = gettext "Add" appState.locale , actionMsg = AddPlanModalFormMsg Form.Submit , cancelMsg = Just AddPlanModalClose , dangerous = False @@ -227,22 +213,22 @@ viewEditPlanModal appState model = modalContent = case model.editPlanForm of Just ( _, form ) -> - [ Html.map EditPlanModalFormMsg <| FormGroup.input appState form "name" <| lg "appPlan.name" appState - , Html.map EditPlanModalFormMsg <| FormGroup.input appState form "users" <| lg "appPlan.users" appState - , Html.map EditPlanModalFormMsg <| FormGroup.simpleDate appState form "sinceYear" "sinceMonth" "sinceDay" <| lg "appPlan.from" appState - , Html.map EditPlanModalFormMsg <| FormGroup.simpleDate appState form "untilYear" "untilMonth" "untilDay" <| lg "appPlan.to" appState - , Html.map EditPlanModalFormMsg <| FormGroup.toggle form "test" <| lg "appPlan.trial" appState + [ Html.map EditPlanModalFormMsg <| FormGroup.input appState form "name" <| gettext "Name" appState.locale + , Html.map EditPlanModalFormMsg <| FormGroup.input appState form "users" <| gettext "Users" appState.locale + , Html.map EditPlanModalFormMsg <| FormGroup.simpleDate appState form "sinceYear" "sinceMonth" "sinceDay" <| gettext "From" appState.locale + , Html.map EditPlanModalFormMsg <| FormGroup.simpleDate appState form "untilYear" "untilMonth" "untilDay" <| gettext "To" appState.locale + , Html.map EditPlanModalFormMsg <| FormGroup.toggle form "test" <| gettext "Trial" appState.locale ] Nothing -> [] config = - { modalTitle = l_ "editPlanModal.title" appState + { modalTitle = gettext "Edit plan" appState.locale , modalContent = modalContent , visible = Maybe.isJust model.editPlanForm , actionResult = model.editingPlan - , actionName = l_ "editPlanModal.action" appState + , actionName = gettext "Save" appState.locale , actionMsg = EditPlanModalFormMsg Form.Submit , cancelMsg = Just EditPlanModalClose , dangerous = False @@ -258,17 +244,20 @@ viewDeletePlanModal appState model = modalContent = case model.deletePlan of Just plan -> - [ Markdown.toHtml [] (lf_ "deletePlanModal.text" [ plan.name ] appState) ] + gettext "Are you sure you want to delete plan **%s**?" appState.locale + |> flip String.format [ plan.name ] + |> Markdown.toHtml [] + |> List.singleton Nothing -> [] config = - { modalTitle = l_ "deletePlanModal.title" appState + { modalTitle = gettext "Delete plan" appState.locale , modalContent = modalContent , visible = Maybe.isJust model.deletePlan , actionResult = model.deletingPlan - , actionName = l_ "deletePlanModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeletePlanModalConfirm , cancelMsg = Just DeletePlanModalClose , dangerous = True diff --git a/engine-wizard/elm/Wizard/Apps/Index/Update.elm b/engine-wizard/elm/Wizard/Apps/Index/Update.elm index d9c768d38..b83c46618 100644 --- a/engine-wizard/elm/Wizard/Apps/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Apps/Index/Update.elm @@ -1,9 +1,9 @@ module Wizard.Apps.Index.Update exposing (fetchData, update) import Dict +import Gettext exposing (gettext) import Shared.Api.Apps as AppsApi import Shared.Data.App exposing (App) -import Shared.Locale exposing (lg) import Shared.Utils exposing (stringToBool) import Wizard.Apps.Index.Models exposing (Model) import Wizard.Apps.Index.Msgs exposing (Msg(..)) @@ -46,7 +46,7 @@ listingUpdateConfig wrapMsg appState model = Dict.get indexRouteEnabledFilterId model.apps.filters.values in { getRequest = AppsApi.getApps { enabled = enabled } - , getError = lg "apiError.apps.getListError" appState + , getError = gettext "Unable to get apps." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.appsIndexWithFilters model.apps.filters } diff --git a/engine-wizard/elm/Wizard/Apps/Index/View.elm b/engine-wizard/elm/Wizard/Apps/Index/View.elm index efec28568..22cc850c2 100644 --- a/engine-wizard/elm/Wizard/Apps/Index/View.elm +++ b/engine-wizard/elm/Wizard/Apps/Index/View.elm @@ -1,11 +1,11 @@ module Wizard.Apps.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, a, div, span, text) import Html.Attributes exposing (class, href, target) import Shared.Components.Badge as Badge import Shared.Data.App exposing (App) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lx) import Wizard.Apps.Index.Models exposing (Model) import Wizard.Apps.Index.Msgs exposing (Msg(..)) import Wizard.Apps.Routes exposing (indexRouteEnabledFilterId) @@ -18,20 +18,10 @@ import Wizard.Common.View.Page as Page import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Apps.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Apps.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "Apps__Index" ] - [ Page.header (lg "apps" appState) [] + [ Page.header (gettext "Apps" appState.locale) [] , Listing.view appState (listingConfig appState) model.apps ] @@ -41,10 +31,10 @@ listingConfig appState = let enabledFilter = Listing.SimpleFilter indexRouteEnabledFilterId - { name = l_ "filter.enabled.name" appState + { name = gettext "Enabled" appState.locale , options = - [ ( "true", l_ "filter.enabled.enabledOnly" appState ) - , ( "false", l_ "filter.enabled.disabledOnly" appState ) + [ ( "true", gettext "Enabled only" appState.locale ) + , ( "false", gettext "Disabled only" appState.locale ) ] } in @@ -53,7 +43,7 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = always [] , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Create\" button to add a new App." appState.locale , updated = Just { getTime = .updatedAt @@ -61,12 +51,12 @@ listingConfig appState = } , wrapMsg = ListingMsg , iconView = Just AppIcon.view - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search apps..." appState.locale) , sortOptions = - [ ( "name", lg "app.name" appState ) - , ( "appId", lg "app.appId" appState ) - , ( "createdAt", lg "app.createdAt" appState ) - , ( "updatedAt", lg "app.updatedAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "appId", gettext "App ID" appState.locale ) + , ( "createdAt", gettext "Created at" appState.locale ) + , ( "updatedAt", gettext "Updated at" appState.locale ) ] , filters = [ enabledFilter @@ -81,7 +71,7 @@ listingTitle appState app = let disabledBadge = if not app.enabled then - Badge.danger [] [ lx_ "badge.disabled" appState ] + Badge.danger [] [ text (gettext "Disabled" appState.locale) ] else emptyNode @@ -109,4 +99,4 @@ createButton appState = Routes.appsCreate [ class "btn btn-primary" ] - [ lx_ "header.create" appState ] + [ text (gettext "Create" appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Auth/Update.elm b/engine-wizard/elm/Wizard/Auth/Update.elm index cc0398de8..cb3c6fbbc 100644 --- a/engine-wizard/elm/Wizard/Auth/Update.elm +++ b/engine-wizard/elm/Wizard/Auth/Update.elm @@ -1,10 +1,10 @@ module Wizard.Auth.Update exposing (update) +import Gettext exposing (gettext) import Shared.Api.Users as UsersApi import Shared.Auth.Session as Session import Shared.Data.User as User exposing (User) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (dispatch) import Wizard.Auth.Msgs as AuthMsgs import Wizard.Models exposing (Model, setSession) @@ -61,7 +61,7 @@ getCurrentUserCompleted model mbOriginalUrl result = Err error -> let msg = - ApiError.toActionResult model.appState (lg "apiError.users.current.getError" model.appState) error + ApiError.toActionResult model.appState (gettext "Loading the profile info failed." model.appState.locale) error |> Wizard.Public.Login.Msgs.GetProfileInfoFailed |> Wizard.Public.Msgs.LoginMsg |> Wizard.Msgs.PublicMsg diff --git a/engine-wizard/elm/Wizard/Common/Api.elm b/engine-wizard/elm/Wizard/Common/Api.elm index 1ab2de604..772a72f6e 100644 --- a/engine-wizard/elm/Wizard/Common/Api.elm +++ b/engine-wizard/elm/Wizard/Common/Api.elm @@ -7,8 +7,8 @@ module Wizard.Common.Api exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext import Shared.Error.ApiError as ApiError exposing (ApiError(..)) -import Shared.Provisioning exposing (Provisioning) import Shared.Utils exposing (dispatch) import Wizard.Auth.Msgs import Wizard.Msgs @@ -30,7 +30,7 @@ getResultCmd result = applyResult : - { a | provisioning : Provisioning } + { a | locale : Gettext.Locale } -> { setResult : ActionResult data -> model -> model , defaultError : String @@ -49,7 +49,7 @@ applyResult appState { setResult, defaultError, model, result } = applyResultTransform : - { a | provisioning : Provisioning } + { a | locale : Gettext.Locale } -> { setResult : ActionResult data2 -> model -> model , defaultError : String @@ -70,7 +70,7 @@ applyResultTransform appState { setResult, defaultError, model, result, transfor applyResultCmd : - { a | provisioning : Provisioning } + { a | locale : Gettext.Locale } -> { setResult : ActionResult data -> model -> model , defaultError : String @@ -91,7 +91,7 @@ applyResultCmd appState { setResult, defaultError, model, result, cmd } = applyResultTransformCmd : - { a | provisioning : Provisioning } + { a | locale : Gettext.Locale } -> { setResult : ActionResult data2 -> model -> model , defaultError : String diff --git a/engine-wizard/elm/Wizard/Common/AppState.elm b/engine-wizard/elm/Wizard/Common/AppState.elm index 134936f62..57ce9f4a2 100644 --- a/engine-wizard/elm/Wizard/Common/AppState.elm +++ b/engine-wizard/elm/Wizard/Common/AppState.elm @@ -8,6 +8,7 @@ module Wizard.Common.AppState exposing ) import Browser.Navigation as Navigation exposing (Key) +import Gettext import Json.Decode as D exposing (Error(..)) import Random exposing (Seed) import Shared.Auth.Session as Session exposing (Session) @@ -42,6 +43,7 @@ type alias AppState = , navigator : Navigator , gaEnabled : Bool , cookieConsent : Bool + , locale : Gettext.Locale } @@ -97,6 +99,7 @@ init flagsValue key = , navigator = flags.navigator , gaEnabled = flags.gaEnabled , cookieConsent = flags.cookieConsent + , locale = flags.locale } , flagsCmd ) diff --git a/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm b/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm index 246360497..aca1b0580 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm @@ -16,6 +16,7 @@ module Wizard.Common.Components.Listing.View exposing import Bootstrap.Button as Button import Bootstrap.Dropdown as Dropdown import Dict +import Gettext exposing (gettext) import Html exposing (Html, a, div, input, li, nav, span, text, ul) import Html.Attributes exposing (class, classList, href, id, placeholder, type_, value) import Html.Events exposing (onClick, onInput) @@ -28,7 +29,6 @@ import Shared.Data.Pagination.Page exposing (Page) import Shared.Data.PaginationQueryFilters as PaginationQueryFilters exposing (PaginationQueryFilters) import Shared.Data.PaginationQueryString as PaginationQueryString exposing (PaginationQueryString, SortDirection(..)) import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw import Time import Time.Distance exposing (inWordsWithConfig) @@ -45,16 +45,6 @@ import Wizard.Routes as Routes exposing (Route) import Wizard.Routing as Routing -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Listing.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Listing.View" - - type alias ViewConfig a msg = { title : a -> Html msg , description : a -> Html msg @@ -158,7 +148,7 @@ viewToolbarSearch : AppState -> ViewConfig a msg -> Model a -> Html msg viewToolbarSearch appState cfg model = let placeholderText = - Maybe.withDefault (l_ "toolbarFilter.placeholder" appState) cfg.searchPlaceholderText + Maybe.withDefault (gettext "Filter by name..." appState.locale) cfg.searchPlaceholderText in input [ type_ "text" @@ -207,7 +197,7 @@ viewToolbarSort appState cfg model = , toggleButton = Dropdown.toggle [ Button.outlineSecondary ] [ text currentSort ] , items = - Dropdown.header [ lx_ "toolbarSort.orderBy" appState ] :: List.map sortOption cfg.sortOptions + Dropdown.header [ text (gettext "Order by" appState.locale) ] :: List.map sortOption cfg.sortOptions } , linkTo appState sortDirectionButtonUrl @@ -373,7 +363,7 @@ viewFilter appState cfg model filterId label items = clearAllItem = Dropdown.anchorItem [ href clearAllRoute ] - [ lx_ "filter.clearSelection" appState ] + [ text (gettext "Clear selection" appState.locale) ] in [ Dropdown.divider , clearAllItem @@ -451,7 +441,7 @@ viewPagination appState cfg model page = if currentPage < page.totalPages then viewPageLink page.totalPages [ class "icon-right" ] - [ lx_ "pagination.last" appState + [ text (gettext "Last" appState.locale) , fa "fas fa-angle-double-right" ] @@ -464,7 +454,7 @@ viewPagination appState cfg model page = , classList [ ( "disabled", currentPage == page.totalPages ) ] , dataCy "listing_page-link_next" ] - [ lx_ "pagination.next" appState + [ text (gettext "Next" appState.locale) , fa "fas fa-angle-right" ] @@ -478,7 +468,7 @@ viewPagination appState cfg model page = , dataCy "listing_page-link_prev" ] [ fa "fas fa-angle-left" - , lx_ "pagination.prev" appState + , text (gettext "Prev" appState.locale) ] firstLink = @@ -486,7 +476,7 @@ viewPagination appState cfg model page = viewPageLink 1 [ class "icon-left" ] [ fa "fas fa-angle-double-left" - , lx_ "pagination.first" appState + , text (gettext "First" appState.locale) ] else @@ -509,14 +499,14 @@ viewEmpty appState config model = emptyText = if filtersActive then - l_ "empty.noMatch" appState + gettext "There are no results matching your search and filters." appState.locale else config.emptyText in Page.illustratedMessage { image = Undraw.noData - , heading = l_ "empty.heading" appState + , heading = gettext "No data" appState.locale , lines = [ emptyText ] , cy = "listing-empty" } @@ -578,7 +568,7 @@ viewUpdated appState config item = TimeUtils.toReadableDateTime appState.timeZone time in span (tooltip readableTime) - [ text <| l_ "item.updated" appState ++ inWordsWithConfig { withAffix = True } (locale appState) time updated.currentTime ] + [ text <| gettext "Updated" appState.locale ++ inWordsWithConfig { withAffix = True } (locale appState) time updated.currentTime ] Nothing -> emptyNode diff --git a/engine-wizard/elm/Wizard/Common/Components/OnlineUser.elm b/engine-wizard/elm/Wizard/Common/Components/OnlineUser.elm index a1028cc89..fa72d6a84 100644 --- a/engine-wizard/elm/Wizard/Common/Components/OnlineUser.elm +++ b/engine-wizard/elm/Wizard/Common/Components/OnlineUser.elm @@ -1,12 +1,12 @@ module Wizard.Common.Components.OnlineUser exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, img) import Html.Attributes exposing (class, src) import List.Extra as List import Shared.Data.OnlineUserInfo as OnlineUserInfo exposing (LoggedData, OnlineUserInfo) import Shared.Data.User as User import Shared.Html exposing (fa, faKeyClass) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (tooltip) @@ -41,7 +41,7 @@ viewAnonymous appState avatarNumber colorNumber = ( avatarIcon, avatarName ) = List.getAt (modBy (List.length avatars) avatarNumber) avatars - |> Maybe.withDefault ( faKeyClass "avatar.0" appState, lg "avatar.0" appState ) + |> Maybe.withDefault ( faKeyClass "avatar.0" appState, gettext "Anonymous Cat" appState.locale ) in ( avatarName , "color-" ++ String.fromInt colorNumber @@ -51,24 +51,24 @@ viewAnonymous appState avatarNumber colorNumber = getAvatars : AppState -> List ( String, String ) getAvatars appState = - [ ( faKeyClass "avatar.0" appState, lg "avatar.0" appState ) - , ( faKeyClass "avatar.1" appState, lg "avatar.1" appState ) - , ( faKeyClass "avatar.2" appState, lg "avatar.2" appState ) - , ( faKeyClass "avatar.3" appState, lg "avatar.3" appState ) - , ( faKeyClass "avatar.4" appState, lg "avatar.4" appState ) - , ( faKeyClass "avatar.5" appState, lg "avatar.5" appState ) - , ( faKeyClass "avatar.6" appState, lg "avatar.6" appState ) - , ( faKeyClass "avatar.7" appState, lg "avatar.7" appState ) - , ( faKeyClass "avatar.8" appState, lg "avatar.8" appState ) - , ( faKeyClass "avatar.9" appState, lg "avatar.9" appState ) - , ( faKeyClass "avatar.10" appState, lg "avatar.10" appState ) - , ( faKeyClass "avatar.11" appState, lg "avatar.11" appState ) - , ( faKeyClass "avatar.12" appState, lg "avatar.12" appState ) - , ( faKeyClass "avatar.13" appState, lg "avatar.13" appState ) - , ( faKeyClass "avatar.14" appState, lg "avatar.14" appState ) - , ( faKeyClass "avatar.15" appState, lg "avatar.15" appState ) - , ( faKeyClass "avatar.16" appState, lg "avatar.16" appState ) - , ( faKeyClass "avatar.17" appState, lg "avatar.17" appState ) - , ( faKeyClass "avatar.18" appState, lg "avatar.18" appState ) - , ( faKeyClass "avatar.19" appState, lg "avatar.19" appState ) + [ ( faKeyClass "avatar.0" appState, gettext "Anonymous Cat" appState.locale ) + , ( faKeyClass "avatar.1" appState, gettext "Anonymous Crow" appState.locale ) + , ( faKeyClass "avatar.2" appState, gettext "Anonymous Dog" appState.locale ) + , ( faKeyClass "avatar.3" appState, gettext "Anonymous Dove" appState.locale ) + , ( faKeyClass "avatar.4" appState, gettext "Anonymous Dragon" appState.locale ) + , ( faKeyClass "avatar.5" appState, gettext "Anonymous Fish" appState.locale ) + , ( faKeyClass "avatar.6" appState, gettext "Anonymous Frog" appState.locale ) + , ( faKeyClass "avatar.7" appState, gettext "Anonymous Hippo" appState.locale ) + , ( faKeyClass "avatar.8" appState, gettext "Anonymous Horse" appState.locale ) + , ( faKeyClass "avatar.9" appState, gettext "Anonymous Kiwi" appState.locale ) + , ( faKeyClass "avatar.10" appState, gettext "Anonymous Otter" appState.locale ) + , ( faKeyClass "avatar.11" appState, gettext "Anonymous Spider" appState.locale ) + , ( faKeyClass "avatar.12" appState, gettext "Anonymous Pig" appState.locale ) + , ( faKeyClass "avatar.13" appState, gettext "Anonymous Bug" appState.locale ) + , ( faKeyClass "avatar.14" appState, gettext "Anonymous Wizard" appState.locale ) + , ( faKeyClass "avatar.15" appState, gettext "Anonymous Ghost" appState.locale ) + , ( faKeyClass "avatar.16" appState, gettext "Anonymous Robot" appState.locale ) + , ( faKeyClass "avatar.17" appState, gettext "Anonymous Snowman" appState.locale ) + , ( faKeyClass "avatar.18" appState, gettext "Anonymous Tree" appState.locale ) + , ( faKeyClass "avatar.19" appState, gettext "Anonymous Cowboy" appState.locale ) ] diff --git a/engine-wizard/elm/Wizard/Common/Components/PlansList.elm b/engine-wizard/elm/Wizard/Common/Components/PlansList.elm index b87cdc75d..0604cd5c1 100644 --- a/engine-wizard/elm/Wizard/Common/Components/PlansList.elm +++ b/engine-wizard/elm/Wizard/Common/Components/PlansList.elm @@ -3,6 +3,7 @@ module Wizard.Common.Components.PlansList exposing , view ) +import Gettext exposing (gettext) import Html exposing (Html, table, tbody, td, text, th, thead, tr) import Html.Attributes exposing (class) import Maybe.Extra as Maybe @@ -10,22 +11,11 @@ import Shared.Common.TimeUtils as TimeUtils import Shared.Components.Badge as Badge import Shared.Data.Plan exposing (Plan) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lgx, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.Flash as Flash -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.PlansList" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.PlansList" - - type alias ViewConfig msg = { actions : Maybe (Plan -> List (Html msg)) } @@ -35,7 +25,7 @@ view appState cfg plans = let viewTrialBadge plan = if plan.test then - Badge.secondary [ class "ms-2" ] [ lx_ "badge.trial" appState ] + Badge.secondary [ class "ms-2" ] [ text (gettext "Trial" appState.locale) ] else emptyNode @@ -57,7 +47,7 @@ view appState cfg plans = True in if active then - Badge.success [ class "ms-2" ] [ lx_ "badge.active" appState ] + Badge.success [ class "ms-2" ] [ text (gettext "Active" appState.locale) ] else emptyNode @@ -89,7 +79,7 @@ view appState cfg plans = ] in if List.isEmpty plans then - Flash.info appState (l_ "noPlans" appState) + Flash.info appState (gettext "There are no plans for this instance." appState.locale) else let @@ -103,10 +93,10 @@ view appState cfg plans = table [ class "table table-striped table-hover" ] [ thead [] [ tr [] - [ th [] [ lx_ "table.plan" appState ] - , th [] [ lgx "appPlan.users" appState ] - , th [] [ lgx "appPlan.from" appState ] - , th [] [ lgx "appPlan.to" appState ] + [ th [] [ text (gettext "Plan" appState.locale) ] + , th [] [ text (gettext "Users" appState.locale) ] + , th [] [ text (gettext "From" appState.locale) ] + , th [] [ text (gettext "To" appState.locale) ] , headerActions ] ] diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire.elm index 3054205ef..84adbad8c 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire.elm @@ -27,12 +27,15 @@ module Wizard.Common.Components.Questionnaire exposing , view ) +--import Shared.Locale exposing (l, lf, lg, lgx, lh, lx) + import ActionResult exposing (ActionResult(..)) import Bootstrap.Button as Button import Bootstrap.Dropdown as Dropdown import Browser.Events import Debounce exposing (Debounce) import Dict exposing (Dict) +import Gettext exposing (gettext, ngettext) import Html exposing (Html, a, button, div, h2, i, img, input, label, li, option, p, select, span, strong, text, ul) import Html.Attributes exposing (attribute, checked, class, classList, disabled, href, id, name, placeholder, selected, src, target, type_, value) import Html.Events exposing (onBlur, onCheck, onClick, onFocus, onInput, onMouseDown) @@ -75,13 +78,13 @@ import Shared.Data.User as User import Shared.Data.UserInfo as UserInfo import Shared.Error.ApiError exposing (ApiError) import Shared.Html exposing (emptyNode, fa, faKeyClass, faSet) -import Shared.Locale exposing (l, lf, lg, lgx, lh, lx) import Shared.Markdown as Markdown import Shared.RegexPatterns as RegexPatterns import Shared.Undraw as Undraw import Shared.Utils exposing (dispatch, flip, getUuidString, listFilterJust, listInsertIf) import SplitPane import String +import String.Format as String import Time import Time.Distance as Time import Uuid exposing (Uuid) @@ -108,27 +111,25 @@ import Wizard.Projects.Common.QuestionnaireTodoGroup as QuestionnaireTodoGroup import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Questionnaire" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Common.Components.Questionnaire" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Questionnaire" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Common.Components.Questionnaire" - - +--l_ : String -> AppState -> String +--l_ = +-- l "Wizard.Common.Components.Questionnaire" +-- +-- +--lh_ : String -> List (Html msg) -> AppState -> List (Html msg) +--lh_ = +-- lh "Wizard.Common.Components.Questionnaire" +-- +-- +--lx_ : String -> AppState -> Html msg +--lx_ = +-- lx "Wizard.Common.Components.Questionnaire" +-- +-- +--lf_ : String -> List String -> AppState -> String +--lf_ = +-- lf "Wizard.Common.Components.Questionnaire" -- MODEL @@ -613,7 +614,7 @@ update msg wrapMsg mbSetFullscreenMsg appState ctx model = { model | questionnaireEvents = Success questionnaireHistory } Err _ -> - { model | questionnaireEvents = Error (lg "apiError.questionnaires.events.getListError" appState) } + { model | questionnaireEvents = Error (gettext "Unable to get version history." appState.locale) } HistoryMsg historyMsg -> wrap { model | historyModel = History.update historyMsg model.historyModel } @@ -910,7 +911,7 @@ handleTypeHintsLoaded appState model path result = { model | typeHints = Just { typeHints | hints = Success hints } } Err _ -> - { model | typeHints = Just { typeHints | hints = Error <| lg "apiError.typeHints.getListError" appState } } + { model | typeHints = Just { typeHints | hints = Error <| gettext "Unable to get type hints." appState.locale } } else model @@ -1023,13 +1024,16 @@ view appState cfg ctx model = ( migrationWarning, migrationWarningEnabled ) = case model.questionnaire.migrationUuid of Just migrationUuid -> + let + warningLink = + linkTo appState (Routes.projectsMigration migrationUuid) [] [ text (gettext "project migration" appState.locale) ] + + warning = + gettext "There is an ongoing %s. Finish it before you can continue editing this project." appState.locale + |> flip String.formatHtml [ warningLink ] + in ( div [ class "questionnaire__warning" ] - [ div [ class "alert alert-warning" ] - (lh_ "migrationWarning" - [ linkTo appState (Routes.projectsMigration migrationUuid) [] [ lx_ "migrationWarning.migration" appState ] ] - appState - ) - ] + [ div [ class "alert alert-warning" ] warning ] , True ) @@ -1082,28 +1086,28 @@ viewQuestionnaireToolbar appState model = , toggleMsg = ViewSettingsDropdownMsg , toggleButton = Dropdown.toggle [ Button.roleLink, Button.attrs [ class "item" ] ] - [ lx_ "toolbar.view" appState ] + [ text (gettext "View" appState.locale) ] , items = [ Dropdown.anchorItem [ onClick (SetViewSettings QuestionnaireViewSettings.all) ] - [ lx_ "toolbar.view.showAll" appState ] + [ text (gettext "Show all" appState.locale) ] , Dropdown.anchorItem [ onClick (SetViewSettings QuestionnaireViewSettings.none) ] - [ lx_ "toolbar.view.hideAll" appState ] + [ text (gettext "Hide all" appState.locale) ] , Dropdown.divider , Dropdown.anchorItem [ class "dropdown-item-icon", onClick (SetViewSettings (QuestionnaireViewSettings.toggleAnsweredBy viewSettings)) ] - [ settingsIcon viewSettings.answeredBy, lx_ "toolbar.view.answeredBy" appState ] + [ settingsIcon viewSettings.answeredBy, text (gettext "Answered by" appState.locale) ] , Dropdown.anchorItem [ class "dropdown-item-icon" , onClick (SetViewSettings (QuestionnaireViewSettings.togglePhases viewSettings)) ] - [ settingsIcon viewSettings.phases, lx_ "toolbar.view.phases" appState ] + [ settingsIcon viewSettings.phases, text (gettext "Phases" appState.locale) ] , Dropdown.anchorItem [ class "dropdown-item-icon" , onClick (SetViewSettings (QuestionnaireViewSettings.toggleTags viewSettings)) ] - [ settingsIcon viewSettings.tags, lx_ "toolbar.view.tags" appState ] + [ settingsIcon viewSettings.tags, text (gettext "Question tags" appState.locale) ] ] } ] @@ -1184,7 +1188,7 @@ viewQuestionnaireToolbar appState model = todosButton = div [ class "item-group" ] [ a [ class "item", classList [ ( "selected", todosOpen ) ], onClick (SetRightPanel todosPanel) ] - [ lx_ "toolbar.todos" appState + [ text (gettext "TODOs" appState.locale) , todosBadge ] ] @@ -1205,7 +1209,7 @@ viewQuestionnaireToolbar appState model = commentsOverviewButton = div [ class "item-group" ] [ a [ class "item", classList [ ( "selected", commentsOverviewOpen ) ], onClick (SetRightPanel commentsOverviewPanel) ] - [ lx_ "toolbar.comments" appState + [ text (gettext "Comments" appState.locale) , commentsBadge ] ] @@ -1216,7 +1220,7 @@ viewQuestionnaireToolbar appState model = warningsButton = div [ class "item-group" ] [ a [ class "item", classList [ ( "selected", warningsOpen ) ], onClick (SetRightPanel warningsPanel) ] - [ lx_ "toolbar.warnings" appState + [ text (gettext "Warnings" appState.locale) , Badge.danger [ class "rounded-pill" ] [ text (String.fromInt warningsLength) ] ] ] @@ -1230,7 +1234,7 @@ viewQuestionnaireToolbar appState model = versionHistoryButton = div [ class "item-group" ] [ a [ class "item", classList [ ( "selected", versionsOpen ) ], onClick (SetRightPanel versionsPanel) ] - [ lx_ "toolbar.versionHistory" appState ] + [ text (gettext "Version history" appState.locale) ] ] ( expandIcon, expandMsg ) = @@ -1289,7 +1293,7 @@ viewQuestionnaireLeftPanelPhaseSelection appState cfg model = [ onInput SetPhase ] in div [ class "questionnaire__left-panel__phase" ] - [ label [] [ lgx "questionnaire.currentPhase" appState ] + [ label [] [ text (gettext "Current Phase" appState.locale) ] , select (class "form-select" :: selectAttrs) (List.map (viewQuestionnaireLeftPanelPhaseSelectionOption model.questionnaire.phaseUuid) phases) ] @@ -1408,7 +1412,7 @@ viewQuestionnaireRightPanelTodos appState model = in if List.isEmpty todos then div [ class "todos todos-empty" ] <| - [ illustratedMessage Undraw.feelingHappy (l_ "todos.completed" appState) ] + [ illustratedMessage Undraw.feelingHappy (gettext "All TODOs have been completed." appState.locale) ] else div [ class "todos" ] <| @@ -1439,7 +1443,7 @@ viewQuestionnaireRightPanelWarnings appState model = in if List.isEmpty warnings then div [ class "todos todos-empty" ] <| - [ illustratedMessage Undraw.feelingHappy (l_ "warnings.noWarnings" appState) ] + [ illustratedMessage Undraw.feelingHappy (gettext "There are no more warnings." appState.locale) ] else div [ class "todos" ] <| @@ -1496,7 +1500,7 @@ viewQuestionnaireRightPanelCommentsOverview appState model = [ div [ class "alert alert-info" ] [ p [] - (lh_ "commentsOverview.empty" [ faSet "questionnaire.comments" appState ] appState) + (String.formatHtml (gettext "Click the %s icon to add new comments to a question." appState.locale) [ faSet "questionnaire.comments" appState ]) ] ] @@ -1528,7 +1532,7 @@ viewQuestionnaireRightPanelComments appState model path = if model.commentsViewPrivate then div [ class "alert alert-editor-notes" ] [ i [ class "fa fas fa-lock" ] [] - , span [] [ lx_ "comments.editorNotes.description" appState ] + , span [] [ text (gettext "Editor notes are only visible to project Editors and Owners." appState.locale) ] ] else @@ -1544,7 +1548,7 @@ viewQuestionnaireRightPanelComments appState model path = div [ class "form-check" ] [ label [ class "form-check-label form-check-toggle" ] [ input [ type_ "checkbox", class "form-check-input", onCheck CommentsViewResolved ] [] - , span [] [ lx_ "comments.viewResolved" appState ] + , span [] [ text (gettext "View resolved comments" appState.locale) ] ] ] @@ -1560,8 +1564,8 @@ viewQuestionnaireRightPanelComments appState model path = newThreadForm = viewCommentReplyForm appState - { submitText = l_ "comments.newThread.submit" appState - , placeholderText = l_ "comments.newThread.placeholder" appState + { submitText = gettext "Comment" appState.locale + , placeholderText = gettext "Create a new comment..." appState.locale , model = model , path = path , mbThreadUuid = Nothing @@ -1608,8 +1612,8 @@ viewCommentsNavigation appState model commentThreads = , onClick (CommentsViewPrivate False) , dataCy "comments_nav_comments" ] - [ span [ attribute "data-content" (l_ "comments.nav.comments" appState) ] - [ lx_ "comments.nav.comments" appState ] + [ span [ attribute "data-content" (gettext "Comments" appState.locale) ] + [ text (gettext "Comments" appState.locale) ] , toBadge publicThreadsCount ] ] @@ -1620,8 +1624,8 @@ viewCommentsNavigation appState model commentThreads = , onClick (CommentsViewPrivate True) , dataCy "comments_nav_private-notes" ] - [ span [ attribute "data-content" (l_ "comments.nav.editorNotes" appState) ] - [ lx_ "comments.nav.editorNotes" appState ] + [ span [ attribute "data-content" (gettext "Editor notes" appState.locale) ] + [ text (gettext "Editor notes" appState.locale) ] , toBadge privateThreadsCount ] ] @@ -1635,7 +1639,7 @@ viewCommentThread appState model path commentThread = if model.commentDeleting == Maybe.map .uuid (List.head commentThread.comments) then viewCommentDeleteOverlay appState { deleteMsg = CommentThreadDelete path commentThread.uuid commentThread.private - , deleteText = l_ "comments.commentThread.delete" appState + , deleteText = gettext "Delete this comment thread?" appState.locale , extraClass = "CommentDeleteOverlay--Thread" } @@ -1648,8 +1652,8 @@ viewCommentThread appState model path commentThread = else viewCommentReplyForm appState - { submitText = l_ "comments.reply.submit" appState - , placeholderText = l_ "comments.reply.placeholder" appState + { submitText = gettext "Reply" appState.locale + , placeholderText = gettext "Reply..." appState.locale , model = model , path = path , mbThreadUuid = Just commentThread.uuid @@ -1691,12 +1695,12 @@ viewComment appState model path commentThread index comment = , disabled (String.isEmpty editValue) , onClick (CommentEditSubmit path commentThread.uuid comment.uuid editValue commentThread.private) ] - [ lx_ "comments.edit.submit" appState ] + [ text (gettext "Edit" appState.locale) ] , button [ class "btn btn-outline-secondary btn-sm" , onClick (CommentEditCancel comment.uuid) ] - [ lx_ "comments.form.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] ] ] @@ -1707,7 +1711,7 @@ viewComment appState model path commentThread index comment = if index /= 0 && model.commentDeleting == Just comment.uuid then viewCommentDeleteOverlay appState { deleteMsg = CommentDeleteSubmit path commentThread.uuid comment.uuid commentThread.private - , deleteText = l_ "comments.comment.delete" appState + , deleteText = gettext "Delete this comment?" appState.locale , extraClass = "CommentDeleteOverlay--Comment" } @@ -1731,7 +1735,7 @@ viewCommentHeader appState model path commentThread index comment = , onClick (CommentThreadResolve path commentThread.uuid commentThread.private) , dataCy "comments_comment_resolve" ] - ++ tooltipLeft (l_ "comments.comment.action.resolveTitle" appState) + ++ tooltipLeft (gettext "Resolve comment thread" appState.locale) ) [ faSet "questionnaire.commentsResolve" appState ] @@ -1741,7 +1745,7 @@ viewCommentHeader appState model path commentThread index comment = reopenAction = Dropdown.anchorItem [ onClick (CommentThreadReopen path commentThread.uuid commentThread.private) ] - [ lx_ "comments.comment.action.reopen" appState ] + [ text (gettext "Reopen" appState.locale) ] reopenActionVisible = index == 0 && Feature.projectCommentThreadReopen appState model.questionnaire commentThread @@ -1749,7 +1753,7 @@ viewCommentHeader appState model path commentThread index comment = editAction = Dropdown.anchorItem [ onClick (CommentEditInput comment.uuid comment.text) ] - [ lx_ "comments.comment.action.edit" appState ] + [ text (gettext "Edit" appState.locale) ] editActionVisible = Feature.projectCommentEdit appState model.questionnaire commentThread comment @@ -1759,7 +1763,7 @@ viewCommentHeader appState model path commentThread index comment = [ onClick (CommentDelete (Just comment.uuid)) , dataCy "comments_comment_menu_delete" ] - [ lx_ "comments.comment.action.delete" appState ] + [ text (gettext "Delete" appState.locale) ] deleteActionVisible = (index == 0 && Feature.projectCommentThreadDelete appState model.questionnaire commentThread) @@ -1796,7 +1800,7 @@ viewCommentHeader appState model path commentThread index comment = editedLabel = if comment.createdAt /= comment.updatedAt then span (tooltip (TimeUtils.toReadableDateTime appState.timeZone comment.updatedAt)) - [ text <| " (" ++ l_ "comments.comment.editedLabel" appState ++ ")" ] + [ text <| " (" ++ gettext "edited" appState.locale ++ ")" ] else emptyNode @@ -1817,7 +1821,7 @@ viewCommentHeader appState model path commentThread index comment = [ UserIcon.view userForIcon , div [ class "Comment__Header__User" ] [ strong [ class "Comment__Header__User__Name" ] - [ text (Maybe.unwrap (lg "user.anonymous" appState) User.fullName comment.createdBy) + [ text (Maybe.unwrap (gettext "Anonymous user" appState.locale) User.fullName comment.createdBy) ] , span [ class "Comment__Header__User__Time" ] [ text createdLabel, editedLabel ] ] @@ -1877,7 +1881,7 @@ viewCommentReplyForm appState { submitText, placeholderText, model, path, mbThre , onClick (CommentInput path mbThreadUuid "") , dataCy (cyFormType "comments_reply-form_cancel") ] - [ lx_ "comments.form.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] ] in div [ class "CommentReplyForm", classList [ ( "CommentReplyForm--Private", private ) ] ] @@ -1903,8 +1907,8 @@ viewCommentDeleteOverlay appState { deleteMsg, deleteText, extraClass } = , onClick deleteMsg , dataCy "comments_delete-modal_delete" ] - [ lx_ "comments.deleteOverlay.delete" appState ] - , button [ class "btn btn-secondary btn-sm", onClick (CommentDelete Nothing) ] [ lx_ "comments.form.cancel" appState ] + [ text (gettext "Delete" appState.locale) ] + , button [ class "btn btn-secondary btn-sm", onClick (CommentDelete Nothing) ] [ text (gettext "Cancel" appState.locale) ] ] ] @@ -2000,12 +2004,12 @@ viewPrevAndNextChapterLinks appState chapters currentChapter = viewPrevChapterLink = viewChapterLink "chapter-link-prev" - (l_ "chapterLinks.prev" appState) + (gettext "Previous Chapter" appState.locale) (faSet "_global.chevronLeft" appState) viewNextChapterLink = viewChapterLink "chapter-link-next" - (l_ "chapterLinks.next" appState) + (gettext "Next Chapter" appState.locale) (faSet "_global.chevronRight" appState) prevChapterLink = @@ -2091,7 +2095,7 @@ viewQuestion appState cfg ctx model path humanIdentifiers order question = User.fullName userInfo Nothing -> - l_ "question.answeredBy.anonymous" appState + gettext "anonymous user" appState.locale readableTime = TimeUtils.toReadableDateTime appState.timeZone reply.createdAt @@ -2103,7 +2107,7 @@ viewQuestion appState cfg ctx model path humanIdentifiers order question = span (tooltip readableTime) [ text timeDiff ] in div [ class "mt-2", dataCy "questionnaire_answered-by" ] - (lh_ "question.answeredBy" [ time, text userName ] appState) + (String.formatHtml (gettext "Answered %s by %s." appState.locale) [ time, text userName ]) _ -> emptyNode @@ -2212,7 +2216,7 @@ viewQuestionClearButton appState cfg path hasAnswer = else a [ class "clear-answer", onClick (ClearReply (pathToString path)) ] [ faSet "questionnaire.clearAnswer" appState - , lx_ "answer.clear" appState + , text (gettext "Clear answer" appState.locale) ] @@ -2270,7 +2274,7 @@ viewQuestionList appState cfg ctx model path humanIdentifiers question = noAnswersInfo = if cfg.features.readonly && List.isEmpty itemUuids then - i [] [ lx_ "list.noAnswers" appState ] + i [] [ text (gettext "There are no answers yet." appState.locale) ] else emptyNode @@ -2293,7 +2297,7 @@ viewQuestionListAdd appState cfg itemUuids path = , onClick (AddItem (pathToString path) itemUuids) ] [ faSet "_global.add" appState - , lx_ "list.add" appState + , text (gettext "Add" appState.locale) ] @@ -2334,7 +2338,7 @@ viewQuestionListItem appState cfg ctx model question path humanIdentifiers itemC (class "btn-link text-danger" :: onClick (RemoveItem (pathToString path) uuid) :: dataCy "item-delete" - :: tooltip (l_ "list.delete" appState) + :: tooltip (gettext "Delete" appState.locale) ) [ faSet "_global.delete" appState ] @@ -2347,7 +2351,7 @@ viewQuestionListItem appState cfg ctx model question path humanIdentifiers itemC (class "btn-link me-2" :: onClick (MoveItemUp (pathToString path) uuid) :: dataCy "item-move-up" - :: tooltip (l_ "list.moveUp" appState) + :: tooltip (gettext "Move Up" appState.locale) ) [ faSet "questionnaire.item.moveUp" appState ] @@ -2360,7 +2364,7 @@ viewQuestionListItem appState cfg ctx model question path humanIdentifiers itemC (class "btn-link me-2" :: onClick (MoveItemDown (pathToString path) uuid) :: dataCy "item-move-down" - :: tooltip (l_ "list.moveDown" appState) + :: tooltip (gettext "Move Down" appState.locale) ) [ faSet "questionnaire.item.moveDown" appState ] in @@ -2369,7 +2373,7 @@ viewQuestionListItem appState cfg ctx model question path humanIdentifiers itemC itemTitle = if isCollapsed then Maybe.unwrap - (i [ class "ms-2" ] [ text (lf_ "list.defaultItem" [ String.fromInt (index + 1) ] appState) ]) + (i [ class "ms-2" ] [ text (String.format (gettext "Item %s" appState.locale) [ String.fromInt (index + 1) ]) ]) (strong [ class "ms-2" ] << List.singleton << text) (QuestionnaireDetail.getItemTitle model.questionnaire itemPath questions) @@ -2460,12 +2464,12 @@ viewQuestionValue appState cfg model path question = Just EmailQuestionValueType -> [ input (type_ "email" :: defaultAttrs ++ extraAttrs) [] - , warningView RegexPatterns.email (l_ "value.invalidEmail" appState) + , warningView RegexPatterns.email (gettext "This is not a valid email address." appState.locale) ] Just UrlQuestionValueType -> [ input (type_ "email" :: defaultAttrs ++ extraAttrs) [] - , warningView RegexPatterns.url (l_ "value.invalidUrl" appState) + , warningView RegexPatterns.url (gettext "This is not a valid URL." appState.locale) ] Just TextQuestionValueType -> @@ -2473,7 +2477,7 @@ viewQuestionValue appState cfg model path question = Just ColorQuestionValueType -> [ input (type_ "color" :: defaultAttrs ++ extraAttrs) [] - , warningView RegexPatterns.color (l_ "value.invalidColor" appState) + , warningView RegexPatterns.color (gettext "This is not a valid color." appState.locale) ] _ -> @@ -2514,7 +2518,7 @@ viewQuestionIntegrationWidgetSelectButton appState cfg path widgetIntegrationDat [ onClick (OpenIntegrationWidget (pathToString path) widgetIntegrationData.widgetUrl) , class "btn btn-secondary" ] - [ lx_ "integrationWidget.select" appState ] + [ text (gettext "Select" appState.locale) ] _ -> emptyNode @@ -2585,7 +2589,7 @@ viewQuestionIntegrationTypeHints appState cfg model path = Success [] -> div [ class "info" ] [ faSet "_global.info" appState - , lx_ "typeHints.empty" appState + , text (gettext "There are no results for your search." appState.locale) ] Success hints -> @@ -2594,7 +2598,7 @@ viewQuestionIntegrationTypeHints appState cfg model path = Loading -> div [ class "loading" ] [ faSet "_global.spinner" appState - , lx_ "typeHints.loading" appState + , text (gettext "Loading..." appState.locale) ] Error err -> @@ -2710,7 +2714,7 @@ viewAnswer appState cfg km path selectedAnswerUuid order answer = emptyNode else - span (class "ms-3 text-muted" :: tooltipRight (l_ "answer.followUpTitle" appState)) + span (class "ms-3 text-muted" :: tooltipRight (gettext "This option leads to some follow up questions." appState.locale)) [ i [ class (faKeyClass "questionnaire.followUpsIndication" appState) ] @@ -2767,7 +2771,7 @@ viewCommentAction appState cfg model path = , dataCy "questionnaire_question-action_comment" ] [ faSet "questionnaire.comments" appState - , text <| String.fromInt commentCount ++ " comments" + , text <| String.format (ngettext ( "1 comment", "%s comments" ) commentCount appState.locale) [ String.fromInt commentCount ] ] else @@ -2797,10 +2801,10 @@ viewTodoAction appState cfg model path = in if hasTodo then span [ class "action action-todo" ] - [ span [] [ lx_ "todoAction.todo" appState ] + [ span [] [ text (gettext "TODO" appState.locale) ] , a ((onClick <| SetLabels currentPath []) - :: tooltip (l_ "todoAction.remove" appState) + :: tooltip (gettext "Remove TODO" appState.locale) ) [ faSet "_global.remove" appState ] ] @@ -2811,7 +2815,7 @@ viewTodoAction appState cfg model path = , onClick <| SetLabels currentPath [ QuestionnaireDetail.todoUuid ] ] [ faSet "_global.add" appState - , span [] [ span [] [ lx_ "todoAction.add" appState ] ] + , span [] [ span [] [ text (gettext "Add TODO" appState.locale) ] ] ] else @@ -2844,11 +2848,11 @@ viewRemoveItemModal : AppState -> Model -> Html Msg viewRemoveItemModal appState model = let cfg = - { modalTitle = l_ "removeItemModal.title" appState - , modalContent = [ lx_ "removeItemModal.text" appState ] + { modalTitle = gettext "Remove Item" appState.locale + , modalContent = [ text (gettext "Are you sure you want to remove this item?" appState.locale) ] , visible = Maybe.isJust model.removeItem , actionResult = Unset - , actionName = l_ "removeItemModal.action" appState + , actionName = gettext "Remove" appState.locale , actionMsg = RemoveItemConfirm , cancelMsg = Just RemoveItemCancel , dangerous = True diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm index 0c1d370e8..4d7598e6e 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DefaultQuestionnaireRenderer.elm @@ -1,5 +1,8 @@ module Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer exposing (create) +--import Shared.Locale exposing (l, lg, lx) + +import Gettext exposing (gettext) import Html exposing (Html, a, div, p, span, text) import Html.Attributes exposing (class, href, target) import List.Extra as List @@ -16,21 +19,21 @@ import Shared.Data.KnowledgeModel.Reference exposing (Reference(..)) import Shared.Data.KnowledgeModel.Reference.ResourcePageReferenceData exposing (ResourcePageReferenceData) import Shared.Data.KnowledgeModel.Reference.URLReferenceData exposing (URLReferenceData) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lx) import Shared.Markdown as Markdown import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire exposing (QuestionnaireRenderer) import Wizard.Common.Components.Questionnaire.QuestionnaireViewSettings exposing (QuestionnaireViewSettings) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer" - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer" +--l_ : String -> AppState -> String +--l_ = +-- l "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer" +-- +-- +--lx_ : String -> AppState -> Html msg +--lx_ = +-- lx "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer" create : AppState -> KnowledgeModel -> QuestionnaireRenderer msg @@ -184,7 +187,8 @@ viewRequiredLevel appState qvs phases questionPhaseUuid = span [] [ span [ class "caption" ] [ faSet "questionnaire.desirable" appState - , lx_ "desirable" appState + , text (gettext "Desirable" appState.locale) + , text ": " , span [] [ text level.title ] ] ] @@ -234,7 +238,7 @@ viewUrlReferences : AppState -> List URLReferenceData -> Html msg viewUrlReferences appState = viewExtraItems { icon = faSet "questionnaire.urlReferences" appState - , label = l_ "externalLinks" appState + , label = gettext "External links" appState.locale , viewItem = viewUrlReference } @@ -249,7 +253,7 @@ viewExperts : AppState -> List Expert -> Html msg viewExperts appState = viewExtraItems { icon = faSet "questionnaire.experts" appState - , label = lg "experts" appState + , label = gettext "Experts" appState.locale , viewItem = viewExpert } diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DeleteVersionModal.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DeleteVersionModal.elm index 8ff95a4a8..6608a92a9 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DeleteVersionModal.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/DeleteVersionModal.elm @@ -9,32 +9,19 @@ module Wizard.Common.Components.Questionnaire.DeleteVersionModal exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, p, strong, text) import Maybe.Extra as Maybe import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.QuestionnaireVersion exposing (QuestionnaireVersion) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lh, lx) +import Shared.Utils exposing (flip) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Modal as Modal -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Questionnaire.DeleteVersionModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Common.Components.Questionnaire.DeleteVersionModal" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Questionnaire.DeleteVersionModal" - - -- MODEL @@ -124,19 +111,24 @@ view appState model = content = case model.mbQuestionnaireVersion of Just version -> - [ p [] (lh_ "deleteMessage" [ strong [] [ text <| "\"" ++ version.name ++ "\"" ] ] appState) - , p [] [ lx_ "deleteInfo" appState ] + let + deleteMessage = + gettext "Are you sure you want to delete version %s?" appState.locale + |> flip String.formatHtml [ strong [] [ text <| "\"" ++ version.name ++ "\"" ] ] + in + [ p [] deleteMessage + , p [] [ text (gettext "(Your answers will remain unchanged)" appState.locale) ] ] Nothing -> [] in Modal.confirm appState - { modalTitle = l_ "title" appState + { modalTitle = gettext "Delete version" appState.locale , modalContent = content , visible = Maybe.isJust model.mbQuestionnaireVersion , actionResult = ActionResult.map (always "") model.deleteResult - , actionName = l_ "action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = Delete , cancelMsg = Just Close , dangerous = True diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm index 27f9245dc..c9244f8c8 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm @@ -6,8 +6,11 @@ module Wizard.Common.Components.Questionnaire.FeedbackModal exposing , view ) +--import Shared.Locale exposing (l, lf, lg, lh, lx) + import ActionResult exposing (ActionResult(..)) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, a, div, li, p, text, ul) import Html.Attributes exposing (class, href, target) import Maybe.Extra as Maybe @@ -16,32 +19,33 @@ import Shared.Data.Feedback exposing (Feedback) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lf, lg, lh, lx) import String exposing (fromInt) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire.FeedbackForm as FeedbackForm exposing (FeedbackForm) import Wizard.Common.View.FormGroup as FormGroup import Wizard.Common.View.Modal as Modal -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Questionnaire.FeedbackModal" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Common.Components.Questionnaire.FeedbackModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Common.Components.Questionnaire.FeedbackModal" - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Questionnaire.FeedbackModal" +--l_ : String -> AppState -> String +--l_ = +-- l "Wizard.Common.Components.Questionnaire.FeedbackModal" +-- +-- +--lf_ : String -> List String -> AppState -> String +--lf_ = +-- lf "Wizard.Common.Components.Questionnaire.FeedbackModal" +-- +-- +--lh_ : String -> List (Html msg) -> AppState -> List (Html msg) +--lh_ = +-- lh "Wizard.Common.Components.Questionnaire.FeedbackModal" +-- +-- +--lx_ : String -> AppState -> Html msg +--lx_ = +-- lx "Wizard.Common.Components.Questionnaire.FeedbackModal" type alias Model = @@ -98,7 +102,7 @@ update msg appState model = ( { model | feedbacks = Success feedbacks }, Cmd.none ) Err error -> - ( { model | feedbacks = ApiError.toActionResult appState (lg "apiError.feedbacks.getError" appState) error } + ( { model | feedbacks = ApiError.toActionResult appState (gettext "Unable to get feedback." appState.locale) error } , Cmd.none ) @@ -111,7 +115,7 @@ update msg appState model = ( { model | feedbackResult = Success feedbackResult }, Cmd.none ) Err error -> - ( { model | feedbackResult = ApiError.toActionResult appState (lg "apiError.feedbacks.postError" appState) error } + ( { model | feedbackResult = ApiError.toActionResult appState (gettext "Feedback could not be sent." appState.locale) error } , Cmd.none ) @@ -145,10 +149,10 @@ view appState model = let issueLink = a [ href feedback.issueUrl, target "_blank" ] - [ text <| lf_ "issue" [ fromInt feedback.issueId ] appState ] + [ text <| String.format (gettext "Issue %s" appState.locale) [ fromInt feedback.issueId ] ] in [ p [] - (lh_ "follow" [ issueLink ] appState) + (String.formatHtml (gettext "You can follow the GitHub %s." appState.locale) [ issueLink ]) ] _ -> @@ -157,16 +161,16 @@ view appState model = ( actionName, actionMsg, cancelMsg ) = case model.feedbackResult of Success _ -> - ( l_ "done" appState, CloseFeedback, Nothing ) + ( gettext "Done" appState.locale, CloseFeedback, Nothing ) _ -> - ( l_ "send" appState, FeedbackFormMsg Form.Submit, Just <| CloseFeedback ) + ( gettext "Send" appState.locale, FeedbackFormMsg Form.Submit, Just <| CloseFeedback ) modalConfig = - { modalTitle = l_ "title" appState + { modalTitle = gettext "Title" appState.locale , modalContent = modalContent , visible = visible - , actionResult = ActionResult.map (\_ -> lg "apiSuccess.feedbacks.post" appState) model.feedbackResult + , actionResult = ActionResult.map (\_ -> gettext "Your feedback has been sent." appState.locale) model.feedbackResult , actionName = actionName , actionMsg = actionMsg , cancelMsg = cancelMsg @@ -186,7 +190,7 @@ feedbackModalContent appState model = if List.length feedbacks > 0 then div [] [ div [] - [ lx_ "reportedIssues" appState ] + [ text (gettext "There are already some issues reported with this question." appState.locale) ] , ul [] (List.map feedbackIssue feedbacks) ] @@ -197,10 +201,10 @@ feedbackModalContent appState model = emptyNode in [ div [ class "alert alert-info" ] - [ lx_ "info" appState ] + [ text (gettext "If you found something wrong with the question, you can send us your recommendation on how to improve it." appState.locale) ] , feedbackList - , FormGroup.input appState model.feedbackForm "title" (l_ "form.title" appState) |> Html.map FeedbackFormMsg - , FormGroup.textarea appState model.feedbackForm "content" (l_ "form.description" appState) |> Html.map FeedbackFormMsg + , FormGroup.input appState model.feedbackForm "title" (gettext "Title" appState.locale) |> Html.map FeedbackFormMsg + , FormGroup.textarea appState model.feedbackForm "content" (gettext "Description" appState.locale) |> Html.map FeedbackFormMsg ] diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/History.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/History.elm index 28892e92d..0a716bd79 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/History.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/History.elm @@ -11,6 +11,7 @@ module Wizard.Common.Components.Questionnaire.History exposing import ActionResult exposing (ActionResult) import Bootstrap.Dropdown as Dropdown import Dict exposing (Dict) +import Gettext exposing (gettext) import Html exposing (Html, a, br, div, em, h5, img, input, label, li, span, strong, text, ul) import Html.Attributes exposing (class, src, type_) import Html.Events exposing (onCheck, onClick) @@ -31,8 +32,8 @@ import Shared.Data.QuestionnaireVersion exposing (QuestionnaireVersion) import Shared.Data.User as User import Shared.Data.UserSuggestion exposing (UserSuggestion) import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (lg, lh, lx) import Shared.Utils exposing (flip) +import String.Format as String import Time import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) @@ -43,16 +44,6 @@ import Wizard.Common.View.Page as Page import Wizard.Routes as Routes -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Common.Components.Questionnaire.History" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.Questionnaire.History" - - -- MODEL @@ -174,7 +165,7 @@ viewHistory appState cfg model questionnaireEvents = div [ class "form-check" ] [ label [ class "form-check-label form-check-toggle" ] [ input [ type_ "checkbox", class "form-check-input", onCheck (cfg.wrapMsg << SetNamedOnly) ] [] - , span [] [ lx_ "nameOnly.label" appState ] + , span [] [ text (gettext "Named versions only" appState.locale) ] ] ] in @@ -300,18 +291,18 @@ viewEventHeaderDropdown appState cfg model questionnaireEvents event = Just version -> [ Dropdown.anchorItem [ onClick (cfg.renameVersionMsg version) ] [ faSet "_global.edit" appState - , lx_ "action.rename" appState + , text (gettext "Rename this version" appState.locale) ] , Dropdown.anchorItem [ onClick (cfg.deleteVersionMsg version), class "text-danger" ] [ faSet "_global.delete" appState - , lx_ "action.delete" appState + , text (gettext "Delete this version" appState.locale) ] ] Nothing -> [ Dropdown.anchorItem [ onClick (cfg.createVersionMsg eventUuid) ] [ faSet "_global.edit" appState - , lx_ "action.name" appState + , text (gettext "Name this version" appState.locale) ] ] @@ -325,7 +316,7 @@ viewEventHeaderDropdown appState cfg model questionnaireEvents event = viewQuestionnaireAction = [ Dropdown.anchorItem [ onClick (viewMsg eventUuid) ] [ faSet "_global.questionnaire" appState - , lx_ "action.viewQuestionnaire" appState + , text (gettext "View questionnaire" appState.locale) ] ] @@ -340,7 +331,7 @@ viewEventHeaderDropdown appState cfg model questionnaireEvents event = in [ Dropdown.anchorItem createDocumentAttributes [ faSet "questionnaire.history.createDocument" appState - , lx_ "action.createDocument" appState + , text (gettext "Create document" appState.locale) ] ] @@ -361,7 +352,7 @@ viewEventHeaderDropdown appState cfg model questionnaireEvents event = divider previewAction ++ [ Dropdown.anchorItem [ onClick (revertMsg event), class "text-danger" ] [ faSet "questionnaire.history.revert" appState - , lx_ "action.revert" appState + , text (gettext "Revert to this version" appState.locale) ] ] @@ -486,7 +477,7 @@ viewEventDetailSetReply appState cfg data question = viewEventDetailClearReply : AppState -> ViewConfig msg -> ClearReplyData -> Question -> Html msg viewEventDetailClearReply appState cfg data question = div [ class "event-detail" ] - [ em [] [ lx_ "event.cleared" appState, br [] [], linkToQuestion cfg question data.path ] ] + [ em [] [ text (gettext "Cleared reply of" appState.locale), br [] [], linkToQuestion cfg question data.path ] ] viewEventDetailSetLevel : AppState -> ViewConfig msg -> SetPhaseData -> Html msg @@ -499,7 +490,7 @@ viewEventDetailSetLevel appState cfg data = Maybe.unwrap "" .title mbLevel in div [ class "event-detail" ] - [ em [] (lh_ "event.phase" [ strong [] [ text levelName ] ] appState) ] + [ em [] (String.formatHtml (gettext "Set phase to %s" appState.locale) [ strong [] [ text levelName ] ]) ] viewEventUser : AppState -> Maybe UserSuggestion -> Html msg @@ -511,7 +502,7 @@ viewEventUser appState mbUser = ( User.imageUrlOrGravatar user, User.fullName user ) Nothing -> - ( User.defaultGravatar, lg "user.anonymous" appState ) + ( User.defaultGravatar, gettext "Anonymous user" appState.locale ) in div [ class "user" ] [ img [ src imageUrl, class "user-icon user-icon-small" ] [] diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/NavigationTree.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/NavigationTree.elm index a15559796..1c159b310 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/NavigationTree.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/NavigationTree.elm @@ -9,6 +9,7 @@ module Wizard.Common.Components.Questionnaire.NavigationTree exposing ) import Dict exposing (Dict) +import Gettext exposing (gettext) import Html exposing (Html, a, div, i, li, span, strong, text, ul) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) @@ -22,15 +23,10 @@ import Shared.Data.KnowledgeModel.Question as Question exposing (Question) import Shared.Data.QuestionnaireDetail as QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Data.QuestionnaireDetail.Reply.ReplyValue as ReplyValue import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (lf, lgx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Common.Components.Questionnaire.NavigationTree" - - type alias Model = { openPaths : Dict String Bool } @@ -82,7 +78,7 @@ view appState cfg model = KnowledgeModel.getChapters cfg.questionnaire.knowledgeModel in div [ class "NavigationTree" ] - [ strong [] [ lgx "chapters" appState ] + [ strong [] [ text (gettext "Chapters" appState.locale) ] , div [ class "nav nav-pills flex-column" ] (List.indexedMap (viewChapter appState cfg model) chapters) ] @@ -250,7 +246,7 @@ viewListQuestionItem appState cfg model itemTemplateQuestions currentPath index QuestionnaireDetail.getItemTitle cfg.questionnaire itemPath itemTemplateQuestions defaultItemTitle = - i [] [ text (lf_ "defaultItem" [ String.fromInt (index + 1) ] appState) ] + i [] [ text (String.format (gettext "Item %s" appState.locale) [ String.fromInt (index + 1) ]) ] itemTitle = Maybe.unwrap defaultItemTitle text mbItemTitle diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/VersionModal.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/VersionModal.elm index e36918ee4..5f9606fc6 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/VersionModal.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/VersionModal.elm @@ -11,13 +11,13 @@ module Wizard.Common.Components.Questionnaire.VersionModal exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html) import Maybe.Extra as Maybe import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.QuestionnaireVersion exposing (QuestionnaireVersion) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l) import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire.VersionForm as VersionForm exposing (VersionForm) @@ -25,11 +25,6 @@ import Wizard.Common.View.FormGroup as FormGroup import Wizard.Common.View.Modal as Modal -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.Questionnaire.VersionModal" - - -- MODEL @@ -158,24 +153,24 @@ view : AppState -> Model -> Html Msg view appState model = let form = - [ Html.map FormMsg <| FormGroup.input appState model.form "name" (l_ "form.name" appState) - , Html.map FormMsg <| FormGroup.textarea appState model.form "description" (l_ "form.description" appState) + [ Html.map FormMsg <| FormGroup.input appState model.form "name" (gettext "Name" appState.locale) + , Html.map FormMsg <| FormGroup.textarea appState model.form "description" (gettext "Description" appState.locale) ] modalTitle = case model.mbQuestionnaireVersion of Just _ -> - l_ "title.rename" appState + gettext "Rename version" appState.locale Nothing -> - l_ "title.new" appState + gettext "New version" appState.locale in Modal.confirm appState { modalTitle = modalTitle , modalContent = form , visible = Maybe.isJust model.mbEventUuid , actionResult = ActionResult.map (always "") model.versionResult - , actionName = l_ "action" appState + , actionName = gettext "Save" appState.locale , actionMsg = FormMsg Form.Submit , cancelMsg = Just Close , dangerous = False diff --git a/engine-wizard/elm/Wizard/Common/Components/QuestionnaireVersionTag.elm b/engine-wizard/elm/Wizard/Common/Components/QuestionnaireVersionTag.elm index 597c724db..89fe3f04f 100644 --- a/engine-wizard/elm/Wizard/Common/Components/QuestionnaireVersionTag.elm +++ b/engine-wizard/elm/Wizard/Common/Components/QuestionnaireVersionTag.elm @@ -3,18 +3,13 @@ module Wizard.Common.Components.QuestionnaireVersionTag exposing , version ) +import Gettext exposing (gettext) import Html exposing (Html, text) import Shared.Components.Badge as Badge import Shared.Data.QuestionnaireVersion exposing (QuestionnaireVersion) -import Shared.Locale exposing (lx) import Wizard.Common.AppState exposing (AppState) -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.QuestionnaireVersionTag" - - version : QuestionnaireVersion -> Html msg version qv = Badge.secondary [] [ text qv.name ] @@ -22,4 +17,4 @@ version qv = current : AppState -> Html msg current appState = - Badge.info [] [ lx_ "current" appState ] + Badge.info [] [ text (gettext "Current" appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Common/Components/SummaryReport.elm b/engine-wizard/elm/Wizard/Common/Components/SummaryReport.elm index ab3811dd3..342796498 100644 --- a/engine-wizard/elm/Wizard/Common/Components/SummaryReport.elm +++ b/engine-wizard/elm/Wizard/Common/Components/SummaryReport.elm @@ -11,6 +11,7 @@ module Wizard.Common.Components.SummaryReport exposing import ActionResult exposing (ActionResult(..)) import ChartJS +import Gettext exposing (gettext) import Html exposing (Html, a, div, h2, h3, h4, hr, table, tbody, td, text, th, thead, tr) import Html.Attributes exposing (class, colspan, id, style) import Html.Events exposing (onClick) @@ -24,25 +25,15 @@ import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Data.SummaryReport exposing (ChapterReport, IndicationReport(..), MetricReport, SummaryReport, TotalReport) import Shared.Data.SummaryReport.AnsweredIndicationData exposing (AnsweredIndicationData) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lf, lg, lgx, lx) import Shared.Markdown as Markdown import String exposing (fromFloat, fromInt) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Page as Page import Wizard.Ports as Ports -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Common.Components.SummaryReport" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.SummaryReport" - - -- Model @@ -87,7 +78,7 @@ update msg appState model = ) Err error -> - ( { model | summaryReport = ApiError.toActionResult appState (lg "apiError.questionnaires.summaryReport.fetchError" appState) error } + ( { model | summaryReport = ApiError.toActionResult appState (gettext "Unable to get the summary report." appState.locale) error } , Cmd.none ) @@ -110,7 +101,7 @@ viewContent : AppState -> Context -> SummaryReport -> Html Msg viewContent appState ctx summaryReport = let title = - [ h2 [] [ lgx "questionnaire.summaryReport" appState ] ] + [ h2 [] [ text (gettext "Summary Report" appState.locale) ] ] chartData = createTotalChartData metrics summaryReport.totalReport @@ -195,14 +186,14 @@ viewIndication : AppState -> IndicationReport -> Html msg viewIndication appState indicationReport = case indicationReport of AnsweredIndication data -> - viewAnsweredIndication appState (lf_ "answeredIndication.label") data + viewAnsweredIndication (String.format (gettext "Answered: %s/%s" appState.locale)) data PhasesAnsweredIndication data -> - viewAnsweredIndication appState (lf_ "phasesAnsweredIndication.label") data + viewAnsweredIndication (String.format (gettext "Answered (current phase): %s/%s" appState.locale)) data -viewAnsweredIndication : AppState -> (List String -> AppState -> String) -> AnsweredIndicationData -> Html msg -viewAnsweredIndication appState title data = +viewAnsweredIndication : (List String -> String) -> AnsweredIndicationData -> Html msg +viewAnsweredIndication title data = let progress = toFloat data.answeredQuestions / (toFloat <| data.answeredQuestions + data.unansweredQuestions) @@ -214,7 +205,7 @@ viewAnsweredIndication appState title data = fromInt <| data.answeredQuestions + data.unansweredQuestions in tr [ class "indication" ] - [ td [] [ text <| title [ answered, all ] appState ] + [ td [] [ text <| title [ answered, all ] ] , td [] [ viewProgressBar "bg-info" progress ] ] @@ -228,8 +219,8 @@ viewMetricsTable appState ctx metricReports = table [ class "table table-metrics-report" ] [ thead [] [ tr [] - [ th [] [ lgx "metric" appState ] - , th [ colspan 2 ] [ lgx "metric.measure" appState ] + [ th [] [ text (gettext "Metrics" appState.locale) ] + , th [ colspan 2 ] [ text (gettext "Measure" appState.locale) ] ] ] , tbody [] @@ -284,7 +275,7 @@ getTitleByUuid items uuid = viewMetricsDescriptions : AppState -> List Metric -> Html msg viewMetricsDescriptions appState metrics = div [] - (h3 [] [ lx_ "metricsDescriptions.metricsExplanation" appState ] + (h3 [] [ text (gettext "Metrics explanation" appState.locale) ] :: List.map viewMetricDescription metrics ) diff --git a/engine-wizard/elm/Wizard/Common/Components/TypeHintInput.elm b/engine-wizard/elm/Wizard/Common/Components/TypeHintInput.elm index efc6de35f..e7499660b 100644 --- a/engine-wizard/elm/Wizard/Common/Components/TypeHintInput.elm +++ b/engine-wizard/elm/Wizard/Common/Components/TypeHintInput.elm @@ -14,6 +14,7 @@ import ActionResult exposing (ActionResult(..)) import Browser.Dom as Dom import Browser.Events import Debounce exposing (Debounce) +import Gettext exposing (gettext) import Html exposing (Html, a, div, input, li, text, ul) import Html.Attributes exposing (class, classList, id, type_, value) import Html.Events exposing (onClick, onInput, onMouseDown, stopPropagationOn) @@ -23,17 +24,11 @@ import Shared.Data.Pagination exposing (Pagination) import Shared.Data.PaginationQueryString as PaginationQueryString exposing (PaginationQueryString) import Shared.Error.ApiError exposing (ApiError) import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (lgx, lx) import Shared.Utils exposing (dispatch) import Task import Wizard.Common.AppState exposing (AppState) -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Components.TypeHintInput" - - -- MODEL @@ -269,7 +264,7 @@ viewTypeHints appState cfg model = case Maybe.withDefault Unset model.typehints of Success hints -> if List.isEmpty hints.items then - div [ class "empty" ] [ lx_ "emptyResult" appState ] + div [ class "empty" ] [ text (gettext "No results matching your search were found." appState.locale) ] else ul [] (List.map (viewTypeHint cfg) hints.items) @@ -277,7 +272,7 @@ viewTypeHints appState cfg model = Loading -> div [ class "loading" ] [ faSet "_global.spinner" appState - , lgx "loading" appState + , text (gettext "Loading..." appState.locale) ] Error err -> diff --git a/engine-wizard/elm/Wizard/Common/Components/TypeHintInput/TypeHintItem.elm b/engine-wizard/elm/Wizard/Common/Components/TypeHintInput/TypeHintItem.elm index b56bc7a90..411e0fb66 100644 --- a/engine-wizard/elm/Wizard/Common/Components/TypeHintInput/TypeHintItem.elm +++ b/engine-wizard/elm/Wizard/Common/Components/TypeHintInput/TypeHintItem.elm @@ -6,6 +6,7 @@ module Wizard.Common.Components.TypeHintInput.TypeHintItem exposing , templateSuggestion ) +import Gettext exposing (gettext) import Html exposing (Html, div, strong, text) import Html.Attributes exposing (class) import Shared.Components.Badge as Badge @@ -14,7 +15,6 @@ import Shared.Data.TemplateSuggestion exposing (TemplateSuggestion) import Shared.Data.User as User import Shared.Data.UserSuggestion exposing (UserSuggestion) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (lg) import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -75,7 +75,7 @@ templateSuggestion appState template = let visibleName = if appState.config.template.recommendedTemplateId == Just template.id then - template.name ++ " (" ++ lg "questionnaire.template.recommended" appState ++ ")" + template.name ++ " (" ++ gettext "recommended" appState.locale ++ ")" else template.name diff --git a/engine-wizard/elm/Wizard/Common/Components/UsageTable.elm b/engine-wizard/elm/Wizard/Common/Components/UsageTable.elm index e21ee900b..5d95c9bdb 100644 --- a/engine-wizard/elm/Wizard/Common/Components/UsageTable.elm +++ b/engine-wizard/elm/Wizard/Common/Components/UsageTable.elm @@ -1,31 +1,26 @@ module Wizard.Common.Components.UsageTable exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, table, tbody, td, text, th, tr) import Html.Attributes exposing (class, style) import Shared.Common.ByteUnits as ByteUnits import Shared.Data.Usage exposing (Usage, UsageValue) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Components.UsageTable" - - view : AppState -> Usage -> Html msg view appState usage = table [ class "table table-usage table-hover" ] [ tbody [] - [ viewUsageRowSimple (l_ "metric.users" appState) usage.users - , viewUsageRowSimple (l_ "metric.activeUsers" appState) usage.activeUsers - , viewUsageRowSimple (l_ "metric.kmEditors" appState) usage.branches - , viewUsageRowSimple (l_ "metric.knowledgeModels" appState) usage.knowledgeModels - , viewUsageRowSimple (l_ "metric.templates" appState) usage.templates - , viewUsageRowSimple (l_ "metric.projects" appState) usage.questionnaires - , viewUsageRowSimple (l_ "metric.documents" appState) usage.documents - , viewUsageRowBytes (l_ "metric.storage" appState) usage.storage + [ viewUsageRowSimple (gettext "Users" appState.locale) usage.users + , viewUsageRowSimple (gettext "Active Users" appState.locale) usage.activeUsers + , viewUsageRowSimple (gettext "Knowledge Model Editors" appState.locale) usage.branches + , viewUsageRowSimple (gettext "Knowledge Models" appState.locale) usage.knowledgeModels + , viewUsageRowSimple (gettext "Document Templates" appState.locale) usage.templates + , viewUsageRowSimple (gettext "Projects" appState.locale) usage.questionnaires + , viewUsageRowSimple (gettext "Documents" appState.locale) usage.documents + , viewUsageRowBytes (gettext "Storage" appState.locale) usage.storage ] ] diff --git a/engine-wizard/elm/Wizard/Common/Flags.elm b/engine-wizard/elm/Wizard/Common/Flags.elm index dc802a97f..7175b7351 100644 --- a/engine-wizard/elm/Wizard/Common/Flags.elm +++ b/engine-wizard/elm/Wizard/Common/Flags.elm @@ -1,5 +1,6 @@ module Wizard.Common.Flags exposing (Flags, decoder, default) +import Gettext import Json.Decode as D exposing (Decoder) import Json.Decode.Pipeline as D import Shared.Auth.Session as Session exposing (Session) @@ -19,6 +20,7 @@ type alias Flags = , navigator : Navigator , gaEnabled : Bool , cookieConsent : Bool + , locale : Gettext.Locale , success : Bool } @@ -36,6 +38,7 @@ decoder = |> D.required "navigator" Navigator.decoder |> D.required "gaEnabled" D.bool |> D.required "cookieConsent" D.bool + |> D.optional "locale" Gettext.localeDecoder Gettext.defaultLocale |> D.hardcoded True @@ -52,4 +55,5 @@ default = , gaEnabled = False , cookieConsent = False , success = False + , locale = Gettext.defaultLocale } diff --git a/engine-wizard/elm/Wizard/Common/Menu/Update.elm b/engine-wizard/elm/Wizard/Common/Menu/Update.elm index 3ced96e8a..9bfe50073 100644 --- a/engine-wizard/elm/Wizard/Common/Menu/Update.elm +++ b/engine-wizard/elm/Wizard/Common/Menu/Update.elm @@ -3,9 +3,9 @@ module Wizard.Common.Menu.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Browser.Dom as Dom import Dict +import Gettext exposing (gettext) import Shared.Api.BuildInfo as BuildInfoApi import Shared.Error.ApiError as ApiError -import Shared.Locale exposing (l) import Task import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Menu.Models exposing (Model) @@ -13,11 +13,6 @@ import Wizard.Common.Menu.Msgs exposing (Msg(..)) import Wizard.Msgs -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Menu.Update" - - update : (Msg -> Wizard.Msgs.Msg) -> Msg -> AppState -> Model -> ( Model, Cmd Wizard.Msgs.Msg ) update wrapMsg msg appState model = case msg of @@ -41,7 +36,7 @@ update wrapMsg msg appState model = ( { model | apiBuildInfo = Success buildInfo }, Cmd.none ) Err error -> - ( { model | apiBuildInfo = ApiError.toActionResult appState (l_ "error.buildInfo" appState) error }, Cmd.none ) + ( { model | apiBuildInfo = ApiError.toActionResult appState (gettext "Unable to get the build info" appState.locale) error }, Cmd.none ) DevMenuDropdownMsg dropdownState -> ( { model | devMenuDropdownState = dropdownState }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Common/Menu/View.elm b/engine-wizard/elm/Wizard/Common/Menu/View.elm index e3097b2d7..09a228d61 100644 --- a/engine-wizard/elm/Wizard/Common/Menu/View.elm +++ b/engine-wizard/elm/Wizard/Common/Menu/View.elm @@ -2,6 +2,7 @@ module Wizard.Common.Menu.View exposing (view, viewAboutModal, viewReportIssueMo import ActionResult exposing (ActionResult(..)) import Dict +import Gettext exposing (gettext) import Html exposing (Html, a, code, div, em, img, li, p, span, table, tbody, td, text, th, thead, tr, ul) import Html.Attributes exposing (class, classList, colspan, href, id, src, style, target) import Html.Events exposing (onClick, onMouseEnter, onMouseLeave) @@ -12,7 +13,7 @@ import Shared.Data.BootstrapConfig.PrivacyAndSupportConfig as PrivacyAndSupportC import Shared.Data.BuildInfo as BuildInfo exposing (BuildInfo) import Shared.Data.User as User import Shared.Html exposing (emptyNode, fa, faSet, faSetFw) -import Shared.Locale exposing (l, lh, lx) +import String.Format as String import Wizard.Auth.Msgs import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Feature as Feature @@ -27,21 +28,6 @@ import Wizard.Msgs import Wizard.Routes as Routes exposing (Route) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.Menu.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Common.Menu.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.Menu.View" - - type MenuItem = MenuGroup MenuGroupData | MenuItem MenuItemData @@ -79,7 +65,7 @@ type alias GroupItemData = menuItems : AppState -> List MenuItem menuItems appState = [ MenuItem - { title = l_ "menu.apps" appState + { title = gettext "Apps" appState.locale , icon = faSetFw "menu.apps" appState , id = "apps" , route = Routes.appsIndex @@ -87,7 +73,7 @@ menuItems appState = , isVisible = Feature.apps } , MenuItem - { title = l_ "menu.users" appState + { title = gettext "Users" appState.locale , icon = faSetFw "menu.users" appState , id = "users" , route = Routes.usersIndex @@ -95,19 +81,19 @@ menuItems appState = , isVisible = Feature.usersView } , MenuGroup - { title = l_ "menu.knowledgeModels" appState + { title = gettext "Knowledge Models" appState.locale , icon = faSetFw "menu.knowledgeModels" appState , id = "knowledge-models" , route = Routes.knowledgeModelsIndex , isActive = Routes.isKnowledgeModelsSubroute , isVisible = Feature.knowledgeModelsImport , items = - [ { title = l_ "menu.knowledgeModels.list" appState + [ { title = gettext "List" appState.locale , id = "knowledge-models-list" , route = Routes.knowledgeModelsIndex , isActive = Routes.isKnowledgeModelsIndex } - , { title = l_ "menu.knowledgeModels.editors" appState + , { title = gettext "Editors" appState.locale , id = "knowledge-models-editors" , route = Routes.kmEditorIndex , isActive = Routes.isKmEditorIndex @@ -115,7 +101,7 @@ menuItems appState = ] } , MenuItem - { title = l_ "menu.projects" appState + { title = gettext "Projects" appState.locale , icon = faSetFw "menu.projects" appState , id = "projects" , route = Routes.projectsIndex appState @@ -123,19 +109,19 @@ menuItems appState = , isVisible = \a -> Feature.projectsView a && not (Feature.projectImporters a) } , MenuGroup - { title = l_ "menu.projects" appState + { title = gettext "Projects" appState.locale , icon = faSetFw "menu.projects" appState , id = "projects" , route = Routes.projectsIndex appState , isActive = Routes.isProjectSubroute , isVisible = \a -> Feature.projectsView a && Feature.projectImporters a , items = - [ { title = l_ "menu.projects.list" appState + [ { title = gettext "List" appState.locale , id = "projects-list" , route = Routes.projectsIndex appState , isActive = Routes.isProjectsIndex } - , { title = l_ "menu.projects.importers" appState + , { title = gettext "Importers" appState.locale , id = "projects-importers" , route = Routes.projectImportersIndex , isActive = Routes.isProjectImportersIndex @@ -143,19 +129,19 @@ menuItems appState = ] } , MenuGroup - { title = l_ "menu.documents" appState + { title = gettext "Documents" appState.locale , icon = faSetFw "menu.documents" appState , id = "documents" , route = Routes.documentsIndex , isActive = Routes.isDocumentsSubroute , isVisible = Feature.documentsView , items = - [ { title = l_ "menu.documents.list" appState + [ { title = gettext "List" appState.locale , id = "documents-list" , route = Routes.documentsIndex , isActive = Routes.isDocumentsIndex } - , { title = l_ "menu.documents.templates" appState + , { title = gettext "Templates" appState.locale , id = "document-templates" , route = Routes.templatesIndex , isActive = Routes.isTemplateIndex @@ -163,7 +149,7 @@ menuItems appState = ] } , MenuItem - { title = l_ "menu.documentTemplates" appState + { title = gettext "Document Templates" appState.locale , icon = faSetFw "menu.templates" appState , id = "document-templates" , route = Routes.templatesIndex @@ -171,19 +157,19 @@ menuItems appState = , isVisible = \a -> Feature.templatesView a && not (Feature.documentsView a) } , MenuGroup - { title = l_ "menu.dev" appState + { title = gettext "Dev" appState.locale , icon = faSetFw "menu.dev" appState , id = "dev" , route = Routes.devOperations , isActive = Routes.isDevSubroute , isVisible = Feature.dev , items = - [ { title = l_ "menu.dev.operations" appState + [ { title = gettext "Operations" appState.locale , id = "dev-operations" , route = Routes.devOperations , isActive = Routes.isDevOperations } - , { title = l_ "menu.dev.persistentCommands" appState + , { title = gettext "Persistent Commands" appState.locale , id = "dev-persistent-commands" , route = Routes.persistentCommandsIndex , isActive = Routes.isPersistentCommandsIndex @@ -191,7 +177,7 @@ menuItems appState = ] } , MenuItem - { title = l_ "menu.settings" appState + { title = gettext "Settings" appState.locale , icon = faSetFw "menu.settings" appState , id = "settings" , route = Routes.settingsDefault @@ -436,7 +422,7 @@ viewProfileMenu model = Routes.usersEditCurrent [ dataCy "menu_profile" ] [ faSetFw "menu.profile" model.appState - , lx_ "profileMenu.edit" model.appState + , text (gettext "Edit profile" model.appState.locale) ] ] , li [] @@ -445,7 +431,7 @@ viewProfileMenu model = , dataCy "menu_logout" ] [ faSetFw "menu.logout" model.appState - , lx_ "profileMenu.logout" model.appState + , text (gettext "Log out" model.appState.locale) ] ] , li [ class "dark dark-border" ] @@ -454,7 +440,7 @@ viewProfileMenu model = , dataCy "menu_about" ] [ faSetFw "menu.about" model.appState - , lx_ "profileMenu.about" model.appState + , text (gettext "About" model.appState.locale) ] ] , li [ class "dark dark-last" ] @@ -463,7 +449,7 @@ viewProfileMenu model = , dataCy "menu_report-issue" ] [ faSetFw "menu.reportIssue" model.appState - , lx_ "profileMenu.reportIssue" model.appState + , text (gettext "Report issue" model.appState.locale) ] ] ] @@ -480,7 +466,7 @@ viewCollapseLink model = else a [ onLinkClick (Wizard.Msgs.SetSidebarCollapsed True), class "collapse-link" ] [ faSet "menu.collapse" model.appState - , lx_ "sidebar.collapse" model.appState + , text (gettext "Collapse sidebar" model.appState.locale) ] @@ -495,7 +481,7 @@ viewReportIssueModal appState isOpen = [ text <| PrivacyAndSupportConfig.getSupportEmail appState.config.privacyAndSupport ] modalContent = - [ p [] [ lx_ "reportModal.info" appState ] + [ p [] [ text (gettext "If you find any problem, the best way to report it is to open an issue in our GitHub repository." appState.locale) ] , p [] [ a [ dataCy "report-modal_link_repository" @@ -507,15 +493,15 @@ viewReportIssueModal appState isOpen = , text <| PrivacyAndSupportConfig.getSupportRepositoryName appState.config.privacyAndSupport ] ] - , p [] (lh_ "reportModal.writeUs" [ supportMailLink ] appState) + , p [] (String.formatHtml (gettext "You can also write us an email to %s." appState.locale) [ supportMailLink ]) ] modalConfig = - { modalTitle = l_ "reportModal.title" appState + { modalTitle = gettext "Report issue" appState.locale , modalContent = modalContent , visible = isOpen , actionResult = Unset - , actionName = l_ "reportModal.action" appState + , actionName = gettext "OK" appState.locale , actionMsg = Wizard.Msgs.MenuMsg <| SetReportIssueOpen False , cancelMsg = Nothing , dangerous = False @@ -532,11 +518,11 @@ viewAboutModal appState isOpen serverBuildInfoActionResult = Page.actionResultView appState (viewAboutModalContent appState) serverBuildInfoActionResult modalConfig = - { modalTitle = l_ "about.title" appState + { modalTitle = gettext "About" appState.locale , modalContent = [ modalContent ] , visible = isOpen , actionResult = Unset - , actionName = l_ "about.action" appState + , actionName = gettext "OK" appState.locale , actionMsg = Wizard.Msgs.MenuMsg <| SetAboutOpen False , cancelMsg = Nothing , dangerous = False @@ -553,17 +539,17 @@ viewAboutModalContent appState serverBuildInfo = appState.apiUrl ++ "/swagger-ui/" extraClientInfo = - [ ( l_ "about.styleVersion" appState, code [ id "client-style-version" ] [] ) + [ ( gettext "Style Version" appState.locale, code [ id "client-style-version" ] [] ) ] extraServerInfo = - [ ( l_ "about.apiUrl" appState, a [ href appState.apiUrl, target "_blank" ] [ text appState.apiUrl ] ) - , ( l_ "about.apiDocs" appState, a [ href swaggerUrl, target "_blank" ] [ text swaggerUrl ] ) + [ ( gettext "API URL" appState.locale, a [ href appState.apiUrl, target "_blank" ] [ text appState.apiUrl ] ) + , ( gettext "API Docs" appState.locale, a [ href swaggerUrl, target "_blank" ] [ text swaggerUrl ] ) ] in div [] - [ viewBuildInfo appState (l_ "about.client" appState) BuildInfo.client extraClientInfo - , viewBuildInfo appState (l_ "about.server" appState) serverBuildInfo extraServerInfo + [ viewBuildInfo appState (gettext "Client" appState.locale) BuildInfo.client extraClientInfo + , viewBuildInfo appState (gettext "Server" appState.locale) serverBuildInfo extraServerInfo ] @@ -583,11 +569,11 @@ viewBuildInfo appState name buildInfo extra = ] , tbody [] ([ tr [] - [ td [] [ lx_ "about.version" appState ] + [ td [] [ text (gettext "Version" appState.locale) ] , td [] [ code [] [ text buildInfo.version ] ] ] , tr [] - [ td [] [ lx_ "about.builtAt" appState ] + [ td [] [ text (gettext "Built at" appState.locale) ] , td [] [ em [] [ text buildInfo.builtAt ] ] ] ] diff --git a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultIconSet.elm b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultIconSet.elm index 9e4676a76..d59c0ed66 100644 --- a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultIconSet.elm +++ b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultIconSet.elm @@ -1,145 +1,142 @@ module Wizard.Common.Provisioning.DefaultIconSet exposing (iconSet) import Dict exposing (Dict) -import Shared.Common.Provisioning.DefaultIconSet as SharedIconSet iconSet : Dict String String iconSet = Dict.fromList - (SharedIconSet.iconSet - ++ [ ( "_global.add", "fas fa-plus" ) - , ( "_global.arrowRight", "fas fa-long-arrow-alt-right" ) - , ( "_global.cancel", "fas fa-ban" ) - , ( "_global.chevronLeft", "fas fa-chevron-left" ) - , ( "_global.chevronRight", "fas fa-chevron-right" ) - , ( "_global.close", "fas fa-times" ) - , ( "_global.delete", "fas fa-trash" ) - , ( "_global.download", "fas fa-download" ) - , ( "_global.edit", "fas fa-edit" ) - , ( "_global.error", "fas fa-exclamation-circle" ) - , ( "_global.export", "fas fa-download" ) - , ( "_global.externalLink", "fas fa-external-link-alt" ) - , ( "_global.info", "fas fa-info-circle" ) - , ( "_global.questionnaire", "far fa-list-alt" ) - , ( "_global.remove", "fas fa-times" ) - , ( "_global.sortAsc", "fas fa-long-arrow-alt-down" ) - , ( "_global.sortDesc", "fas fa-long-arrow-alt-up" ) - , ( "_global.spinner", "fas fa-spinner fa-spin" ) - , ( "_global.success", "fas fa-check" ) - , ( "_global.view", "far fa-eye" ) - , ( "_global.warning", "fas fa-exclamation-triangle" ) - , ( "avatar.0", "fas fa-cat" ) - , ( "avatar.1", "fas fa-crow" ) - , ( "avatar.2", "fas fa-dog" ) - , ( "avatar.3", "fas fa-dove" ) - , ( "avatar.4", "fas fa-dragon" ) - , ( "avatar.5", "fas fa-fish" ) - , ( "avatar.6", "fas fa-frog" ) - , ( "avatar.7", "fas fa-hippo" ) - , ( "avatar.8", "fas fa-horse" ) - , ( "avatar.9", "fas fa-kiwi-bird" ) - , ( "avatar.10", "fas fa-otter" ) - , ( "avatar.11", "fas fa-spider" ) - , ( "avatar.12", "fas fa-piggy-bank" ) - , ( "avatar.13", "fas fa-bug" ) - , ( "avatar.14", "fas fa-hat-wizard" ) - , ( "avatar.15", "fas fa-ghost" ) - , ( "avatar.16", "fas fa-robot" ) - , ( "avatar.17", "fas fa-snowman" ) - , ( "avatar.18", "fas fa-tree" ) - , ( "avatar.19", "fas fa-hat-cowboy" ) - , ( "documents.download", "fas fa-download" ) - , ( "documents.viewError", "fas fa-exclamation-circle" ) - , ( "documents.submit", "fas fa-paper-plane" ) - , ( "km.answer", "far fa-dot-circle" ) - , ( "km.choice", "far fa-check-square" ) - , ( "km.chapter", "far fa-file" ) - , ( "km.expert", "far fa-user" ) - , ( "km.fork", "fas fa-code-branch" ) - , ( "km.integration", "fas fa-exchange-alt" ) - , ( "km.itemTemplate", "far fa-file-alt" ) - , ( "km.knowledgeModel", "fas fa-database" ) - , ( "km.metric", "fas fa-chart-bar" ) - , ( "km.phase", "far fa-clock" ) - , ( "km.question", "far fa-comment" ) - , ( "km.reference", "far fa-bookmark" ) - , ( "km.tag", "fas fa-tag" ) - , ( "kmEditor.collapseAll", "fas fa-angle-double-up" ) - , ( "kmEditor.copyUuid", "fas fa-paste" ) - , ( "kmEditor.expandAll", "fas fa-angle-double-down" ) - , ( "kmEditor.knowledgeModel", "fas fa-sitemap" ) - , ( "kmEditor.move", "fas fa-reply" ) - , ( "kmEditor.preview", "fas fa-eye" ) - , ( "kmEditor.settings", "fas fa-cogs" ) - , ( "kmEditor.tags", "fas fa-tags" ) - , ( "kmEditor.treeOpened", "fas fa-caret-down" ) - , ( "kmEditor.treeClosed", "fas fa-caret-right" ) - , ( "kmEditorList.continueMigration", "fas fa-long-arrow-alt-right" ) - , ( "kmEditorList.edit", "fas fa-pen" ) - , ( "kmEditorList.edited", "fas fa-pen" ) - , ( "kmEditorList.publish", "fas fa-cloud-upload-alt" ) - , ( "kmEditorList.upgrade", "fas fa-sort-amount-up" ) - , ( "kmDetail.createKMEditor", "fas fa-edit" ) - , ( "kmDetail.createQuestionnaire", "far fa-list-alt" ) - , ( "kmDetail.fork", "fas fa-code-branch" ) - , ( "kmDetail.preview", "fas fa-eye" ) - , ( "kmDetail.registryLink", "fas fa-external-link-alt" ) - , ( "kmImport.file", "fas fa-file" ) - , ( "kmImport.fromFile", "fas fa-upload" ) - , ( "kmImport.fromOwl", "fas fa-project-diagram" ) - , ( "kmImport.fromRegistry", "fas fa-cloud-download-alt" ) - , ( "kms.upload", "fas fa-upload" ) - , ( "listing.actions", "fas fa-ellipsis-v" ) - , ( "listing.filter.multi.selected", "fas fa-check-square" ) - , ( "listing.filter.multi.notSelected", "far fa-square" ) - , ( "listing.filter.single.selected", "fas fa-check-circle" ) - , ( "listing.filter.single.notSelected", "far fa-circle" ) - , ( "login.externalService", "fab fa-openid" ) - , ( "menu.apps", "fas fa-th" ) - , ( "menu.about", "fas fa-info" ) - , ( "menu.collapse", "fas fa-angle-double-left" ) - , ( "menu.dev", "fas fa-laptop-code" ) - , ( "menu.documents", "fas fa-layer-group" ) - , ( "menu.knowledgeModels", "fas fa-sitemap" ) - , ( "menu.logout", "fas fa-sign-out-alt" ) - , ( "menu.open", "fas fa-angle-double-right" ) - , ( "menu.profile", "fas fa-user-edit" ) - , ( "menu.projects", "fas fa-folder" ) - , ( "menu.reportIssue", "fas fa-exclamation-triangle" ) - , ( "menu.settings", "fas fa-cog" ) - , ( "menu.templates", "far fa-file-code" ) - , ( "menu.users", "fas fa-users" ) - , ( "persistentCommand.retry", "fas fa-sync-alt" ) - , ( "project.open", "far fa-folder-open" ) - , ( "questionnaire.answeredIndication", "fas fa-check" ) - , ( "questionnaire.clearAnswer", "fas fa-undo-alt" ) - , ( "questionnaire.comments", "fas fa-comments" ) - , ( "questionnaire.commentsResolve", "fas fa-check" ) - , ( "questionnaire.desirable", "far fa-check-square" ) - , ( "questionnaire.expand", "fas fa-expand" ) - , ( "questionnaire.expand", "fas fa-expand" ) - , ( "questionnaire.experts", "far fa-address-book" ) - , ( "questionnaire.feedback", "fas fa-exclamation" ) - , ( "questionnaire.followUpsIndication", "fas fa-list-ul" ) - , ( "questionnaire.history.createDocument", "far fa-file" ) - , ( "questionnaire.history.revert", "fas fa-history" ) - , ( "questionnaire.item.collapse", "fa-fw fas fa-chevron-down" ) - , ( "questionnaire.item.expand", "fa-fw fas fa-chevron-right" ) - , ( "questionnaire.item.moveUp", "fa-fw fas fa-arrow-up" ) - , ( "questionnaire.item.moveDown", "fa-fw fas fa-arrow-down" ) - , ( "questionnaire.resourcePageReferences", "fas fa-book" ) - , ( "questionnaire.saving.saving", "fas fa-sync-alt fa-spin" ) - , ( "questionnaire.saving.saved", "far fa-check-circle" ) - , ( "questionnaire.shrink", "fas fa-compress" ) - , ( "questionnaire.urlReferences", "fas fa-external-link-alt" ) - , ( "questionnaireImporter.disable", "fas fa-toggle-off" ) - , ( "questionnaireImporter.enable", "fas fa-toggle-on" ) - , ( "questionnaireList.clone", "far fa-copy" ) - , ( "questionnaireList.createMigration", "fas fa-random" ) - , ( "questionnaireMigration.resolve", "fas fa-check" ) - , ( "questionnaireMigration.resolveAll", "fas fa-check-double" ) - , ( "questionnaireMigration.undo", "fas fa-undo-alt" ) - , ( "report.repository", "fab fa-github" ) - ] - ) + [ ( "_global.add", "fas fa-plus" ) + , ( "_global.arrowRight", "fas fa-long-arrow-alt-right" ) + , ( "_global.cancel", "fas fa-ban" ) + , ( "_global.chevronLeft", "fas fa-chevron-left" ) + , ( "_global.chevronRight", "fas fa-chevron-right" ) + , ( "_global.close", "fas fa-times" ) + , ( "_global.delete", "fas fa-trash" ) + , ( "_global.download", "fas fa-download" ) + , ( "_global.edit", "fas fa-edit" ) + , ( "_global.error", "fas fa-exclamation-circle" ) + , ( "_global.export", "fas fa-download" ) + , ( "_global.externalLink", "fas fa-external-link-alt" ) + , ( "_global.info", "fas fa-info-circle" ) + , ( "_global.questionnaire", "far fa-list-alt" ) + , ( "_global.remove", "fas fa-times" ) + , ( "_global.sortAsc", "fas fa-long-arrow-alt-down" ) + , ( "_global.sortDesc", "fas fa-long-arrow-alt-up" ) + , ( "_global.spinner", "fas fa-spinner fa-spin" ) + , ( "_global.success", "fas fa-check" ) + , ( "_global.view", "far fa-eye" ) + , ( "_global.warning", "fas fa-exclamation-triangle" ) + , ( "avatar.0", "fas fa-cat" ) + , ( "avatar.1", "fas fa-crow" ) + , ( "avatar.2", "fas fa-dog" ) + , ( "avatar.3", "fas fa-dove" ) + , ( "avatar.4", "fas fa-dragon" ) + , ( "avatar.5", "fas fa-fish" ) + , ( "avatar.6", "fas fa-frog" ) + , ( "avatar.7", "fas fa-hippo" ) + , ( "avatar.8", "fas fa-horse" ) + , ( "avatar.9", "fas fa-kiwi-bird" ) + , ( "avatar.10", "fas fa-otter" ) + , ( "avatar.11", "fas fa-spider" ) + , ( "avatar.12", "fas fa-piggy-bank" ) + , ( "avatar.13", "fas fa-bug" ) + , ( "avatar.14", "fas fa-hat-wizard" ) + , ( "avatar.15", "fas fa-ghost" ) + , ( "avatar.16", "fas fa-robot" ) + , ( "avatar.17", "fas fa-snowman" ) + , ( "avatar.18", "fas fa-tree" ) + , ( "avatar.19", "fas fa-hat-cowboy" ) + , ( "documents.download", "fas fa-download" ) + , ( "documents.viewError", "fas fa-exclamation-circle" ) + , ( "documents.submit", "fas fa-paper-plane" ) + , ( "km.answer", "far fa-dot-circle" ) + , ( "km.choice", "far fa-check-square" ) + , ( "km.chapter", "far fa-file" ) + , ( "km.expert", "far fa-user" ) + , ( "km.fork", "fas fa-code-branch" ) + , ( "km.integration", "fas fa-exchange-alt" ) + , ( "km.itemTemplate", "far fa-file-alt" ) + , ( "km.knowledgeModel", "fas fa-database" ) + , ( "km.metric", "fas fa-chart-bar" ) + , ( "km.phase", "far fa-clock" ) + , ( "km.question", "far fa-comment" ) + , ( "km.reference", "far fa-bookmark" ) + , ( "km.tag", "fas fa-tag" ) + , ( "kmEditor.collapseAll", "fas fa-angle-double-up" ) + , ( "kmEditor.copyUuid", "fas fa-paste" ) + , ( "kmEditor.expandAll", "fas fa-angle-double-down" ) + , ( "kmEditor.knowledgeModel", "fas fa-sitemap" ) + , ( "kmEditor.move", "fas fa-reply" ) + , ( "kmEditor.preview", "fas fa-eye" ) + , ( "kmEditor.settings", "fas fa-cogs" ) + , ( "kmEditor.tags", "fas fa-tags" ) + , ( "kmEditor.treeOpened", "fas fa-caret-down" ) + , ( "kmEditor.treeClosed", "fas fa-caret-right" ) + , ( "kmEditorList.continueMigration", "fas fa-long-arrow-alt-right" ) + , ( "kmEditorList.edit", "fas fa-pen" ) + , ( "kmEditorList.edited", "fas fa-pen" ) + , ( "kmEditorList.publish", "fas fa-cloud-upload-alt" ) + , ( "kmEditorList.upgrade", "fas fa-sort-amount-up" ) + , ( "kmDetail.createKMEditor", "fas fa-edit" ) + , ( "kmDetail.createQuestionnaire", "far fa-list-alt" ) + , ( "kmDetail.fork", "fas fa-code-branch" ) + , ( "kmDetail.preview", "fas fa-eye" ) + , ( "kmDetail.registryLink", "fas fa-external-link-alt" ) + , ( "kmImport.file", "fas fa-file" ) + , ( "kmImport.fromFile", "fas fa-upload" ) + , ( "kmImport.fromOwl", "fas fa-project-diagram" ) + , ( "kmImport.fromRegistry", "fas fa-cloud-download-alt" ) + , ( "kms.upload", "fas fa-upload" ) + , ( "listing.actions", "fas fa-ellipsis-v" ) + , ( "listing.filter.multi.selected", "fas fa-check-square" ) + , ( "listing.filter.multi.notSelected", "far fa-square" ) + , ( "listing.filter.single.selected", "fas fa-check-circle" ) + , ( "listing.filter.single.notSelected", "far fa-circle" ) + , ( "login.externalService", "fab fa-openid" ) + , ( "menu.apps", "fas fa-th" ) + , ( "menu.about", "fas fa-info" ) + , ( "menu.collapse", "fas fa-angle-double-left" ) + , ( "menu.dev", "fas fa-laptop-code" ) + , ( "menu.documents", "fas fa-layer-group" ) + , ( "menu.knowledgeModels", "fas fa-sitemap" ) + , ( "menu.logout", "fas fa-sign-out-alt" ) + , ( "menu.open", "fas fa-angle-double-right" ) + , ( "menu.profile", "fas fa-user-edit" ) + , ( "menu.projects", "fas fa-folder" ) + , ( "menu.reportIssue", "fas fa-exclamation-triangle" ) + , ( "menu.settings", "fas fa-cog" ) + , ( "menu.templates", "far fa-file-code" ) + , ( "menu.users", "fas fa-users" ) + , ( "persistentCommand.retry", "fas fa-sync-alt" ) + , ( "project.open", "far fa-folder-open" ) + , ( "questionnaire.answeredIndication", "fas fa-check" ) + , ( "questionnaire.clearAnswer", "fas fa-undo-alt" ) + , ( "questionnaire.comments", "fas fa-comments" ) + , ( "questionnaire.commentsResolve", "fas fa-check" ) + , ( "questionnaire.desirable", "far fa-check-square" ) + , ( "questionnaire.expand", "fas fa-expand" ) + , ( "questionnaire.expand", "fas fa-expand" ) + , ( "questionnaire.experts", "far fa-address-book" ) + , ( "questionnaire.feedback", "fas fa-exclamation" ) + , ( "questionnaire.followUpsIndication", "fas fa-list-ul" ) + , ( "questionnaire.history.createDocument", "far fa-file" ) + , ( "questionnaire.history.revert", "fas fa-history" ) + , ( "questionnaire.item.collapse", "fa-fw fas fa-chevron-down" ) + , ( "questionnaire.item.expand", "fa-fw fas fa-chevron-right" ) + , ( "questionnaire.item.moveUp", "fa-fw fas fa-arrow-up" ) + , ( "questionnaire.item.moveDown", "fa-fw fas fa-arrow-down" ) + , ( "questionnaire.resourcePageReferences", "fas fa-book" ) + , ( "questionnaire.saving.saving", "fas fa-sync-alt fa-spin" ) + , ( "questionnaire.saving.saved", "far fa-check-circle" ) + , ( "questionnaire.shrink", "fas fa-compress" ) + , ( "questionnaire.urlReferences", "fas fa-external-link-alt" ) + , ( "questionnaireImporter.disable", "fas fa-toggle-off" ) + , ( "questionnaireImporter.enable", "fas fa-toggle-on" ) + , ( "questionnaireList.clone", "far fa-copy" ) + , ( "questionnaireList.createMigration", "fas fa-random" ) + , ( "questionnaireMigration.resolve", "fas fa-check" ) + , ( "questionnaireMigration.resolveAll", "fas fa-check-double" ) + , ( "questionnaireMigration.undo", "fas fa-undo-alt" ) + , ( "report.repository", "fab fa-github" ) + ] diff --git a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm index 46f96f0be..faa32f1ed 100644 --- a/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm +++ b/engine-wizard/elm/Wizard/Common/Provisioning/DefaultLocale.elm @@ -1,1335 +1,56 @@ module Wizard.Common.Provisioning.DefaultLocale exposing (locale) import Dict exposing (Dict) -import Shared.Common.Provisioning.DefaultLocale as SharedLocale locale : Dict String String locale = Dict.fromList - (SharedLocale.locale - ++ [ -- Routing - ( "__routing.dashboard", "dashboard" ) - , ( "__routing.documents", "documents" ) - , ( "__routing.documents.index.questionnaireUuid", "questionnaireUuid" ) - , ( "__routing.kmEditor", "km-editor" ) - , ( "__routing.kmEditor.create", "create" ) - , ( "__routing.kmEditor.create.selected", "selected" ) - , ( "__routing.kmEditor.create.edit", "edit" ) - , ( "__routing.kmEditor.editor", "editor" ) - , ( "__routing.kmEditor.migration", "migration" ) - , ( "__routing.kmEditor.publish", "publish" ) - , ( "__routing.knowledgeModels", "knowledge-models" ) - , ( "__routing.knowledgeModels.import", "import" ) - , ( "__routing.knowledgeModels.import.packageId", "packageId" ) - , ( "__routing.knowledgeModels.preview", "preview" ) - , ( "__routing.knowledgeModels.preview.questionUuid", "questionUuid" ) - , ( "__routing.login.originalUrl", "originalUrl" ) - , ( "__routing.projectImporters", "project-importers" ) - , ( "__routing.projects", "projects" ) - , ( "__routing.projects.create", "create" ) - , ( "__routing.projects.create.custom", "custom" ) - , ( "__routing.projects.create.selected", "selected" ) - , ( "__routing.projects.create.template", "from-template" ) - , ( "__routing.projects.createMigration", "create-migration" ) - , ( "__routing.projects.migration", "migration" ) - , ( "__routing.projects.migration", "migration" ) - , ( "__routing.public.bookReferences", "book-references" ) - , ( "__routing.public.forgottenPassword", "forgotten-password" ) - , ( "__routing.public.signup", "signup" ) - , ( "__routing.registry", "registry" ) - , ( "__routing.registry.signupConfirmation", "signup" ) - , ( "__routing.settings", "settings" ) - , ( "__routing.settings.authentication", "authentication" ) - , ( "__routing.settings.dashboard", "dashboard" ) - , ( "__routing.settings.registry", "registry" ) - , ( "__routing.settings.knowledgeModel", "knowledge-models" ) - , ( "__routing.settings.lookAndFeel", "look-and-feel" ) - , ( "__routing.settings.organization", "organization" ) - , ( "__routing.settings.plans", "plans" ) - , ( "__routing.settings.privacyAndSupport", "privacy-and-support" ) - , ( "__routing.settings.projects", "projects" ) - , ( "__routing.settings.submission", "submission" ) - , ( "__routing.settings.template", "template" ) - , ( "__routing.settings.usage", "usage" ) - , ( "__routing.templates", "document-templates" ) - , ( "__routing.templates.import", "import" ) - , ( "__routing.templates.import.templateId", "templateId" ) - - -- API messages - , ( "_global.apiError.actionKey.passwordRecoveryError", "Forgotten password recovery failed." ) - , ( "_global.apiError.apps.deletePlanError", "Plan could not be deleted." ) - , ( "_global.apiError.apps.getError", "Unable to get app." ) - , ( "_global.apiError.apps.getListError", "Unable to get apps." ) - , ( "_global.apiError.apps.getPlansError", "Unable to get plans." ) - , ( "_global.apiError.apps.postError", "App could not be created." ) - , ( "_global.apiError.apps.postPlanError", "Plan could not be created." ) - , ( "_global.apiError.apps.putError", "App could not be saved." ) - , ( "_global.apiError.apps.putPlanError", "Plan could not be saved." ) - , ( "_global.apiError.bookReferences.getError", "Unable to get a book reference." ) - , ( "_global.apiError.branches.deleteError", "Knowledge model could not be deleted." ) - , ( "_global.apiError.branches.getError", "Unable to get the knowledge model editor." ) - , ( "_global.apiError.branches.getListError", "Unable to get knowledge model editors." ) - , ( "_global.apiError.branches.migrations.conflict.postError", "Unable to resolve conflict." ) - , ( "_global.apiError.branches.migrations.deleteError", "Migration could not be deleted." ) - , ( "_global.apiError.branches.migrations.getError", "Unable to get migration." ) - , ( "_global.apiError.branches.migrations.postError", "Migration could not be created." ) - , ( "_global.apiError.branches.postError", "Knowledge Model could not be created." ) - , ( "_global.apiError.branches.putError", "Knowledge Model could not be saved." ) - , ( "_global.apiError.config.app.getError", "Unable to load settings." ) - , ( "_global.apiError.config.app.putError", "Settings could not be saved." ) - , ( "_global.apiError.config.app.uploadLogoError", "Unable to upload logo." ) - , ( "_global.apiError.documents.deleteError", "Document could not be deleted." ) - , ( "_global.apiError.documents.getListError", "Unable to get documents." ) - , ( "_global.apiError.documents.getSubmissionServicesError", "Unable to get submission services for the document." ) - , ( "_global.apiError.documents.postError", "Document could not be created." ) - , ( "_global.apiError.feedbacks.getError", "Unable to get feedback." ) - , ( "_global.apiError.feedbacks.postError", "Feedback could not be sent." ) - , ( "_global.apiError.knowledgeModels.preview.fetchError", "Unable to get the Knowledge Model." ) - , ( "_global.apiError.knowledgeModels.tags.getError", "Unable to get question tags for the Knowledge Model." ) - , ( "_global.apiError.packages.deleteError", "Knowledge Model could not be deleted." ) - , ( "_global.apiError.packages.getError", "Unable to get the Knowledge Model." ) - , ( "_global.apiError.packages.getListError", "Unable to get Knowledge Models." ) - , ( "_global.apiError.packages.importError", "Importing the package failed." ) - , ( "_global.apiError.packages.pullError", "Unable to import the package." ) - , ( "_global.apiError.packages.version.postError", "Publishing the new version failed." ) - , ( "_global.apiError.questionnaireImporters.getError", "Unable to get importer." ) - , ( "_global.apiError.questionnaireImporters.getListError", "Unable to get project importers." ) - , ( "_global.apiError.questionnaireImporters.putError", "Unable to change project importer." ) - , ( "_global.apiError.questionnaires.cloneError", "Unable to clone Questionnaire." ) - , ( "_global.apiError.questionnaires.deleteError", "Questionnaire could not be deleted." ) - , ( "_global.apiError.questionnaires.events.getError", "Unable to get questionnaire event." ) - , ( "_global.apiError.questionnaires.events.getListError", "Unable to get version history." ) - , ( "_global.apiError.questionnaires.getError", "Unable to get the project." ) - , ( "_global.apiError.questionnaires.getListError", "Unable to get projects." ) - , ( "_global.apiError.questionnaires.getProjectTagsSuggestionsError", "Unable to get project tags." ) - , ( "_global.apiError.questionnaires.headDocumentPreview", "Unable to get the document preview." ) - , ( "_global.apiError.questionnaires.migrations.deleteError", "Questionnaire migration could not be deleted." ) - , ( "_global.apiError.questionnaires.migrations.getError", "Unable to get the Questionnaire migration." ) - , ( "_global.apiError.questionnaires.migrations.postError", "Questionnaire migration could not be created." ) - , ( "_global.apiError.questionnaires.migrations.putError", "Unable to save migration." ) - , ( "_global.apiError.questionnaires.postError", "Questionnaire could not be created." ) - , ( "_global.apiError.questionnaires.putContentError", "Questionnaire changes could not be saved." ) - , ( "_global.apiError.questionnaires.putError", "Questionnaire could not be saved." ) - , ( "_global.apiError.questionnaires.summaryReport.fetchError", "Unable to get the summary report." ) - , ( "_global.apiError.registry.confirmation", "Unable to confirm the registry account." ) - , ( "_global.apiError.registry.signup.postError", "Sign up request failed." ) - , ( "_global.apiError.submissions.postError", "Unable to submit the document." ) - , ( "_global.apiError.templates.deleteError", "Document template could not be deleted." ) - , ( "_global.apiError.templates.getError", "Unable to get the document template." ) - , ( "_global.apiError.templates.getListError", "Unable to get document templates." ) - , ( "_global.apiError.templates.importError", "Importing the document template failed." ) - , ( "_global.apiError.templates.pullError", "Unable to import the document template." ) - , ( "_global.apiError.tokens.fetchTokenError", "Login failed." ) - , ( "_global.apiError.typeHints.getListError", "Unable to get type hints." ) - , ( "_global.apiError.usage.getError", "Unable to get usage." ) - , ( "_global.apiError.users.activation.putError", "Sign up process failed." ) - , ( "_global.apiError.users.current.getError", "Loading the profile info failed." ) - , ( "_global.apiError.users.deleteError", "User could not be deleted." ) - , ( "_global.apiError.users.getError", "Unable to get the user." ) - , ( "_global.apiError.users.getListError", "Unable to get users." ) - , ( "_global.apiError.users.password.putError", "Password could not be changed." ) - , ( "_global.apiError.users.postError", "User could not be created." ) - , ( "_global.apiError.users.public.postError", "Sign up process failed." ) - , ( "_global.apiError.users.putError", "Profile could not be saved." ) - , ( "_global.apiSuccess.documents.delete", "Document was successfully deleted." ) - , ( "_global.apiSuccess.feedbacks.post", "Your feedback has been sent." ) - , ( "_global.apiSuccess.migration.delete", "Migration was successfully canceled." ) - , ( "_global.apiSuccess.questionnaireImporters.put", "Project importer was changed successfully." ) - , ( "_global.apiSuccess.questionnaires.clone", "%s has been created." ) - , ( "_global.apiSuccess.questionnaires.delete", "Questionnaire was successfully deleted." ) - , ( "_global.apiSuccess.questionnaires.migration.delete", "Questionnaire migration was successfully canceled." ) - , ( "_global.apiSuccess.registry.signup", "You have signed up for the Registry, you should receive a confirmation email soon." ) - , ( "_global.apiSuccess.users.put", "Profile was successfully updated." ) - , ( "_global.apiSuccess.users.password.put", "Password was successfully changed." ) - - -- KM Entities - , ( "_global.annotations", "Annotations" ) - , ( "_global.annotations.key", "Key" ) - , ( "_global.annotations.value", "Value" ) - , ( "_global.answer", "Answer" ) - , ( "_global.answer.advice", "Advice" ) - , ( "_global.answer.label", "Label" ) - , ( "_global.answer.untitled", "Untitled answer" ) - , ( "_global.answers", "Answers" ) - , ( "_global.chapter", "Chapter" ) - , ( "_global.chapter.text", "Text" ) - , ( "_global.chapter.title", "Title" ) - , ( "_global.chapter.untitled", "Untitled chapter" ) - , ( "_global.chapters", "Chapters" ) - , ( "_global.choice", "Choice" ) - , ( "_global.choice.label", "Label" ) - , ( "_global.choice.untitled", "Untitled choice" ) - , ( "_global.choices", "Choices" ) - , ( "_global.expert", "Expert" ) - , ( "_global.expert.email", "Email" ) - , ( "_global.expert.name", "Name" ) - , ( "_global.expert.untitled", "Untitled expert" ) - , ( "_global.experts", "Experts" ) - , ( "_global.followupQuestions", "Follow-Up Questions" ) - , ( "_global.integration", "Integration" ) - , ( "_global.integration.id", "ID" ) - , ( "_global.integration.logo", "Logo URL" ) - , ( "_global.integration.name", "Name" ) - , ( "_global.integration.props", "Props" ) - , ( "_global.integration.request", "Request" ) - , ( "_global.integration.request.body", "Request HTTP Body" ) - , ( "_global.integration.request.emptySearch", "Allow Empty Search" ) - , ( "_global.integration.request.headers", "Request HTTP Headers" ) - , ( "_global.integration.request.method", "Request HTTP Method" ) - , ( "_global.integration.request.url", "Request URL" ) - , ( "_global.integration.response", "Response" ) - , ( "_global.integration.response.idField", "Response Item ID" ) - , ( "_global.integration.itemUrl", "Item URL" ) - , ( "_global.integration.response.listField", "Response List Field" ) - , ( "_global.integration.response.itemTemplate", "Response Item Template" ) - , ( "_global.integration.type", "Type" ) - , ( "_global.integration.header.name", "Header Name" ) - , ( "_global.integration.header.value", "Header Value" ) - , ( "_global.integration.untitled", "Untitled integration" ) - , ( "_global.integration.widgetUrl", "Widget URL" ) - , ( "_global.integrations", "Integrations" ) - , ( "_global.integrationType.api", "API" ) - , ( "_global.integrationType.widget", "Widget" ) - , ( "_global.knowledgeModel", "Knowledge Model" ) - , ( "_global.metric", "Metric" ) - , ( "_global.metric.abbreviation", "Abbreviation" ) - , ( "_global.metric.description", "Description" ) - , ( "_global.metric.measure", "Measure" ) - , ( "_global.metric.title", "Title" ) - , ( "_global.metric.untitled", "Untitled measure" ) - , ( "_global.metric.weight", "Weight" ) - , ( "_global.metrics", "Metrics" ) - , ( "_global.phase", "Phase" ) - , ( "_global.phase.title", "Title" ) - , ( "_global.phase.description", "Description" ) - , ( "_global.phase.untitled", "Untitled phase" ) - , ( "_global.phases", "Phases" ) - , ( "_global.project.role.commenter", "Commenter" ) - , ( "_global.project.role.editor", "Editor" ) - , ( "_global.project.role.owner", "Owner" ) - , ( "_global.project.role.viewer", "Viewer" ) - , ( "_global.projectImporter.name", "Name" ) - , ( "_global.question", "Question" ) - , ( "_global.question.itemTemplate", "Item Template" ) - , ( "_global.question.type", "Type" ) - , ( "_global.question.text", "Text" ) - , ( "_global.question.title", "Title" ) - , ( "_global.question.requiredLevel", "When does this question become desirable?" ) - , ( "_global.question.untitled", "Untitled question" ) - , ( "_global.questions", "Questions" ) - , ( "_global.questionType.integration", "Integration" ) - , ( "_global.questionType.list", "List of items" ) - , ( "_global.questionType.multiChoice", "Multi-Choice" ) - , ( "_global.questionType.options", "Options" ) - , ( "_global.questionType.value", "Value" ) - , ( "_global.questionValueType", "Value Type" ) - , ( "_global.questionValueType.color", "Color" ) - , ( "_global.questionValueType.date", "Date" ) - , ( "_global.questionValueType.datetime", "Date Time" ) - , ( "_global.questionValueType.email", "Email" ) - , ( "_global.questionValueType.number", "Number" ) - , ( "_global.questionValueType.string", "String" ) - , ( "_global.questionValueType.text", "Text" ) - , ( "_global.questionValueType.time", "Time" ) - , ( "_global.questionValueType.url", "URL" ) - , ( "_global.reference", "Reference" ) - , ( "_global.reference.description", "Description" ) - , ( "_global.reference.label", "Label" ) - , ( "_global.reference.shortUuid", "Short UUID" ) - , ( "_global.reference.targetUuid", "Target UUID" ) - , ( "_global.reference.untitled", "Untitled reference" ) - , ( "_global.reference.url", "URL" ) - , ( "_global.references", "References" ) - , ( "_global.referenceType", "Reference Type" ) - , ( "_global.referenceType.cross", "Cross Reference" ) - , ( "_global.referenceType.resourcePage", "Resource Page" ) - , ( "_global.referenceType.url", "URL" ) - , ( "_global.tag", "Question Tag" ) - , ( "_global.tag.color", "Color" ) - , ( "_global.tag.description", "Description" ) - , ( "_global.tag.name", "Name" ) - , ( "_global.tag.untitled", "Untitled question tag" ) - , ( "_global.tags", "Question Tags" ) - - -- Events - , ( "_global.event.addAnswer", "Add answer" ) - , ( "_global.event.addChapter", "Add chapter" ) - , ( "_global.event.addChoice", "Add choice" ) - , ( "_global.event.addExpert", "Add expert" ) - , ( "_global.event.addIntegration", "Add integration" ) - , ( "_global.event.addMetric", "Add metric" ) - , ( "_global.event.addPhase", "Add phase" ) - , ( "_global.event.addQuestion", "Add question" ) - , ( "_global.event.addReference", "Add reference" ) - , ( "_global.event.addTag", "Add question tag" ) - , ( "_global.event.deleteAnswer", "Delete answer" ) - , ( "_global.event.deleteChapter", "Delete chapter" ) - , ( "_global.event.deleteChoice", "Delete choice" ) - , ( "_global.event.deleteExpert", "Delete expert" ) - , ( "_global.event.deleteIntegration", "Delete integration" ) - , ( "_global.event.deleteMetric", "Delete metric" ) - , ( "_global.event.deletePhase", "Delete phase" ) - , ( "_global.event.deleteQuestion", "Delete question" ) - , ( "_global.event.deleteReference", "Delete reference" ) - , ( "_global.event.deleteTag", "Delete question tag" ) - , ( "_global.event.editAnswer", "Edit answer" ) - , ( "_global.event.editChapter", "Edit chapter" ) - , ( "_global.event.editChoice", "Edit choice" ) - , ( "_global.event.editExpert", "Edit expert" ) - , ( "_global.event.editIntegration", "Edit integration" ) - , ( "_global.event.editKM", "Edit Knowledge Model" ) - , ( "_global.event.editMetric", "Edit metric" ) - , ( "_global.event.editPhase", "Edit phase" ) - , ( "_global.event.editQuestion", "Edit question" ) - , ( "_global.event.editReference", "Edit reference" ) - , ( "_global.event.editTag", "Edit question tag" ) - , ( "_global.event.moveAnswer", "Move answer" ) - , ( "_global.event.moveChoice", "Move choice" ) - , ( "_global.event.moveExpert", "Move expert" ) - , ( "_global.event.moveQuestion", "Move question" ) - , ( "_global.event.moveReference", "Move reference" ) - - -- Other entities - , ( "_global.app.appId", "App ID" ) - , ( "_global.app.createdAt", "Created at" ) - , ( "_global.app.name", "Name" ) - , ( "_global.app.updatedAt", "Updated at" ) - , ( "_global.appPlan.name", "Name" ) - , ( "_global.appPlan.users", "Users" ) - , ( "_global.appPlan.from", "From" ) - , ( "_global.appPlan.to", "To" ) - , ( "_global.appPlan.trial", "Trial" ) - , ( "_global.apps", "Apps" ) - , ( "_global.branch.basedOn", "Based on" ) - , ( "_global.branch.createdAt", "Created" ) - , ( "_global.branch.name", "Name" ) - , ( "_global.branch.kmId", "Knowledge Model ID" ) - , ( "_global.branch.updatedAt", "Updated" ) - , ( "_global.document.createdAt", "Created" ) - , ( "_global.document.name", "Name" ) - , ( "_global.km.action.view", "View detail" ) - , ( "_global.km.action.export", "Export" ) - , ( "_global.km.action.fork", "Fork KM" ) - , ( "_global.km.action.kmEditor", "Create KM editor" ) - , ( "_global.km.action.preview", "Preview" ) - , ( "_global.km.action.project", "Create project" ) - , ( "_global.km.action.delete", "Delete" ) - , ( "_global.kmMigration", "Migration" ) - , ( "_global.listingOp.and", "AND" ) - , ( "_global.listingOp.or", "OR" ) - , ( "_global.loading", "Loading..." ) - , ( "_global.package", "Knowledge Model" ) - , ( "_global.package.createdAt", "Created" ) - , ( "_global.package.id", "ID" ) - , ( "_global.package.forkOf", "Fork of" ) - , ( "_global.package.knowledgeModelId", "Knowledge Model ID" ) - , ( "_global.package.latestVersion", "Latest version" ) - , ( "_global.package.license", "License" ) - , ( "_global.package.metamodel", "Metamodel" ) - , ( "_global.package.name", "Name" ) - , ( "_global.package.otherVersions", "Other versions" ) - , ( "_global.package.parentKM", "Parent Knowledge Model" ) - , ( "_global.package.publishedBy", "Published by" ) - , ( "_global.package.registryLink", "Registry Link" ) - , ( "_global.package.version", "Version" ) - , ( "_global.project", "Project" ) - , ( "_global.projectTags", "Project Tags" ) - , ( "_global.questionnaire.createdAt", "Created" ) - , ( "_global.questionnaire.currentPhase", "Current Phase" ) - , ( "_global.questionnaire.defaultFormat", "Default document format" ) - , ( "_global.questionnaire.defaultTemplate", "Default document template" ) - , ( "_global.questionnaire.description", "Description" ) - , ( "_global.questionnaire.isTemplate", "Project Template" ) - , ( "_global.questionnaire.isTemplate.desc", "Project templates can be used by other users so they don't have to start their new projects from scratch." ) - , ( "_global.questionnaire.name", "Name" ) - , ( "_global.questionnaire.sharing", "Public link" ) - , ( "_global.questionnaire.sharingPermission", "Anyone with the link can %s the Project." ) - , ( "_global.questionnaire.summaryReport", "Summary Report" ) - , ( "_global.questionnaire.template", "Project Template" ) - , ( "_global.questionnaire.template.recommended", "Recommended" ) - , ( "_global.questionnaire.templateBadge", "Template" ) - , ( "_global.questionnaire.updatedAt", "Updated" ) - , ( "_global.questionnaire.visibility", "Visible by all other logged-in users" ) - , ( "_global.questionnaire.visibilityPermission", "Other logged-in users can %s the Project." ) - , ( "_global.questionnairePermission.edit", "edit" ) - , ( "_global.submissionState.done", "Submitted" ) - , ( "_global.submissionState.error", "Error" ) - , ( "_global.submissionState.inProgress", "Submitting" ) - , ( "_global.template", "Document Template" ) - , ( "_global.template.format", "Format" ) - , ( "_global.template.formats", "Formats" ) - , ( "_global.template.id", "ID" ) - , ( "_global.template.license", "License" ) - , ( "_global.template.metamodel", "Metamodel" ) - , ( "_global.template.name", "Name" ) - , ( "_global.template.otherVersions", "Other versions" ) - , ( "_global.template.publishedBy", "Published by" ) - , ( "_global.template.registryLink", "Registry Link" ) - , ( "_global.template.templateId", "Document Template ID" ) - , ( "_global.template.usableWith", "Usable with" ) - , ( "_global.template.version", "Version" ) - , ( "_global.usage", "Usage" ) - , ( "_global.user.active", "Active" ) - , ( "_global.user.affiliation", "Affiliation" ) - , ( "_global.user.anonymous", "Anonymous user" ) - , ( "_global.user.createdAt", "Created" ) - , ( "_global.user.email", "Email" ) - , ( "_global.user.firstName", "First name" ) - , ( "_global.user.lastName", "Last name" ) - , ( "_global.user.lastVisitedAt", "Last online" ) - , ( "_global.user.password", "Password" ) - , ( "_global.user.passwordConfirmation", "Password again" ) - , ( "_global.user.role", "Role" ) - , ( "_global.users", "Users" ) - - -- User Avatars - , ( "_global.avatar.0", "Anonymous Cat" ) - , ( "_global.avatar.1", "Anonymous Crow" ) - , ( "_global.avatar.2", "Anonymous Dog" ) - , ( "_global.avatar.3", "Anonymous Dove" ) - , ( "_global.avatar.4", "Anonymous Dragon" ) - , ( "_global.avatar.5", "Anonymous Fish" ) - , ( "_global.avatar.6", "Anonymous Frog" ) - , ( "_global.avatar.7", "Anonymous Hippo" ) - , ( "_global.avatar.8", "Anonymous Horse" ) - , ( "_global.avatar.9", "Anonymous Kiwi" ) - , ( "_global.avatar.10", "Anonymous Otter" ) - , ( "_global.avatar.11", "Anonymous Spider" ) - , ( "_global.avatar.12", "Anonymous Pig" ) - , ( "_global.avatar.13", "Anonymous Bug" ) - , ( "_global.avatar.14", "Anonymous Wizard" ) - , ( "_global.avatar.15", "Anonymous Ghost" ) - , ( "_global.avatar.16", "Anonymous Robot" ) - , ( "_global.avatar.17", "Anonymous Snowman" ) - , ( "_global.avatar.18", "Anonymous Tree" ) - , ( "_global.avatar.19", "Anonymous Cowboy" ) - - -- Modules texts - , ( "Wizard.Apps.Create.View.header.title", "Create app" ) - , ( "Wizard.Apps.Create.View.form.create", "Create" ) - , ( "Wizard.Apps.Index.View.badge.disabled", "Disabled" ) - , ( "Wizard.Apps.Index.View.header.create", "Create" ) - , ( "Wizard.Apps.Index.View.filter.enabled.name", "Enabled" ) - , ( "Wizard.Apps.Index.View.filter.enabled.enabledOnly", "Enabled only" ) - , ( "Wizard.Apps.Index.View.filter.enabled.disabledOnly", "Disabled only" ) - , ( "Wizard.Apps.Index.View.listing.empty", "Click \"Create\" button to add a new App." ) - , ( "Wizard.Apps.Index.View.listing.searchPlaceholderText", "Search apps..." ) - , ( "Wizard.Apps.Detail.View.actions.edit", "Edit" ) - , ( "Wizard.Apps.Detail.View.addPlanModal.action", "Add" ) - , ( "Wizard.Apps.Detail.View.addPlanModal.title", "Add plan" ) - , ( "Wizard.Apps.Detail.View.deletePlanModal.action", "Delete" ) - , ( "Wizard.Apps.Detail.View.deletePlanModal.text", "Are you sure you want to delete plan **%s**?" ) - , ( "Wizard.Apps.Detail.View.deletePlanModal.title", "Delete plan" ) - , ( "Wizard.Apps.Detail.View.editPlanModal.action", "Save" ) - , ( "Wizard.Apps.Detail.View.editPlanModal.title", "Edit plan" ) - , ( "Wizard.Apps.Detail.View.badge.disabled", "Disabled" ) - , ( "Wizard.Apps.Detail.View.badge.enabled", "Enabled" ) - , ( "Wizard.Apps.Detail.View.content.title.plans", "Plans" ) - , ( "Wizard.Apps.Detail.View.content.title.usage", "Usage" ) - , ( "Wizard.Apps.Detail.View.content.plans.add", "Add plan" ) - , ( "Wizard.Apps.Detail.View.editModal.save", "Save" ) - , ( "Wizard.Apps.Detail.View.editModal.title", "Edit app" ) - , ( "Wizard.Apps.Detail.View.sidePanel.admins", "Admins" ) - , ( "Wizard.Apps.Detail.View.sidePanel.appId", "App ID" ) - , ( "Wizard.Apps.Detail.View.sidePanel.clientUrl", "Client URL" ) - , ( "Wizard.Apps.Detail.View.sidePanel.createdAt", "Created at" ) - , ( "Wizard.Apps.Detail.View.sidePanel.enabled", "Enabled" ) - , ( "Wizard.Apps.Detail.View.sidePanel.info", "Info" ) - , ( "Wizard.Apps.Detail.View.sidePanel.serverUrl", "Server URL" ) - , ( "Wizard.Apps.Detail.View.sidePanel.updatedAt", "Updated at" ) - , ( "Wizard.Apps.Detail.View.sidePanel.urls", "URLs" ) - , ( "Wizard.Common.Components.Listing.View.empty.heading", "No data" ) - , ( "Wizard.Common.Components.Listing.View.empty.noMatch", "There are no results matching your search and filters." ) - , ( "Wizard.Common.Components.Listing.View.filter.clearSelection", "Clear selection" ) - , ( "Wizard.Common.Components.Listing.View.item.updated", "Updated " ) - , ( "Wizard.Common.Components.Listing.View.pagination.first", "First" ) - , ( "Wizard.Common.Components.Listing.View.pagination.last", "Last" ) - , ( "Wizard.Common.Components.Listing.View.pagination.next", "Next" ) - , ( "Wizard.Common.Components.Listing.View.pagination.prev", "Prev" ) - , ( "Wizard.Common.Components.Listing.View.toolbarFilter.placeholder", "Filter by name..." ) - , ( "Wizard.Common.Components.Listing.View.toolbarSort.orderBy", "Order by" ) - , ( "Wizard.Common.Components.PlansList.badge.trial", "Trial" ) - , ( "Wizard.Common.Components.PlansList.badge.active", "Active" ) - , ( "Wizard.Common.Components.PlansList.noPlans", "There are no plans for this instance." ) - , ( "Wizard.Common.Components.PlansList.table.plan", "Plan" ) - , ( "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer.desirable", "Desirable: " ) - , ( "Wizard.Common.Components.Questionnaire.DefaultQuestionnaireRenderer.externalLinks", "External links" ) - , ( "Wizard.Common.Components.Questionnaire.DeleteVersionModal.deleteMessage", "Are you sure you want to delete version %s?" ) - , ( "Wizard.Common.Components.Questionnaire.DeleteVersionModal.deleteInfo", "(Your answers will remain unchanged)" ) - , ( "Wizard.Common.Components.Questionnaire.DeleteVersionModal.title", "Delete version" ) - , ( "Wizard.Common.Components.Questionnaire.DeleteVersionModal.action", "Delete" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.done", "Done" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.follow", "You can follow the GitHub %s." ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.info", "If you found something wrong with the question, you can send us your recommendation on how to improve it." ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.issue", "Issue %s" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.reportedIssues", "There are already some issues reported with this question." ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.send", "Send" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.title", "Feedback" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.form.title", "Title" ) - , ( "Wizard.Common.Components.Questionnaire.FeedbackModal.form.description", "Description" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.createDocument", "Create document" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.delete", "Delete this version" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.name", "Name this version" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.rename", "Rename this version" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.revert", "Revert to this version" ) - , ( "Wizard.Common.Components.Questionnaire.History.action.viewQuestionnaire", "View questionnaire" ) - , ( "Wizard.Common.Components.Questionnaire.History.event.cleared", "Cleared reply of" ) - , ( "Wizard.Common.Components.Questionnaire.History.event.phase", "Set phase to %s" ) - , ( "Wizard.Common.Components.Questionnaire.History.nameOnly.label", "Named versions only" ) - , ( "Wizard.Common.Components.Questionnaire.NavigationTree.defaultItem", "Item %s" ) - , ( "Wizard.Common.Components.Questionnaire.VersionModal.form.name", "Name" ) - , ( "Wizard.Common.Components.Questionnaire.VersionModal.form.description", "Description" ) - , ( "Wizard.Common.Components.Questionnaire.VersionModal.title.new", "New version" ) - , ( "Wizard.Common.Components.Questionnaire.VersionModal.title.rename", "Rename version" ) - , ( "Wizard.Common.Components.Questionnaire.VersionModal.action", "Save" ) - , ( "Wizard.Common.Components.Questionnaire.answer.clear", "Clear answer" ) - , ( "Wizard.Common.Components.Questionnaire.answer.followUpTitle", "This option leads to some follow up questions." ) - , ( "Wizard.Common.Components.Questionnaire.chapterLinks.prev", "Previous Chapter" ) - , ( "Wizard.Common.Components.Questionnaire.chapterLinks.next", "Next Chapter" ) - , ( "Wizard.Common.Components.Questionnaire.comments.commentThread.delete", "Delete this comment thread?" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.delete", "Delete this comment?" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.action.resolveTitle", "Resolve comment thread" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.action.reopen", "Reopen" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.action.edit", "Edit" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.action.delete", "Delete" ) - , ( "Wizard.Common.Components.Questionnaire.comments.comment.editedLabel", "edited" ) - , ( "Wizard.Common.Components.Questionnaire.comments.deleteOverlay.delete", "Delete" ) - , ( "Wizard.Common.Components.Questionnaire.comments.edit.submit", "Edit" ) - , ( "Wizard.Common.Components.Questionnaire.comments.form.cancel", "Cancel" ) - , ( "Wizard.Common.Components.Questionnaire.comments.nav.comments", "Comments" ) - , ( "Wizard.Common.Components.Questionnaire.comments.nav.editorNotes", "Editor notes" ) - , ( "Wizard.Common.Components.Questionnaire.comments.newThread.placeholder", "Create a new comment..." ) - , ( "Wizard.Common.Components.Questionnaire.comments.newThread.submit", "Comment" ) - , ( "Wizard.Common.Components.Questionnaire.comments.editorNotes.description", "Editor notes are only visible to project Editors and Owners." ) - , ( "Wizard.Common.Components.Questionnaire.comments.reply.placeholder", "Reply..." ) - , ( "Wizard.Common.Components.Questionnaire.comments.reply.submit", "Reply" ) - , ( "Wizard.Common.Components.Questionnaire.comments.viewResolved", "View resolved comments" ) - , ( "Wizard.Common.Components.Questionnaire.commentsOverview.empty", "Click the %s icon to add new comments to a question." ) - , ( "Wizard.Common.Components.Questionnaire.list.add", "Add" ) - , ( "Wizard.Common.Components.Questionnaire.list.defaultItem", "Item %s" ) - , ( "Wizard.Common.Components.Questionnaire.list.delete", "Delete" ) - , ( "Wizard.Common.Components.Questionnaire.list.moveDown", "Move Down" ) - , ( "Wizard.Common.Components.Questionnaire.list.moveUp", "Move Up" ) - , ( "Wizard.Common.Components.Questionnaire.list.noAnswers", "There are no answers yet." ) - , ( "Wizard.Common.Components.Questionnaire.migrationWarning", "There is an ongoing %s. Finish it before you can continue editing this project." ) - , ( "Wizard.Common.Components.Questionnaire.migrationWarning.migration", "project migration" ) - , ( "Wizard.Common.Components.Questionnaire.integrationWidget.select", "Select" ) - , ( "Wizard.Common.Components.Questionnaire.question.answeredBy", "Answered %s by %s." ) - , ( "Wizard.Common.Components.Questionnaire.question.answeredBy.anonymous", "anonymous user" ) - , ( "Wizard.Common.Components.Questionnaire.removeItemModal.action", "Remove" ) - , ( "Wizard.Common.Components.Questionnaire.removeItemModal.text", "Are you sure you want to remove this item?" ) - , ( "Wizard.Common.Components.Questionnaire.removeItemModal.title", "Remove Item" ) - , ( "Wizard.Common.Components.Questionnaire.todoAction.add", "Add TODO" ) - , ( "Wizard.Common.Components.Questionnaire.todoAction.remove", "Remove TODO" ) - , ( "Wizard.Common.Components.Questionnaire.todoAction.todo", "TODO" ) - , ( "Wizard.Common.Components.Questionnaire.todos.completed", "All TODOs have been completed." ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.comments", "Comments" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.todos", "TODOs" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.versionHistory", "Version history" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view", "View" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view.answeredBy", "Answered by" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view.hideAll", "Hide all" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view.phases", "Phases" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view.showAll", "Show all" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.view.tags", "Question tags" ) - , ( "Wizard.Common.Components.Questionnaire.toolbar.warnings", "Warnings" ) - , ( "Wizard.Common.Components.Questionnaire.typeHints.empty", "There are no results for your search." ) - , ( "Wizard.Common.Components.Questionnaire.typeHints.loading", "Loading..." ) - , ( "Wizard.Common.Components.Questionnaire.value.invalidColor", "This is not a valid color." ) - , ( "Wizard.Common.Components.Questionnaire.value.invalidEmail", "This is not a valid email address." ) - , ( "Wizard.Common.Components.Questionnaire.value.invalidUrl", "This is not a valid URL." ) - , ( "Wizard.Common.Components.Questionnaire.warnings.noWarnings", "There are no more warnings." ) - , ( "Wizard.Common.Components.QuestionnaireVersionTag.current", "Current" ) - , ( "Wizard.Common.Components.SummaryReport.answeredIndication.label", "Answered: %s/%s" ) - , ( "Wizard.Common.Components.SummaryReport.phasesAnsweredIndication.label", "Answered (current phase): %s/%s" ) - , ( "Wizard.Common.Components.SummaryReport.metricsDescriptions.metricsExplanation", "Metrics explanation" ) - , ( "Wizard.Common.Components.TypeHintInput.emptyResult", "No results matching your search were found." ) - , ( "Wizard.Common.Components.UsageTable.metric.users", "Users" ) - , ( "Wizard.Common.Components.UsageTable.metric.activeUsers", "Active Users" ) - , ( "Wizard.Common.Components.UsageTable.metric.kmEditors", "Knowledge Model Editors" ) - , ( "Wizard.Common.Components.UsageTable.metric.knowledgeModels", "Knowledge Models" ) - , ( "Wizard.Common.Components.UsageTable.metric.templates", "Document Templates" ) - , ( "Wizard.Common.Components.UsageTable.metric.projects", "Projects" ) - , ( "Wizard.Common.Components.UsageTable.metric.documents", "Documents" ) - , ( "Wizard.Common.Components.UsageTable.metric.storage", "Storage" ) - , ( "Wizard.Common.Menu.Update.error.buildInfo", "Cannot get build info." ) - , ( "Wizard.Common.Menu.View.about.action", "OK" ) - , ( "Wizard.Common.Menu.View.about.apiDocs", "API Docs" ) - , ( "Wizard.Common.Menu.View.about.apiUrl", "API URL" ) - , ( "Wizard.Common.Menu.View.about.builtAt", "Built at" ) - , ( "Wizard.Common.Menu.View.about.client", "Client" ) - , ( "Wizard.Common.Menu.View.about.server", "Server" ) - , ( "Wizard.Common.Menu.View.about.styleVersion", "Style Version" ) - , ( "Wizard.Common.Menu.View.about.title", "About" ) - , ( "Wizard.Common.Menu.View.about.version", "Version" ) - , ( "Wizard.Common.Menu.View.menu.apps", "Apps" ) - , ( "Wizard.Common.Menu.View.menu.dev", "Dev" ) - , ( "Wizard.Common.Menu.View.menu.dev.operations", "Operations" ) - , ( "Wizard.Common.Menu.View.menu.dev.persistentCommands", "Persistent Commands" ) - , ( "Wizard.Common.Menu.View.menu.documents", "Documents" ) - , ( "Wizard.Common.Menu.View.menu.documents.list", "List" ) - , ( "Wizard.Common.Menu.View.menu.documents.templates", "Templates" ) - , ( "Wizard.Common.Menu.View.menu.documentTemplates", "Document Templates" ) - , ( "Wizard.Common.Menu.View.menu.knowledgeModels", "Knowledge Models" ) - , ( "Wizard.Common.Menu.View.menu.knowledgeModels.editors", "Editors" ) - , ( "Wizard.Common.Menu.View.menu.knowledgeModels.list", "List" ) - , ( "Wizard.Common.Menu.View.menu.projects", "Projects" ) - , ( "Wizard.Common.Menu.View.menu.projects.importers", "Importers" ) - , ( "Wizard.Common.Menu.View.menu.projects.list", "List" ) - , ( "Wizard.Common.Menu.View.menu.settings", "Settings" ) - , ( "Wizard.Common.Menu.View.menu.users", "Users" ) - , ( "Wizard.Common.Menu.View.profileMenu.about", "About" ) - , ( "Wizard.Common.Menu.View.profileMenu.edit", "Edit profile" ) - , ( "Wizard.Common.Menu.View.profileMenu.logout", "Log out" ) - , ( "Wizard.Common.Menu.View.profileMenu.reportIssue", "Report issue" ) - , ( "Wizard.Common.Menu.View.sidebar.collapse", "Collapse sidebar" ) - , ( "Wizard.Common.Menu.View.reportModal.action", "OK" ) - , ( "Wizard.Common.Menu.View.reportModal.info", "If you find any problem, the best way to report it is to open an issue in our GitHub repository." ) - , ( "Wizard.Common.Menu.View.reportModal.title", "Report issue" ) - , ( "Wizard.Common.Menu.View.reportModal.writeUs", "You can also write us an email to %s." ) - , ( "Wizard.Common.TimeDistance.ago", "%s ago" ) - , ( "Wizard.Common.TimeDistance.in", "in %s" ) - , ( "Wizard.Common.TimeDistance.lessThan1Minute", "less than a minute" ) - , ( "Wizard.Common.TimeDistance.lessThanXMinute", "less than %s minutes" ) - , ( "Wizard.Common.TimeDistance.1Minute", "1 minute" ) - , ( "Wizard.Common.TimeDistance.xMinutes", "%s minutes" ) - , ( "Wizard.Common.TimeDistance.about1Hour", "about 1 hour" ) - , ( "Wizard.Common.TimeDistance.aboutXHours", "about %s hours" ) - , ( "Wizard.Common.TimeDistance.1Day", "1 day" ) - , ( "Wizard.Common.TimeDistance.XDays", "%s days" ) - , ( "Wizard.Common.TimeDistance.about1Month", "about 1 month" ) - , ( "Wizard.Common.TimeDistance.aboutXMonths", "about %s months" ) - , ( "Wizard.Common.TimeDistance.1Month", "1 month" ) - , ( "Wizard.Common.TimeDistance.XMonths", "%s months" ) - , ( "Wizard.Common.TimeDistance.about1Year", "about 1 year" ) - , ( "Wizard.Common.TimeDistance.aboutXYears", "about %s years" ) - , ( "Wizard.Common.TimeDistance.over1Year", "over 1 year" ) - , ( "Wizard.Common.TimeDistance.overXYears", "over %s years" ) - , ( "Wizard.Common.TimeDistance.almost1Year", "almost 1 year" ) - , ( "Wizard.Common.TimeDistance.almostXYears", "almost %s years" ) - , ( "Wizard.Common.View.Flash.loader.loading", "Loading..." ) - , ( "Wizard.Common.View.FormActions.cancelButton.cancel", "Cancel" ) - , ( "Wizard.Common.View.FormGroup.list.add", "Add" ) - , ( "Wizard.Common.View.FormGroup.formatRadioGroup.pdfOnly", "Only PDF documents are enabled in this instance." ) - , ( "Wizard.Common.View.FormGroup.markdownEditor.editor", "Editor" ) - , ( "Wizard.Common.View.FormGroup.markdownEditor.markdownDescription", "You can use markdown and see the result in the preview tab." ) - , ( "Wizard.Common.View.FormGroup.markdownEditor.preview", "Preview" ) - , ( "Wizard.Common.View.FormGroup.optional", "(optional)" ) - , ( "Wizard.Common.View.Layout.header.logIn", "Log In" ) - , ( "Wizard.Common.View.Layout.header.goToApp", "Go to App" ) - , ( "Wizard.Common.View.Layout.header.signUp", "Sign Up" ) - , ( "Wizard.Common.View.Layout.misconfigured.appNotConfigured", "Application is not configured correctly and cannot run." ) - , ( "Wizard.Common.View.Layout.misconfigured.configurationError", "Configuration Error" ) - , ( "Wizard.Common.View.Layout.misconfigured.contactAdmin", "Please, contact the administrator." ) - , ( "Wizard.Common.View.Modal.button.cancel", "Cancel" ) - , ( "Wizard.Common.View.Modal.button.ok", "Ok" ) - , ( "Wizard.Common.View.Page.error.heading", "Error" ) - , ( "Wizard.Common.View.Page.loader.loading", "Loading..." ) - , ( "Wizard.Common.View.Tag.list.empty", "There are no question tags configured for the Knowledge Model." ) - , ( "Wizard.Common.View.Tag.readOnlyList.noTags", "No question tags" ) - , ( "Wizard.Common.View.Tag.selection.info", "You can filter questions in the questionnaire by question tags. If no question tags are selected, all questions will be used." ) - , ( "Wizard.Common.View.Tag.selection.empty", "There are no question tags for this knowledge model." ) - , ( "Wizard.Dashboard.Dashboards.WelcomeDashboard.welcome", "Welcome to the %s!" ) - , ( "Wizard.Dashboard.Widgets.AddOpenIDWidget.title", "Add OpenID Service" ) - , ( "Wizard.Dashboard.Widgets.AddOpenIDWidget.text", "OpenID is an open standard for authentication that allows using existing accounts to login to other services without creating a new password. Configure your organization's OpenID to make it easier for your users to log in." ) - , ( "Wizard.Dashboard.Widgets.AddOpenIDWidget.actionLabel", "Add OpenID" ) - , ( "Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget.title", "Configure Look & Feel" ) - , ( "Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget.textWithCustomizations", "You can configure the application name and easily change the logo and colors to match your organization's style. You can also add additional menu links, for example, to your guidelines or documentation." ) - , ( "Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget.textWithoutCustomizations", "You can configure the application name, or add additional menu links, for example, to your guidelines or documentation." ) - , ( "Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget.actionLabel", "Configure" ) - , ( "Wizard.Dashboard.Widgets.ConfigureOrganizationWidget.title", "Configure Organization Info" ) - , ( "Wizard.Dashboard.Widgets.ConfigureOrganizationWidget.text", "Fill in your organization name and organization ID. For example, these values will be used with knowledge models created in this instance." ) - , ( "Wizard.Dashboard.Widgets.ConfigureOrganizationWidget.actionLabel", "Configure" ) - , ( "Wizard.Dashboard.Widgets.ConnectRegistryWidget.title", "Connect to DSW Registry" ) - , ( "Wizard.Dashboard.Widgets.ConnectRegistryWidget.text", "[DSW Registry](https://registry.ds-wizard.org) is a place for published knowledge models and document templates. When you connect your instance, data stewards can easily import them." ) - , ( "Wizard.Dashboard.Widgets.ConnectRegistryWidget.actionLabel", "Connect" ) - , ( "Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget.title", "Create Knowledge Model" ) - , ( "Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget.text", "Knowledge model is a tree-like structure containing the knowledge about what should be asked and how. It is used as a template for questionnaires in projects. You can create new ones from scratch or by modifying existing ones." ) - , ( "Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget.actionLabel", "Create" ) - , ( "Wizard.Dashboard.Widgets.CreateProjectTemplateWidget.title", "Create Project Template" ) - , ( "Wizard.Dashboard.Widgets.CreateProjectTemplateWidget.text", "Project template is a special type of project that can be used as a starting point for new projects. You can select a knowledge model, set up a document template and format, or prefill some answers to make it easier to start for researchers." ) - , ( "Wizard.Dashboard.Widgets.CreateProjectTemplateWidget.actionLabel", "Create" ) - , ( "Wizard.Dashboard.Widgets.CreateProjectWidget.title", "Create Project" ) - , ( "Wizard.Dashboard.Widgets.CreateProjectWidget.text", "Project is a workspace where you create your DMP. It is based on a knowledge model, which contains knowledge about what should be asked and how based on the research field or organization's needs. You can use document templates to transform the answers into a document. This document can be anything, from PDF to machine-actionable JSON.\n\nYou can create a new project from a project template that data stewards prepare for you to have an easier start or from scratch where you set up everything yourself." ) - , ( "Wizard.Dashboard.Widgets.CreateProjectWidget.actionLabel", "Create" ) - , ( "Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget.title", "Import Document Template" ) - , ( "Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget.text", "Document templates transform answers from a questionnaire into a document. This document can be anything, from PDF to machine-actionable JSON. You can import existing document templates from [DSW Registry](https://registry.ds-wizard.org/templates) or create new ones using [DSW TDK](https://guide.ds-wizard.org/miscellaneous/development/template-development)." ) - , ( "Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget.actionLabel", "Import" ) - , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.title", "Import Knowledge Model" ) - , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.text", "Knowledge models are published in [DSW Registry](https://registry.ds-wizard.org). You can easily import them into your instance to make them available for researchers. You can also import other knowledge models exported from different instances." ) - , ( "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget.actionLabel", "Import" ) - , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.title", "Update Knowledge Models" ) - , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.description", "There are updates available for some knowledge models." ) - , ( "Wizard.Dashboard.Widgets.OutdatedPackagesWidget.updateBadge", "update available" ) - , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.title", "Update Document Templates" ) - , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.description", "There are updates available for some document templates." ) - , ( "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget.updateBadge", "update available" ) - , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.heading", "Recent Projects" ) - , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.empty", "You have no projects yet, start by creating some." ) - , ( "Wizard.Dashboard.Widgets.RecentProjectsWidget.viewAll", "View all" ) - , ( "Wizard.Dashboard.Widgets.WelcomeWidget.roleAdmin", "As an admin, you configure the instance and manage user accounts." ) - , ( "Wizard.Dashboard.Widgets.WelcomeWidget.roleDataSteward", "As a data steward, you prepare knowledge models, document templates, and project templates for researchers." ) - , ( "Wizard.Dashboard.Widgets.WelcomeWidget.roleResearcher", "As a researcher, you create and collaborate on data management plans." ) - , ( "Wizard.Dashboard.Widgets.WelcomeWidget.welcomeName", "Welcome, %s!" ) - , ( "Wizard.Dashboard.Widgets.WelcomeWidget.welcomeDefault", "Welcome!" ) - , ( "Wizard.Documents.Index.View.action.delete", "Delete" ) - , ( "Wizard.Documents.Index.View.action.download", "Download" ) - , ( "Wizard.Documents.Index.View.action.submit", "Submit" ) - , ( "Wizard.Documents.Index.View.badge.error", "Error" ) - , ( "Wizard.Documents.Index.View.badge.inProgress", "In Progress" ) - , ( "Wizard.Documents.Index.View.badge.queued", "Queued" ) - , ( "Wizard.Documents.Index.View.header.title", "Documents" ) - , ( "Wizard.Documents.Index.View.deleteModal.action", "Delete" ) - , ( "Wizard.Documents.Index.View.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.Documents.Index.View.deleteModal.title", "Delete document" ) - , ( "Wizard.Documents.Index.View.documentErrorModal.title", "Document error" ) - , ( "Wizard.Documents.Index.View.listing.empty", "Click \"Create\" button to add a new document." ) - , ( "Wizard.Documents.Index.View.listing.name.title", "Click to download the document" ) - , ( "Wizard.Documents.Index.View.listing.searchPlaceholderText", "Search documents..." ) - , ( "Wizard.Documents.Index.View.submissionErrorModal.title", "Submission error" ) - , ( "Wizard.Documents.Index.View.submissions.errorLink", "View error" ) - , ( "Wizard.Documents.Index.View.submissions.title", "Submissions" ) - , ( "Wizard.Documents.Index.View.submissions.viewLink", "View submission" ) - , ( "Wizard.Documents.Index.View.submitModal.button.cancel", "Cancel" ) - , ( "Wizard.Documents.Index.View.submitModal.button.done", "Done" ) - , ( "Wizard.Documents.Index.View.submitModal.button.submit", "Submit" ) - , ( "Wizard.Documents.Index.View.submitModal.error.message", "The document submission failed." ) - , ( "Wizard.Documents.Index.View.submitModal.noSubmission", "There are no submission services configured for this type of document." ) - , ( "Wizard.Documents.Index.View.submitModal.success.link", "You can find it here: " ) - , ( "Wizard.Documents.Index.View.submitModal.success.message", "The document was successfully submitted." ) - , ( "Wizard.Documents.Index.View.submitModal.title", "Submit %s" ) - , ( "Wizard.KMEditor.Create.View.header", "Create Knowledge Model" ) - , ( "Wizard.KMEditor.Create.View.create", "Create" ) - , ( "Wizard.KMEditor.Create.View.form.basedOnHint", "You can create a new Knowledge Model based on the existing one or start from scratch." ) - , ( "Wizard.KMEditor.Create.View.form.kmIdHint", "Knowledge Model ID can contain alphanumeric characters and dashes but cannot start or end with a dash." ) - , ( "Wizard.KMEditor.Common.DeleteModal.text", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.KMEditor.Common.DeleteModal.title", "Delete knowledge model editor" ) - , ( "Wizard.KMEditor.Common.UpgradeModal.form.defaultOption", "- select parent package -" ) - , ( "Wizard.KMEditor.Common.UpgradeModal.form.targetPackageId", "New parent package" ) - , ( "Wizard.KMEditor.Common.UpgradeModal.text", "Select the new parent knowledge model for %s." ) - , ( "Wizard.KMEditor.Common.UpgradeModal.title", "Create migration" ) - , ( "Wizard.KMEditor.Common.UpgradeModal.action", "Create" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.answerEmptyLabel", "Empty label for answer" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.chapterTitleEmpty", "Empty title for chapter" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.choiceEmptyLabel", "Empty label for choice" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.expertEmptyEmail", "Empty email for expert" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.expertInvalidEmail", "Invalid email for expert" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyId", "Empty ID for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyItemUrl", "Empty item URL for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyRequestHttpMethod", "Empty request HTTP method for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyRequestUrl", "Empty request URL for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyResponseItemID", "Empty response item ID for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyResponseItemTemplate", "Empty response item template for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.integrationEmptyWidgetUrl", "Empty widget URL for integration" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.metricEmptyTitle", "Empty title for metric" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.phaseEmptyTitle", "Empty title for phase" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyAnswers", "No answers for options question" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyChoices", "No choices for multi-choice question" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyIntegration", "No integration selected for integration question" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionEmptyItemQuestions", "No item questions for list question" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.questionTitleEmpty", "Empty title for question" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceEmptyShortUuid", "Empty short UUID for page reference" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceEmptyUrl", "Empty URL for URL reference" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.referenceInvalidUrl", "Invalid URL for URL reference" ) - , ( "Wizard.KMEditor.Editor.Common.EditorBranch.warning.tagEmptyName", "Empty name for tag" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.annotations.add", "Add" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.headers.add", "Add" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.markdown.editor", "Editor" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.markdown.preview", "Preview" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.markdown.description", "You can use markdown and see the result in the preview tab." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Input.props.add", "Add" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Tree.collapseAll", "Collapse all" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.Tree.expandAll", "Expand all" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.TreeInput.collapseAll", "Collapse all" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.TreeInput.expandAll", "Expand all" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.answer.addQuestion", "Add follow-up question" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.chapter.addQuestion", "Add question" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.chapter", "Are you sure you want to delete this chapter?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.question", "Are you sure you want to delete this question?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.metric", "Are you sure you want to delete this metric?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.phase", "Are you sure you want to delete this phase?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.tag", "Are you sure you want to delete this question tag?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.integration", "Are you sure you want to delete this integration?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.answer", "Are you sure you want to delete this answer?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.choice", "Are you sure you want to delete this choice?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.reference", "Are you sure you want to delete this reference?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.expert", "Are you sure you want to delete this expert?" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.title", "Heads up!" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.delete", "Delete" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.deleteModal.cancel", "Cancel" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.editorTitle.copyUuid", "Click to copy UUID" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.editorTitle.delete", "Delete" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.editorTitle.move", "Move" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.empty", "The knowledge model entity you are trying to open does not exist." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.id.description", "A string that identifies the integration. It has to be unique for each integration." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.itemUrl.api.description", "Defines the URL to the selected item. Use `${id}` to get the value defined in **Response Item ID** field, for example `https://example.com/${id}`." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.itemUrl.widget.description", "Defines the URL to the selected item. Use `${id}` value returned from the widget, for example `https://example.com/${id}`." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.name.description", "A name visible everywhere else in the KM Editor, such as when choosing the integration for a question." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.logo.description", "Logo is displayed next to the link to the selected item in questionnaires. It can be either URL or base64 image." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.props.description", "Props can be used to parametrize the integration for each question. Use this to define the props whose value can be filled on the questions using this integration. The props can then be used in the URL configuration. For example, if you define prop named *type*, you can use it as `${type}`, such as *ht​tps://example.com/${type}*." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.quickSetup", "Quick setup" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.questions.label", "Questions using this integration" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.questions.noQuestions", "No questions" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.request.description", "Use this section to configure the search request. The service you want to integrate has to provide a search HTTP API where you send a search string and it returns a JSON with found items." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.requestEmptySearch.description", "Turn this off if the API cannot handle empty search requests. In that case, the requests will be made only after users type something." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.requestUrl.description", "A URL of the integrated service API that supports the search. Use `${q}` for the actual string that will be filled when users search for items, such as *ht​tps://example.com/search?q=${q}*." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.response.description", "Use this section to configure how to process the response returned from the search API." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.responseListField.description", "If the returned JSON is not an array of items directly but the items are nested, use this to define the name or path to the field in the response that contains the list of items. Keep empty otherwise." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.responseItemId.description", "Use this to define an identifier for the item. This will be used in **Item URL** as `${id}` to compose a URL to the found item. You can use properties from the returned item in Jinja2 notation. For example, if the item has a field `id` use `{{item.id}}` here. You can also compose multiple fields together, e.g., `{{item.field1}}-{{item.field2}}`." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.responseItemTemplate.description", "This defines how the found items will be displayed for the user. You can use properties from the returned item in Jinja2 notation, you can also use Markdown for some formatting. For example, if the returned item has a field called name, you can use `**{{item.name}}**` to display the name in bold." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.integration.widgetUrl.description", "The URL of the widget implemented using [DSW Integration Widget SDK](https://github.com/ds-wizard/dsw-integration-widget-sdk)." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.knowledgeModel.addChapter", "Add chapter" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.knowledgeModel.addIntegration", "Add integration" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.knowledgeModel.addMetric", "Add metric" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.knowledgeModel.addPhase", "Add phase" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.knowledgeModel.addTag", "Add question tag" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.title", "Move" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.label", "Select a new parent" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.move", "Move" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.moveModal.cancel", "Cancel" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.navbar.warnings", "Warnings" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addAnswer", "Add answer" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addChoice", "Add choice" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addExpert", "Add expert" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addItemTemplateQuestion", "Add question" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.addReference", "Add reference" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.integration.configuration", "Integration Configuration" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.integration.select", "- select integration -" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.phase.never", "Never" ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.options", "Changing a question type will remove all answers." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.list", "Changing a question type will remove all item questions." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.question.type.warning.multichoice", "Changing a question type will remove all choices." ) - , ( "Wizard.KMEditor.Editor.Components.KMEditor.warnings.empty", "There are no more warnings." ) - , ( "Wizard.KMEditor.Editor.Components.Preview.tags.selectAll", "Select all" ) - , ( "Wizard.KMEditor.Editor.Components.Preview.tags.selectNone", "Select none" ) - , ( "Wizard.KMEditor.Editor.Components.TagEditor.noTags", "There are no question tags, create them first." ) - , ( "Wizard.KMEditor.Editor.Components.TagEditor.noQuestions", "There are no questions create them first." ) - , ( "Wizard.KMEditor.Editor.Components.Settings.title", "Settings" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.dangerZone.delete", "Delete" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.dangerZone.deleteText", "Delete this knowledge model editor" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.dangerZone.deleteWarning", "Deleted knowledge model editors cannot be recovered." ) - , ( "Wizard.KMEditor.Editor.Components.Settings.dangerZone.title", "Danger Zone" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.form.kmId", "Knowledge Model ID" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.form.name", "Name" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.form.save", "Save" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.parent.title", "Parent Knowledge Model" ) - , ( "Wizard.KMEditor.Editor.Components.Settings.parent.warning", "This is not the latest version of the parent knowledge model." ) - , ( "Wizard.KMEditor.Editor.Components.Settings.parent.upgrade", "Upgrade" ) - , ( "Wizard.KMEditor.Editor.Update.unloadMessage", "Some changes are still saving." ) - , ( "Wizard.KMEditor.Editor.View.error.heading", "Oops!" ) - , ( "Wizard.KMEditor.Editor.View.error.refresh", "Refresh" ) - , ( "Wizard.KMEditor.Editor.View.error.text", "Something went wrong, try to refresh the page." ) - , ( "Wizard.KMEditor.Editor.View.header.publish", "Publish" ) - , ( "Wizard.KMEditor.Editor.View.nav.knowledgeModel", "Knowledge Model" ) - , ( "Wizard.KMEditor.Editor.View.nav.preview", "Preview" ) - , ( "Wizard.KMEditor.Editor.View.nav.settings", "Settings" ) - , ( "Wizard.KMEditor.Editor.View.nav.tags", "Question Tags" ) - , ( "Wizard.KMEditor.Editor.View.offline.heading", "Disconnected" ) - , ( "Wizard.KMEditor.Editor.View.offline.refresh", "Refresh" ) - , ( "Wizard.KMEditor.Editor.View.offline.text", "You have been disconnected, try to refresh the page." ) - , ( "Wizard.KMEditor.Index.View.action.cancelMigration", "Cancel migration" ) - , ( "Wizard.KMEditor.Index.View.action.continueMigration", "Continue migration" ) - , ( "Wizard.KMEditor.Index.View.action.openEditor", "Open Editor" ) - , ( "Wizard.KMEditor.Index.View.action.publish", "Publish" ) - , ( "Wizard.KMEditor.Index.View.action.upgrade", "Upgrade" ) - , ( "Wizard.KMEditor.Index.View.action.delete", "Delete" ) - , ( "Wizard.KMEditor.Index.View.badge.edited.title", "This Editor contains unpublished changes." ) - , ( "Wizard.KMEditor.Index.View.badge.lastPublishedVersion.title", "Last published version" ) - , ( "Wizard.KMEditor.Index.View.badge.migrated", "migrated" ) - , ( "Wizard.KMEditor.Index.View.badge.migrated.title", "This Editor has been migrated to a new parent Knowledge Model, you can publish it now." ) - , ( "Wizard.KMEditor.Index.View.badge.migrating", "migrating" ) - , ( "Wizard.KMEditor.Index.View.badge.migrating.title", "This Editor is in the process of migration to a new parent Knowledge Model." ) - , ( "Wizard.KMEditor.Index.View.badge.outdated", "update available" ) - , ( "Wizard.KMEditor.Index.View.badge.outdated.title", "There is a new version of parent Knowledge Model." ) - , ( "Wizard.KMEditor.Index.View.listing.empty", "Click \"Create\" button to add a new Knowledge Model Editor." ) - , ( "Wizard.KMEditor.Index.View.listing.searchPlaceholderText", "Search KM editors..." ) - , ( "Wizard.KMEditor.Index.View.header.title", "Knowledge Model Editor" ) - , ( "Wizard.KMEditor.Index.View.header.create", "Create" ) - , ( "Wizard.KMEditor.Migration.View.action.apply", "Apply" ) - , ( "Wizard.KMEditor.Migration.View.action.applyAll", "Apply all" ) - , ( "Wizard.KMEditor.Migration.View.action.reject", "Reject" ) - , ( "Wizard.KMEditor.Migration.View.completed.msg1", "Migration successfully completed." ) - , ( "Wizard.KMEditor.Migration.View.completed.msg2", "You can publish the new version now." ) - , ( "Wizard.KMEditor.Migration.View.completed.publish", "Publish" ) - , ( "Wizard.KMEditor.Migration.View.eventError", "The event is not connected to any entity in the Knowledge Model." ) - , ( "Wizard.KMEditor.Migration.View.running", "Migration is still running, try again later." ) - , ( "Wizard.KMEditor.Migration.View.stateError", "Migration state is corrupted." ) - , ( "Wizard.KMEditor.Migration.View.summary", "Migration of %s from %s to %s." ) - , ( "Wizard.KMEditor.Publish.View.action", "Publish" ) - , ( "Wizard.KMEditor.Publish.View.header", "Publish new version" ) - , ( "Wizard.KMEditor.Publish.View.form.description", "Description" ) - , ( "Wizard.KMEditor.Publish.View.form.description.description", "Short description of the Knowledge Model." ) - , ( "Wizard.KMEditor.Publish.View.form.kmId", "Knowledge Model ID" ) - , ( "Wizard.KMEditor.Publish.View.form.lastVersion", "Last version" ) - , ( "Wizard.KMEditor.Publish.View.form.lastVersion.empty", "No version of this package has been published yet." ) - , ( "Wizard.KMEditor.Publish.View.form.license", "License" ) - , ( "Wizard.KMEditor.Publish.View.form.license.description", "Choose a %s so others can use your Knowledge Model." ) - , ( "Wizard.KMEditor.Publish.View.form.license.description.license", "license" ) - , ( "Wizard.KMEditor.Publish.View.form.name", "Knowledge Model" ) - , ( "Wizard.KMEditor.Publish.View.form.newVersion", "New version" ) - , ( "Wizard.KMEditor.Publish.View.form.newVersion.suggestions", "Suggestions: " ) - , ( "Wizard.KMEditor.Publish.View.form.newVersion.description", "The version number is in format X.Y.Z. Increasing number Z indicates only some fixes, number Y minor changes, and number X indicates a major change." ) - , ( "Wizard.KMEditor.Publish.View.form.readme", "Readme" ) - , ( "Wizard.KMEditor.Publish.View.form.readme.description", "Describe the Knowledge Model, you can use markdown." ) - , ( "Wizard.KnowledgeModels.Detail.View.readme.versionWarning", "This is not the latest available version of this Knowledge Model." ) - , ( "Wizard.KnowledgeModels.Detail.View.registryLinkLabel", "View in registry" ) - , ( "Wizard.KnowledgeModels.Detail.View.registryVersion.warning", "There is a newer version (%s) available." ) - , ( "Wizard.KnowledgeModels.Detail.View.registryVersion.warning.import", "Import" ) - , ( "Wizard.KnowledgeModels.Detail.View.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.KnowledgeModels.Detail.View.deleteModal.title", "Delete version" ) - , ( "Wizard.KnowledgeModels.Detail.View.deleteModal.action", "Delete" ) - , ( "Wizard.KnowledgeModels.Import.FileImport.View.fileView.cancel", "Cancel" ) - , ( "Wizard.KnowledgeModels.Import.FileImport.View.fileView.upload", "Upload" ) - , ( "Wizard.KnowledgeModels.Import.FileImport.View.dropzone.choose", "Choose a file" ) - , ( "Wizard.KnowledgeModels.Import.FileImport.View.dropzone.drop", "Or just drop it here" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.dropzone.choose", "Choose a file" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.dropzone.drop", "Or just drop it here" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.file", "File" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.kmId", "Knowledge Model ID" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.name", "Name" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.organizationId", "Organization ID" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.previousPackageId", "Previous Package ID" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.rootElement", "Root Element" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.upload", "Upload" ) - , ( "Wizard.KnowledgeModels.Import.OwlImport.View.form.version", "Version" ) - , ( "Wizard.KnowledgeModels.Import.RegistryImport.View.form.import", "Import" ) - , ( "Wizard.KnowledgeModels.Import.RegistryImport.View.registryLink", "You can find Knowledge Models in %s." ) - , ( "Wizard.KnowledgeModels.Import.RegistryImport.View.registry", "DSW Registry" ) - , ( "Wizard.KnowledgeModels.Import.RegistryImport.View.imported.message", "Knowledge Model %s has been imported!" ) - , ( "Wizard.KnowledgeModels.Import.RegistryImport.View.imported.action", "View detail" ) - , ( "Wizard.KnowledgeModels.Import.View.header", "Import Knowledge Model" ) - , ( "Wizard.KnowledgeModels.Import.View.navbar.fromRegistry", "From DSW Registry" ) - , ( "Wizard.KnowledgeModels.Import.View.navbar.fromFile", "From file" ) - , ( "Wizard.KnowledgeModels.Import.View.navbar.fromOwl", "From OWL" ) - , ( "Wizard.KnowledgeModels.Index.View.header.title", "Knowledge Models" ) - , ( "Wizard.KnowledgeModels.Index.View.header.import", "Import" ) - , ( "Wizard.KnowledgeModels.Index.View.listing.empty", "Click \"Import\" button to import a new Knowledge Model." ) - , ( "Wizard.KnowledgeModels.Index.View.listing.searchPlaceholderText", "Search KMs..." ) - , ( "Wizard.KnowledgeModels.Index.View.badge.outdated", "update available" ) - , ( "Wizard.KnowledgeModels.Index.View.deleteModal.message", "Are you sure you want to permanently delete %s and all its versions?" ) - , ( "Wizard.KnowledgeModels.Index.View.deleteModal.title", "Delete package" ) - , ( "Wizard.KnowledgeModels.Index.View.deleteModal.action", "Delete" ) - , ( "Wizard.KnowledgeModels.Preview.View.createProject", "Create project" ) - , ( "Wizard.ProjectImporters.Index.View.header.title", "Project Importers" ) - , ( "Wizard.ProjectImporters.Index.View.listing.empty", "There are no project importers available." ) - , ( "Wizard.ProjectImporters.Index.View.listing.searchPlaceholderText", "Search importers..." ) - , ( "Wizard.ProjectImporters.Index.View.badge.disabled", "disabled" ) - , ( "Wizard.ProjectImporters.Index.View.badge.enabled", "enabled" ) - , ( "Wizard.ProjectImporters.Index.View.action.disable", "Disable" ) - , ( "Wizard.ProjectImporters.Index.View.action.enable", "Enable" ) - , ( "Wizard.Projects.Create.CustomCreate.View.form.save", "Save" ) - , ( "Wizard.Projects.Create.TemplateCreate.View.form.save", "Save" ) - , ( "Wizard.Projects.Create.View.header.title", "Create Project" ) - , ( "Wizard.Projects.Create.View.navbar.fromTemplate", "From Project Template" ) - , ( "Wizard.Projects.Create.View.navbar.custom", "Custom" ) - , ( "Wizard.Projects.CreateMigration.View.header.title", "Create migration" ) - , ( "Wizard.Projects.CreateMigration.View.header.info", "A new Project is created for the migration. The original will remain unchanged until the migration is finished." ) - , ( "Wizard.Projects.CreateMigration.View.form.originalKM", "Original Knowledge Model" ) - , ( "Wizard.Projects.CreateMigration.View.form.originalVersion", "Original version" ) - , ( "Wizard.Projects.CreateMigration.View.form.originalTags", "Original question tags" ) - , ( "Wizard.Projects.CreateMigration.View.form.newKM", "New Knowledge Model" ) - , ( "Wizard.Projects.CreateMigration.View.form.newVersion", "New version" ) - , ( "Wizard.Projects.CreateMigration.View.form.selectKMFirst", "Select Knowledge Model first" ) - , ( "Wizard.Projects.CreateMigration.View.form.create", "Create" ) - , ( "Wizard.Projects.Common.CloneProjectModal.View.cloneModal.info", "The original Project will remain unchanged." ) - , ( "Wizard.Projects.Common.CloneProjectModal.View.cloneModal.message", "Do you want to create a copy of %s?" ) - , ( "Wizard.Projects.Common.CloneProjectModal.View.cloneModal.title", "Clone Project" ) - , ( "Wizard.Projects.Common.CloneProjectModal.View.cloneModal.action", "Clone" ) - , ( "Wizard.Projects.Common.DeleteProjectModal.View.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.Projects.Common.DeleteProjectModal.View.deleteModal.title", "Delete Project" ) - , ( "Wizard.Projects.Common.DeleteProjectModal.View.deleteModal.action", "Delete" ) - , ( "Wizard.Projects.Common.View.visibilityIcons.titleAnyoneEdit", "Anyone with the link can edit the Project." ) - , ( "Wizard.Projects.Common.View.visibilityIcons.titleAnyoneView", "Anyone with the link can view the Project." ) - , ( "Wizard.Projects.Common.View.visibilityIcons.titleLoggedEdit", "Other logged-in users can edit the Project." ) - , ( "Wizard.Projects.Common.View.visibilityIcons.titleLoggedView", "Other logged-in users can edit the Project." ) - , ( "Wizard.Projects.Detail.Components.NewDocument.form.create", "Create" ) - , ( "Wizard.Projects.Detail.Components.NewDocument.header.title", "New document" ) - , ( "Wizard.Projects.Detail.Components.NewDocument.oldVersionInfo.link", "Create for current version" ) - , ( "Wizard.Projects.Detail.Components.NewDocument.oldVersionInfo.text", "You are creating a document for a project version from %s" ) - , ( "Wizard.Projects.Detail.Components.ProjectSaving.label.saved", "Saved" ) - , ( "Wizard.Projects.Detail.Components.ProjectSaving.label.saving", "Saving..." ) - , ( "Wizard.Projects.Detail.Components.ProjectSaving.popover.saved", "All changes have been saved" ) - , ( "Wizard.Projects.Detail.Components.Preview.notSupported.download", "Download" ) - , ( "Wizard.Projects.Detail.Components.Preview.notSupported.text", "The document format cannot be displayed in the web browser. You can still download and view it." ) - , ( "Wizard.Projects.Detail.Components.Preview.notSupported.title", "Download preview" ) - , ( "Wizard.Projects.Detail.Components.Preview.templateNotSet.heading", "Default document template is not set." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateNotSet.link", "Go to settings" ) - , ( "Wizard.Projects.Detail.Components.Preview.templateNotSet.textAnonymous", "Log in to set a default document template and format." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateNotSet.textNotOwner", "Ask the Project owner to set a default document template and format." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateNotSet.textOwner", "Before you can use preview you need to set a default document template and format." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateUnsupported.heading", "Default document template is no longer supported." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateUnsupported.link", "Go to settings" ) - , ( "Wizard.Projects.Detail.Components.Preview.templateUnsupported.textAnonymous", "Log in to update the default document template." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateUnsupported.textNotOwner", "Ask the Project owner to update the default document template." ) - , ( "Wizard.Projects.Detail.Components.Preview.templateUnsupported.textOwner", "Before you can use preview you need to update the default document template." ) - , ( "Wizard.Projects.Detail.Components.RevertModal.action", "Revert" ) - , ( "Wizard.Projects.Detail.Components.RevertModal.message", "Are you sure you want to revert the projects to its state from %s?" ) - , ( "Wizard.Projects.Detail.Components.RevertModal.title", "Revert questionnaire" ) - , ( "Wizard.Projects.Detail.Components.RevertModal.warning", "Heads up! This action cannot be undone." ) - , ( "Wizard.Projects.Detail.Components.Settings.DeleteModal.deleteModal.action", "Delete" ) - , ( "Wizard.Projects.Detail.Components.Settings.DeleteModal.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.Projects.Detail.Components.Settings.DeleteModal.deleteModal.title", "Delete Project" ) - , ( "Wizard.Projects.Detail.Components.Settings.dangerZone.delete.desc", "Deleted projects cannot be recovered." ) - , ( "Wizard.Projects.Detail.Components.Settings.dangerZone.delete.title", "Delete this Project" ) - , ( "Wizard.Projects.Detail.Components.Settings.dangerZone.title", "Danger Zone" ) - , ( "Wizard.Projects.Detail.Components.Settings.knowledgeModel.title", "Knowledge Model" ) - , ( "Wizard.Projects.Detail.Components.Settings.knowledgeModel.createMigration", "Create migration" ) - , ( "Wizard.Projects.Detail.Components.Settings.settings.title", "Settings" ) - , ( "Wizard.Projects.Detail.Components.Settings.form.addProjectTag", "Add" ) - , ( "Wizard.Projects.Detail.Components.Settings.form.save", "Save" ) - , ( "Wizard.Projects.Detail.Components.Settings.unsupportedTemplate", "This document template is no longer supported." ) - , ( "Wizard.Projects.Detail.Components.ShareModal.action", "Save" ) - , ( "Wizard.Projects.Detail.Components.ShareModal.addUsers", "Add users" ) - , ( "Wizard.Projects.Detail.Components.ShareModal.copyLink", "Copy link" ) - , ( "Wizard.Projects.Detail.Components.ShareModal.remove", "Remove" ) - , ( "Wizard.Projects.Detail.Components.ShareModal.title", "Share Project" ) - , ( "Wizard.Projects.Detail.Documents.View.action.delete", "Delete" ) - , ( "Wizard.Projects.Detail.Documents.View.action.download", "Download" ) - , ( "Wizard.Projects.Detail.Documents.View.action.submit", "Submit" ) - , ( "Wizard.Projects.Detail.Documents.View.action.viewQuestionnaire", "View questionnaire" ) - , ( "Wizard.Projects.Detail.Documents.View.badge.error", "Error" ) - , ( "Wizard.Projects.Detail.Documents.View.badge.inProgress", "In Progress" ) - , ( "Wizard.Projects.Detail.Documents.View.badge.queued", "Queued" ) - , ( "Wizard.Projects.Detail.Documents.View.deleteModal.action", "Delete" ) - , ( "Wizard.Projects.Detail.Documents.View.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.Projects.Detail.Documents.View.deleteModal.title", "Delete document" ) - , ( "Wizard.Projects.Detail.Documents.View.documentErrorModal.title", "Document error" ) - , ( "Wizard.Projects.Detail.Documents.View.listing.empty", "Click \"New document\" button to add a new document." ) - , ( "Wizard.Projects.Detail.Documents.View.listing.emptyAnonymous", "Log in to add a new document." ) - , ( "Wizard.Projects.Detail.Documents.View.listing.name.title", "Click to download the document" ) - , ( "Wizard.Projects.Detail.Documents.View.newDocument", "New document" ) - , ( "Wizard.Projects.Detail.Documents.View.submissionErrorModal.title", "Submission error" ) - , ( "Wizard.Projects.Detail.Documents.View.submissions.errorLink", "View error" ) - , ( "Wizard.Projects.Detail.Documents.View.submissions.title", "Submissions" ) - , ( "Wizard.Projects.Detail.Documents.View.submissions.viewLink", "View submission" ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.button.cancel", "Cancel" ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.button.done", "Done" ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.button.submit", "Submit" ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.noSubmission", "There are no submission services configured for this type of document." ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.success.link", "You can find it here: " ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.success.message", "The document was successfully submitted." ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.error.message", "The document submission failed." ) - , ( "Wizard.Projects.Detail.Documents.View.submitModal.title", "Submit %s" ) - , ( "Wizard.Projects.Detail.Update.unloadMessage", "Some changes are still saving." ) - , ( "Wizard.Projects.Detail.View.actions.add", "Add to my projects" ) - , ( "Wizard.Projects.Detail.View.actions.share", "Share" ) - , ( "Wizard.Projects.Detail.View.error.heading", "Oops!" ) - , ( "Wizard.Projects.Detail.View.error.text", "Something went wrong, try to refresh the page." ) - , ( "Wizard.Projects.Detail.View.error.refresh", "Refresh" ) - , ( "Wizard.Projects.Detail.View.forbidden", "You are not allowed to view this page." ) - , ( "Wizard.Projects.Detail.View.nav.documents", "Documents" ) - , ( "Wizard.Projects.Detail.View.nav.metrics", "Metrics" ) - , ( "Wizard.Projects.Detail.View.nav.preview", "Preview" ) - , ( "Wizard.Projects.Detail.View.nav.questionnaire", "Questionnaire" ) - , ( "Wizard.Projects.Detail.View.nav.settings", "Settings" ) - , ( "Wizard.Projects.Detail.View.offline.heading", "Disconnected" ) - , ( "Wizard.Projects.Detail.View.offline.text", "You have been disconnected, try to refresh the page." ) - , ( "Wizard.Projects.Detail.View.offline.refresh", "Refresh" ) - , ( "Wizard.Projects.Index.View.action.cancelMigration", "Cancel migration" ) - , ( "Wizard.Projects.Index.View.action.clone", "Clone" ) - , ( "Wizard.Projects.Index.View.action.continueMigration", "Continue migration" ) - , ( "Wizard.Projects.Index.View.action.createMigration", "Create migration" ) - , ( "Wizard.Projects.Index.View.action.delete", "Delete" ) - , ( "Wizard.Projects.Index.View.action.open", "Open Project" ) - , ( "Wizard.Projects.Index.View.badge.migrating", "migrating" ) - , ( "Wizard.Projects.Index.View.badge.outdated", "update available" ) - , ( "Wizard.Projects.Index.View.filter.projectTags.empty", "No project tags found" ) - , ( "Wizard.Projects.Index.View.filter.projectTags.searchPlaceholder", "Search project tags..." ) - , ( "Wizard.Projects.Index.View.filter.projectTags.title", "Project Tags" ) - , ( "Wizard.Projects.Index.View.filter.packages.empty", "No knowledge models found" ) - , ( "Wizard.Projects.Index.View.filter.packages.searchPlaceholder", "Search knowledge models..." ) - , ( "Wizard.Projects.Index.View.filter.packages.title", "Knowledge Models" ) - , ( "Wizard.Projects.Index.View.filter.template.name", "Project Template" ) - , ( "Wizard.Projects.Index.View.filter.template.projectsOnly", "Projects only" ) - , ( "Wizard.Projects.Index.View.filter.template.templatesOnly", "Templates only" ) - , ( "Wizard.Projects.Index.View.filter.users.empty", "No users found" ) - , ( "Wizard.Projects.Index.View.filter.users.searchPlaceholder", "Search users..." ) - , ( "Wizard.Projects.Index.View.filter.users.title", "Users" ) - , ( "Wizard.Projects.Index.View.header.title", "Projects" ) - , ( "Wizard.Projects.Index.View.header.create", "Create" ) - , ( "Wizard.Projects.Index.View.listing.empty", "Click \"Create\" button to add a new Questionnaire." ) - , ( "Wizard.Projects.Index.View.listing.searchPlaceholderText", "Search projects..." ) - , ( "Wizard.Projects.Migration.View.change.questionAdd", "New Question" ) - , ( "Wizard.Projects.Migration.View.change.questionChange", "Question Changed" ) - , ( "Wizard.Projects.Migration.View.change.questionMove", "Moved Question" ) - , ( "Wizard.Projects.Migration.View.change.resolved", "Resolved" ) - , ( "Wizard.Projects.Migration.View.changeView.undo", "Undo" ) - , ( "Wizard.Projects.Migration.View.changeView.resolve", "Resolve" ) - , ( "Wizard.Projects.Migration.View.changeView.resolveAll", "Resolve all" ) - , ( "Wizard.Projects.Migration.View.changeView.resolved", "Change already resolved" ) - , ( "Wizard.Projects.Migration.View.changeView.resolvedChanges", "Resolved changes %s/%s" ) - , ( "Wizard.Projects.Migration.View.navbar.finalize", "Finalize migration" ) - , ( "Wizard.Projects.Migration.View.navbar.sourceKM", "Source KM" ) - , ( "Wizard.Projects.Migration.View.navbar.targetKM", "Target KM" ) - , ( "Wizard.Projects.Migration.View.noChanges.heading", "No changes to review" ) - , ( "Wizard.Projects.Migration.View.noChanges.line1", "There are no changes affecting your answers." ) - , ( "Wizard.Projects.Migration.View.noChanges.line2", "You can safely finalize the migration." ) - , ( "Wizard.Public.BookReference.View.bookName", "Data Stewardship for Open Science" ) - , ( "Wizard.Public.BookReference.View.bookChapter", "Chapter" ) - , ( "Wizard.Public.BookReference.View.permission", "With kind permission of" ) - , ( "Wizard.Public.ForgottenPassword.View.recoveryLinkSent", "We've sent you a recover link. Follow the instructions in your email." ) - , ( "Wizard.Public.ForgottenPassword.View.form.email.description", "Enter the email you use to log in and we will send you a recover link." ) - , ( "Wizard.Public.ForgottenPassword.View.form.title", "Forgotten Password" ) - , ( "Wizard.Public.ForgottenPassword.View.form.submit", "Recover" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.form.title", "Password Recovery" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.form.submit", "Save" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.form.text", "Enter a new password you want to use to log in." ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.form.password", "New password" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.form.passwordConfirmation", "New password again" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.success.logIn", "log in" ) - , ( "Wizard.Public.ForgottenPasswordConfirmation.View.success.message", "Your password has been changed. You can now %s." ) - , ( "Wizard.Public.Login.View.connectWith", "Or connect with" ) - , ( "Wizard.Public.Login.View.form.title", "Log In" ) - , ( "Wizard.Public.Login.View.form.submit", "Log In" ) - , ( "Wizard.Public.Login.View.form.link", "Forgot your password?" ) - , ( "Wizard.Public.Signup.View.success", "Sign up was successful. Check your email for the activation link." ) - , ( "Wizard.Public.Signup.View.form.title", "Sign Up" ) - , ( "Wizard.Public.Signup.View.form.submit", "Sign Up" ) - , ( "Wizard.Public.Signup.View.form.link", "I already have an account" ) - , ( "Wizard.Public.Signup.View.form.privacyText", "I have read %s." ) - , ( "Wizard.Public.Signup.View.form.privacyTextBoth", "I have read %s and %s." ) - , ( "Wizard.Public.Signup.View.form.privacy", "Privacy" ) - , ( "Wizard.Public.Signup.View.form.privacyErrorBoth", "You have to read Privacy and Terms of Service first" ) - , ( "Wizard.Public.Signup.View.form.privacyErrorPrivacy", "You have to read Privacy first" ) - , ( "Wizard.Public.Signup.View.form.privacyErrorTerms", "You have to read Terms of Service first" ) - , ( "Wizard.Public.Signup.View.form.termsOfService", "Terms of Service" ) - , ( "Wizard.Public.SignupConfirmation.View.confirmation", "Your email was successfully confirmed. You can now %s." ) - , ( "Wizard.Public.SignupConfirmation.View.logIn", "log in" ) - , ( "Wizard.Registry.RegistrySignupConfirmation.View.confirmation", "Your email was successfuly confirmed, you can go back to %s." ) - , ( "Wizard.Registry.RegistrySignupConfirmation.View.settings", "Settings" ) - , ( "Wizard.Settings.Authentication.View.form.defaultRole", "Default role" ) - , ( "Wizard.Settings.Authentication.View.form.defaultRole.desc", "Define the role that is assigned to new users." ) - , ( "Wizard.Settings.Authentication.View.form.registration", "Registration" ) - , ( "Wizard.Settings.Authentication.View.form.registration.desc", "If enabled, users can create new internal accounts directly in the instance." ) - , ( "Wizard.Settings.Authentication.View.form.service.background", "Background" ) - , ( "Wizard.Settings.Authentication.View.form.service.buttonPreview", "Button Preview" ) - , ( "Wizard.Settings.Authentication.View.form.service.callbackUrl", "Callback URL" ) - , ( "Wizard.Settings.Authentication.View.form.service.clientId", "Client ID" ) - , ( "Wizard.Settings.Authentication.View.form.service.clientSecret", "Client Secret" ) - , ( "Wizard.Settings.Authentication.View.form.service.color", "Color" ) - , ( "Wizard.Settings.Authentication.View.form.service.icon", "Icon" ) - , ( "Wizard.Settings.Authentication.View.form.service.id", "ID" ) - , ( "Wizard.Settings.Authentication.View.form.service.name", "Name" ) - , ( "Wizard.Settings.Authentication.View.form.service.parameter.name", "Name" ) - , ( "Wizard.Settings.Authentication.View.form.service.parameter.value", "Value" ) - , ( "Wizard.Settings.Authentication.View.form.service.parameters", "Parameters" ) - , ( "Wizard.Settings.Authentication.View.form.service.remove", "Remove" ) - , ( "Wizard.Settings.Authentication.View.form.service.url", "URL" ) - , ( "Wizard.Settings.Authentication.View.form.services", "OpenID Services" ) - , ( "Wizard.Settings.Authentication.View.save", "Save" ) - , ( "Wizard.Settings.Authentication.View.section.internal", "Internal" ) - , ( "Wizard.Settings.Authentication.View.section.external", "External" ) - , ( "Wizard.Settings.Authentication.View.title", "Authentication" ) - , ( "Wizard.Settings.Dashboard.View.dashboardOptions.roleBased", "Role-Based" ) - , ( "Wizard.Settings.Dashboard.View.dashboardOptions.roleBased.desc", "Relevant content based on user's role." ) - , ( "Wizard.Settings.Dashboard.View.dashboardOptions.welcome", "Welcome" ) - , ( "Wizard.Settings.Dashboard.View.dashboardOptions.welcome.desc", "Standard welcome screen." ) - , ( "Wizard.Settings.Dashboard.View.form.dashboardStyle", "Dashboard Style" ) - , ( "Wizard.Settings.Dashboard.View.form.welcomeInfo", "Welcome Info" ) - , ( "Wizard.Settings.Dashboard.View.form.welcomeInfo.desc", "Welcome info is visible at the dashboard after login as a blue box." ) - , ( "Wizard.Settings.Dashboard.View.form.welcomeWarning", "Welcome Warning" ) - , ( "Wizard.Settings.Dashboard.View.form.welcomeWarning.desc", "Welcome warning is visible at the dashboard after login as a yellow box." ) - , ( "Wizard.Settings.Dashboard.View.save", "Save" ) - , ( "Wizard.Settings.Dashboard.View.title", "Dashboard" ) - , ( "Wizard.Settings.Registry.View.form.enabled", "Enabled" ) - , ( "Wizard.Settings.Registry.View.form.enabled.desc", "If enabled, you can import Knowledge Models and Document Templates directly from [DSW Registry](https://registry.ds-wizard.org)." ) - , ( "Wizard.Settings.Registry.View.form.token", "Token" ) - , ( "Wizard.Settings.Registry.View.form.token.desc", "Fill in your DSW Registry token. If you don't have one, you need sign up first." ) - , ( "Wizard.Settings.Registry.View.form.signUp", "Sign Up" ) - , ( "Wizard.Settings.Registry.View.registryModal.button.cancel", "Cancel" ) - , ( "Wizard.Settings.Registry.View.registryModal.button.done", "Done" ) - , ( "Wizard.Settings.Registry.View.registryModal.button.signUp", "Sign Up" ) - , ( "Wizard.Settings.Registry.View.registryModal.form.email", "Email" ) - , ( "Wizard.Settings.Registry.View.registryModal.form.email.desc", "The email will be used for a confirmation link and an eventual token recovery." ) - , ( "Wizard.Settings.Registry.View.registryModal.form.organizationDescription", "Organization Description" ) - , ( "Wizard.Settings.Registry.View.registryModal.form.organizationId", "Organization ID" ) - , ( "Wizard.Settings.Registry.View.registryModal.form.organizationName", "Organization Name" ) - , ( "Wizard.Settings.Registry.View.registryModal.title", "Registry Sign Up" ) - , ( "Wizard.Settings.Registry.View.save", "Save" ) - , ( "Wizard.Settings.Registry.View.title", "DSW Registry" ) - , ( "Wizard.Settings.KnowledgeModels.View.title", "Knowledge Models" ) - , ( "Wizard.Settings.KnowledgeModels.View.save", "Save" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.allowedPackages", "Allowed Packages" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.allowedPackages.orgId", "Organization ID" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.allowedPackages.kmId", "Knowledge Model ID" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.allowedPackages.minVersion", "Min Version" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.allowedPackages.maxVersion", "Max Version" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.integrationConfig", "Integration Config" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.public", "Public Knowledge Models" ) - , ( "Wizard.Settings.KnowledgeModels.View.form.public.desc", "If enabled you can define knowledge models that are publicly available for reading." ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.save", "Save" ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.cancel", "Cancel" ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.title", "Change logo" ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.chooseLogo", "Choose logo" ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.dropHere", "Or just drop it here" ) - , ( "Wizard.Settings.LookAndFeel.LogoUploadModal.useDefault", "Use default logo" ) - , ( "Wizard.Settings.LookAndFeel.View.form.appTitle", "Application Title" ) - , ( "Wizard.Settings.LookAndFeel.View.form.appTitle.desc", "Full name of the DSW instance (displayed, for example, in the browser tab title or before login)." ) - , ( "Wizard.Settings.LookAndFeel.View.form.appTitleShort", "Short Application Title" ) - , ( "Wizard.Settings.LookAndFeel.View.form.appTitleShort.desc", "Short name of the DSW instance (displayed, for example, on top of the navigation bar). Short title can be the same as the application title if it is short enough." ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks", "Custom Menu Links" ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks.desc", "Configure additional links in the menu. Choose any free icon from the [Font Awesome](https://fontawesome.com/icons?d=gallery&m=free), e.g. *fas fa-magic*. Check *New window* if you want to open the link in a new window." ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks.icon", "Icon" ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks.newWindow", "New window" ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks.title", "Title" ) - , ( "Wizard.Settings.LookAndFeel.View.form.customMenuLinks.url", "URL" ) - , ( "Wizard.Settings.LookAndFeel.View.form.loginInfo", "Login Info" ) - , ( "Wizard.Settings.LookAndFeel.View.form.loginInfo.desc", "Additional information displayed at the login screen." ) - , ( "Wizard.Settings.LookAndFeel.View.save", "Save" ) - , ( "Wizard.Settings.LookAndFeel.View.title", "Look & Feel" ) - , ( "Wizard.Settings.Organization.View.form.affiliations", "Affiliations" ) - , ( "Wizard.Settings.Organization.View.form.affiliations.desc", "Affiliation options will be used to help users choose their affiliation while signing up or editing their profile. Write one affiliation option per line." ) - , ( "Wizard.Settings.Organization.View.form.description", "Description" ) - , ( "Wizard.Settings.Organization.View.form.name", "Name" ) - , ( "Wizard.Settings.Organization.View.form.name.desc", "Name of the organization running this instance." ) - , ( "Wizard.Settings.Organization.View.form.organizationId", "Organization ID" ) - , ( "Wizard.Settings.Organization.View.form.organizationId.desc", "Organization ID is used to identify Knowledge Models created in this instance. It can contain alphanumeric characters and dots but cannot start or end with a dot." ) - , ( "Wizard.Settings.Organization.View.save", "Save" ) - , ( "Wizard.Settings.Organization.View.title", "Organization" ) - , ( "Wizard.Settings.Plans.View.title", "Plans" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.privacyUrl", "Privacy URL" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.privacyUrl.desc", "URL to page with the privacy policy of the service." ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.termsOfServiceUrl", "Terms of Service URL" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.termsOfServiceUrl.desc", "URL to page with the terms of the service." ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportEmail", "Support Email" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportEmail.desc", "Support email displayed in the help modal." ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportRepositoryName", "Support Repository Name" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportRepositoryName.desc", "Name of the repository where users can report issues related to the service." ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportRepositoryUrl", "Support Repository URL" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.form.supportRepositoryUrl.desc", "URL of the repository where users can report issues related to the service." ) - , ( "Wizard.Settings.PrivacyAndSupport.View.title", "Privacy & Support" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.save", "Save" ) - , ( "Wizard.Settings.PrivacyAndSupport.View.section.support", "Support" ) - , ( "Wizard.Settings.Projects.View.form.feedback", "Feedback" ) - , ( "Wizard.Settings.Projects.View.form.feedback.desc", "If enabled, users can submit a feedback to questions to the specified GitHub repository." ) - , ( "Wizard.Settings.Projects.View.form.feedbackOwner", "GitHub Repository Owner" ) - , ( "Wizard.Settings.Projects.View.form.feedbackOwner.desc", "ht​tps://github.com/**exampleOwner**/exampleRepository" ) - , ( "Wizard.Settings.Projects.View.form.feedbackRepo", "GitHub Repository Name" ) - , ( "Wizard.Settings.Projects.View.form.feedbackRepo.desc", "ht​tps://github.com/exampleOwner/**exampleRepository**" ) - , ( "Wizard.Settings.Projects.View.form.feedbackToken", "Access Token" ) - , ( "Wizard.Settings.Projects.View.form.feedbackToken.desc", "[Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) for GitHub account creating the issues. Make sure to select **public_repo** scope if the repository is public or **repo** if it is private. We recommend creating a bot account with the access to the feedback repository instead of using your own GitHub account." ) - , ( "Wizard.Settings.Projects.View.form.projectTaggingEnabled", "Project Tagging" ) - , ( "Wizard.Settings.Projects.View.form.projectTaggingEnabled.desc", "If enabled, users can tag their projects and use these tags to filter them." ) - , ( "Wizard.Settings.Projects.View.form.projectTaggingTags", "Default Project Tags" ) - , ( "Wizard.Settings.Projects.View.form.projectTaggingTags.desc", "Default projects tags can be provided to users so they don't have to come up with them on their own. Write one tag per line." ) - , ( "Wizard.Settings.Projects.View.form.questionnaireCreation", "Project Creation" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharing", "Project Sharing" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharing.desc", "If enabled, users can choose if project can be shared with people outside of DSW or not. Otherwise, all projects use the *Default Project Sharing*." ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharingAnonymous", "Anonymous Projects" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharingAnonymous.desc", "If enabled, users that are not logged in are allowed to create projects from public knowledge models." ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharingDefaultValue", "Default Project Sharing" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireSharingDefaultValue.desc", "If *Project Sharing* is enabled, this value is pre-selected when creating a new project. If *Project Sharing* is disabled, this value is used implicitly for new projects." ) - , ( "Wizard.Settings.Projects.View.form.questionnaireVisibility", "Project Visibility" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireVisibility.desc", "If enabled, project visibility can be set for each project. Otherwise, all projects use the *Default Project Visibility*." ) - , ( "Wizard.Settings.Projects.View.form.questionnaireVisibilityDefaultValue", "Default Project Visibility" ) - , ( "Wizard.Settings.Projects.View.form.questionnaireVisibilityDefaultValue.desc", "If *Project Visibility* is enabled, this value is pre-selected when creating a new project. If *Project Visibility* is disabled, this value is used implicitly for new projects." ) - , ( "Wizard.Settings.Projects.View.form.summaryReport", "Summary Report" ) - , ( "Wizard.Settings.Projects.View.form.summaryReport.desc", "If enabled, users can view a summary report showing various metrics for the Questionnaire." ) - , ( "Wizard.Settings.Projects.View.title", "Projects" ) - , ( "Wizard.Settings.Projects.View.save", "Save" ) - , ( "Wizard.Settings.Submission.View.form.enabled", "Enabled" ) - , ( "Wizard.Settings.Submission.View.form.enabled.desc", "If enabled, you can configure external services for uploading documents from the instance." ) - , ( "Wizard.Settings.Submission.View.form.description", "Description" ) - , ( "Wizard.Settings.Submission.View.form.format", "Format" ) - , ( "Wizard.Settings.Submission.View.form.headers", "Headers" ) - , ( "Wizard.Settings.Submission.View.form.header", "Header" ) - , ( "Wizard.Settings.Submission.View.form.id", "ID" ) - , ( "Wizard.Settings.Submission.View.form.name", "Name" ) - , ( "Wizard.Settings.Submission.View.form.request", "Request" ) - , ( "Wizard.Settings.Submission.View.form.supportedFormats", "Supported Formats" ) - , ( "Wizard.Settings.Submission.View.form.supportedFormats.desc", "Select document templates and formats that can be submitted using this submission service." ) - , ( "Wizard.Settings.Submission.View.form.method", "Method" ) - , ( "Wizard.Settings.Submission.View.form.multipart", "Multipart" ) - , ( "Wizard.Settings.Submission.View.form.multipart.desc", "If enabled, file will be sent using multipart request. Otherwise, it will be directly in the request body." ) - , ( "Wizard.Settings.Submission.View.form.multipartFileName", "Multipart File Name" ) - , ( "Wizard.Settings.Submission.View.form.props", "User Properties" ) - , ( "Wizard.Settings.Submission.View.form.props.desc", "You can create properties that can be set by each user in their profile. Then, you can use these properties in the request settings. For example, if you want each user to use their own authorization token, you can create a property called `Token` and use it in request headers as `${Token}`. Users will be able to set the token in their profile settings." ) - , ( "Wizard.Settings.Submission.View.form.service.remove", "Remove" ) - , ( "Wizard.Settings.Submission.View.form.services", "Services" ) - , ( "Wizard.Settings.Submission.View.form.template", "Document Template" ) - , ( "Wizard.Settings.Submission.View.form.url", "URL" ) - , ( "Wizard.Settings.Submission.View.form.value", "Value" ) - , ( "Wizard.Settings.Submission.View.title", "Document Submission" ) - , ( "Wizard.Settings.Submission.View.save", "Save" ) - , ( "Wizard.Settings.Template.View.form.recommendedTemplateId", "Recommended Template" ) - , ( "Wizard.Settings.Template.View.title", "Document Templates" ) - , ( "Wizard.Settings.Template.View.save", "Save" ) - , ( "Wizard.Settings.Usage.View.title", "Usage" ) - , ( "Wizard.Settings.View.navigation.authentication", "Authentication" ) - , ( "Wizard.Settings.View.navigation.dashboard", "Dashboard" ) - , ( "Wizard.Settings.View.navigation.registry", "DSW Registry" ) - , ( "Wizard.Settings.View.navigation.knowledgeModels", "Knowledge Models" ) - , ( "Wizard.Settings.View.navigation.lookAndFeel", "Look & Feel" ) - , ( "Wizard.Settings.View.navigation.organization", "Organization" ) - , ( "Wizard.Settings.View.navigation.plans", "Plans" ) - , ( "Wizard.Settings.View.navigation.privacyAndSupport", "Privacy & Support" ) - , ( "Wizard.Settings.View.navigation.projects", "Projects" ) - , ( "Wizard.Settings.View.navigation.submission", "Document Submission" ) - , ( "Wizard.Settings.View.navigation.template", "Document Templates" ) - , ( "Wizard.Settings.View.navigation.usage", "Usage" ) - , ( "Wizard.Settings.View.navigation.title.content", "Content Settings" ) - , ( "Wizard.Settings.View.navigation.title.info", "Info" ) - , ( "Wizard.Settings.View.navigation.title.system", "System Settings" ) - , ( "Wizard.Settings.View.navigation.title.userInterface", "User Interface Settings" ) - , ( "Wizard.Templates.Detail.View.header.export", "Export" ) - , ( "Wizard.Templates.Detail.View.header.delete", "Delete" ) - , ( "Wizard.Templates.Detail.View.readme.versionWarning", "This is not the latest available version of this document template." ) - , ( "Wizard.Templates.Detail.View.readme.unsupportedMetamodelVersion", "This document template is not supported in this version of DSW." ) - , ( "Wizard.Templates.Detail.View.registryLinkLabel", "View in registry" ) - , ( "Wizard.Templates.Detail.View.registryVersion.warning", "There is a newer version (%s) available." ) - , ( "Wizard.Templates.Detail.View.registryVersion.warning.import", "Import" ) - , ( "Wizard.Templates.Detail.View.deleteModal.message", "Are you sure you want to permanently delete %s?" ) - , ( "Wizard.Templates.Detail.View.deleteModal.title", "Delete version" ) - , ( "Wizard.Templates.Detail.View.deleteModal.action", "Delete" ) - , ( "Wizard.Templates.Import.FileImport.View.fileView.cancel", "Cancel" ) - , ( "Wizard.Templates.Import.FileImport.View.fileView.upload", "Upload" ) - , ( "Wizard.Templates.Import.FileImport.View.dropzone.choose", "Choose a file" ) - , ( "Wizard.Templates.Import.FileImport.View.dropzone.drop", "Or just drop it here" ) - , ( "Wizard.Templates.Import.RegistryImport.View.form.import", "Import" ) - , ( "Wizard.Templates.Import.RegistryImport.View.registryLink", "You can find document templates in %s." ) - , ( "Wizard.Templates.Import.RegistryImport.View.registry", "DSW Registry" ) - , ( "Wizard.Templates.Import.RegistryImport.View.imported.message", "Template %s has been imported!" ) - , ( "Wizard.Templates.Import.RegistryImport.View.imported.action", "View detail" ) - , ( "Wizard.Templates.Import.View.header", "Import Document Template" ) - , ( "Wizard.Templates.Import.View.navbar.fromRegistry", "From DSW Registry" ) - , ( "Wizard.Templates.Import.View.navbar.fromFile", "From file" ) - , ( "Wizard.Templates.Index.View.header.title", "Document Templates" ) - , ( "Wizard.Templates.Index.View.header.import", "Import" ) - , ( "Wizard.Templates.Index.View.listing.empty", "Click \"Import\" button to import a new document template." ) - , ( "Wizard.Templates.Index.View.listing.searchPlaceholderText", "Search..." ) - , ( "Wizard.Templates.Index.View.badge.outdated", "update available" ) - , ( "Wizard.Templates.Index.View.badge.unsupported", "unsupported metamodel" ) - , ( "Wizard.Templates.Index.View.action.viewDetail", "View detail" ) - , ( "Wizard.Templates.Index.View.action.export", "Export" ) - , ( "Wizard.Templates.Index.View.action.delete", "Delete" ) - , ( "Wizard.Templates.Index.View.deleteModal.message", "Are you sure you want to permanently delete %s and all its versions?" ) - , ( "Wizard.Templates.Index.View.deleteModal.title", "Delete document template" ) - , ( "Wizard.Templates.Index.View.deleteModal.action", "Delete" ) - , ( "Wizard.Users.Create.View.header.title", "Create user" ) - , ( "Wizard.Users.Create.View.header.save", "Save" ) - , ( "Wizard.Users.Edit.View.navbar.profile", "Profile" ) - , ( "Wizard.Users.Edit.View.navbar.password", "Password" ) - , ( "Wizard.Users.Edit.View.userView.userImage", "User Image" ) - , ( "Wizard.Users.Edit.View.userView.userImage.desc", "Image is taken from OpenID profile or [Gravatar](https://gravatar.com)." ) - , ( "Wizard.Users.Edit.View.userView.save", "Save" ) - , ( "Wizard.Users.Edit.View.passwordView.save", "Save" ) - , ( "Wizard.Users.Edit.View.passwordForm.password", "New password" ) - , ( "Wizard.Users.Edit.View.passwordForm.passwordConfirmation", "New password again" ) - , ( "Wizard.Users.Edit.View.submissionSettings.title", "Submission Settings" ) - , ( "Wizard.Users.Edit.View.submissionSettings.empty", "There is no settings for %s." ) - , ( "Wizard.Users.Index.View.header.create", "Create" ) - , ( "Wizard.Users.Index.View.listing.empty", "Click \"Create\" button to add a new User." ) - , ( "Wizard.Users.Index.View.listing.searchPlaceholderText", "Search users..." ) - , ( "Wizard.Users.Index.View.badge.inactive", "inactive" ) - , ( "Wizard.Users.Index.View.action.edit", "Edit" ) - , ( "Wizard.Users.Index.View.action.delete", "Delete" ) - , ( "Wizard.Users.Index.View.deleteModal.message", "Are you sure you want to permanently delete the following user?" ) - , ( "Wizard.Users.Index.View.deleteModal.title", "Delete user" ) - , ( "Wizard.Users.Index.View.deleteModal.action", "Delete" ) - , ( "Wizard.View.notFound.title", "Not Found" ) - , ( "Wizard.View.notFound.message", "The page you are looking for was not found." ) - , ( "Wizard.View.notAllowed.title", "Not Allowed" ) - , ( "Wizard.View.notAllowed.message", "You don't have a permission to view this page." ) - ] - ) + [ -- Routing + ( "__routing.dashboard", "dashboard" ) + , ( "__routing.documents", "documents" ) + , ( "__routing.documents.index.questionnaireUuid", "questionnaireUuid" ) + , ( "__routing.kmEditor", "km-editor" ) + , ( "__routing.kmEditor.create", "create" ) + , ( "__routing.kmEditor.create.selected", "selected" ) + , ( "__routing.kmEditor.create.edit", "edit" ) + , ( "__routing.kmEditor.editor", "editor" ) + , ( "__routing.kmEditor.migration", "migration" ) + , ( "__routing.kmEditor.publish", "publish" ) + , ( "__routing.knowledgeModels", "knowledge-models" ) + , ( "__routing.knowledgeModels.import", "import" ) + , ( "__routing.knowledgeModels.import.packageId", "packageId" ) + , ( "__routing.knowledgeModels.preview", "preview" ) + , ( "__routing.knowledgeModels.preview.questionUuid", "questionUuid" ) + , ( "__routing.login.originalUrl", "originalUrl" ) + , ( "__routing.projectImporters", "project-importers" ) + , ( "__routing.projects", "projects" ) + , ( "__routing.projects.create", "create" ) + , ( "__routing.projects.create.custom", "custom" ) + , ( "__routing.projects.create.selected", "selected" ) + , ( "__routing.projects.create.template", "from-template" ) + , ( "__routing.projects.createMigration", "create-migration" ) + , ( "__routing.projects.migration", "migration" ) + , ( "__routing.projects.migration", "migration" ) + , ( "__routing.public.bookReferences", "book-references" ) + , ( "__routing.public.forgottenPassword", "forgotten-password" ) + , ( "__routing.public.signup", "signup" ) + , ( "__routing.registry", "registry" ) + , ( "__routing.registry.signupConfirmation", "signup" ) + , ( "__routing.settings", "settings" ) + , ( "__routing.settings.authentication", "authentication" ) + , ( "__routing.settings.dashboard", "dashboard" ) + , ( "__routing.settings.registry", "registry" ) + , ( "__routing.settings.knowledgeModel", "knowledge-models" ) + , ( "__routing.settings.lookAndFeel", "look-and-feel" ) + , ( "__routing.settings.organization", "organization" ) + , ( "__routing.settings.plans", "plans" ) + , ( "__routing.settings.privacyAndSupport", "privacy-and-support" ) + , ( "__routing.settings.projects", "projects" ) + , ( "__routing.settings.submission", "submission" ) + , ( "__routing.settings.template", "template" ) + , ( "__routing.settings.usage", "usage" ) + , ( "__routing.templates", "document-templates" ) + , ( "__routing.templates.import", "import" ) + , ( "__routing.templates.import.templateId", "templateId" ) + ] diff --git a/engine-wizard/elm/Wizard/Common/TimeDistance.elm b/engine-wizard/elm/Wizard/Common/TimeDistance.elm index ebded1e47..7fa9434a1 100644 --- a/engine-wizard/elm/Wizard/Common/TimeDistance.elm +++ b/engine-wizard/elm/Wizard/Common/TimeDistance.elm @@ -1,20 +1,11 @@ module Wizard.Common.TimeDistance exposing (locale) -import Shared.Locale exposing (l, lf) +import Gettext exposing (gettext, ngettext) +import String.Format as String import Time.Distance.Types exposing (DistanceId(..), Locale, Tense(..)) import Wizard.Common.AppState exposing (AppState) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.TimeDistance" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Common.TimeDistance" - - locale : AppState -> Locale locale appState { withAffix } tense distanceId = let @@ -24,83 +15,50 @@ locale appState { withAffix } tense distanceId = maybeAffix str = case ( withAffix, tense ) of ( True, Past ) -> - lf_ "ago" [ str ] appState + String.format (gettext "%s ago" appState.locale) [ str ] ( True, Future ) -> - lf_ "in" [ str ] appState + String.format (gettext "in %s" appState.locale) [ str ] ( False, _ ) -> str + + lessThanMinutes n = + String.format (ngettext ( "less than a minute", "less than %s minutes" ) n appState.locale) [ toStr n ] in (case distanceId of -- We don't need that much granularity here LessThanXSeconds _ -> - l_ "lessThan1Minute" appState + lessThanMinutes 1 HalfAMinute -> - l_ "lessThan1Minute" appState + lessThanMinutes 1 LessThanXMinutes i -> - if i == 1 then - l_ "lessThan1Minute" appState - - else - lf_ "lessThanXMinute" [ toStr i ] appState - - XMinutes i -> - if i == 1 then - l_ "1Minute" appState - - else - lf_ "xMinutes" [ toStr i ] appState - - AboutXHours i -> - if i == 1 then - l_ "about1Hour" appState - - else - lf_ "aboutXHours" [ toStr i ] appState - - XDays i -> - if i == 1 then - l_ "1Day" appState - - else - lf_ "XDays" [ toStr i ] appState - - AboutXMonths i -> - if i == 1 then - l_ "about1Month" appState - - else - lf_ "aboutXMonths" [ toStr i ] appState + lessThanMinutes i - XMonths i -> - if i == 1 then - l_ "1Month" appState + XMinutes n -> + String.format (ngettext ( "1 minute", "%s minutes" ) n appState.locale) [ toStr n ] - else - lf_ "XMonths" [ toStr i ] appState + AboutXHours n -> + String.format (ngettext ( "about 1 hour", "about %s hours" ) n appState.locale) [ toStr n ] - AboutXYears i -> - if i == 1 then - l_ "about1Year" appState + XDays n -> + String.format (ngettext ( "1 day", "%s days" ) n appState.locale) [ toStr n ] - else - lf_ "aboutXYears" [ toStr i ] appState + AboutXMonths n -> + String.format (ngettext ( "about 1 month", "about %s months" ) n appState.locale) [ toStr n ] - OverXYears i -> - if i == 1 then - l_ "over1Year" appState + XMonths n -> + String.format (ngettext ( "1 month", "%s months" ) n appState.locale) [ toStr n ] - else - lf_ "overXYears" [ toStr i ] appState + AboutXYears n -> + String.format (ngettext ( "about 1 year", "about %s years" ) n appState.locale) [ toStr n ] - AlmostXYears i -> - if i == 1 then - l_ "almost1Year" appState + OverXYears n -> + String.format (ngettext ( "over 1 year", "over %s years" ) n appState.locale) [ toStr n ] - else - lf_ "almostXYears" [ toStr i ] appState + AlmostXYears n -> + String.format (ngettext ( "almost 1 year", "almost %s years" ) n appState.locale) [ toStr n ] ) |> maybeAffix diff --git a/engine-wizard/elm/Wizard/Common/View/Flash.elm b/engine-wizard/elm/Wizard/Common/View/Flash.elm index 071ee8b8d..b65a4bbd7 100644 --- a/engine-wizard/elm/Wizard/Common/View/Flash.elm +++ b/engine-wizard/elm/Wizard/Common/View/Flash.elm @@ -6,19 +6,14 @@ module Wizard.Common.View.Flash exposing , warning ) +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Attributes exposing (class) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.View.Flash" - - error : AppState -> String -> Html msg error appState = flashView "alert-danger" <| faSet "_global.error" appState @@ -43,7 +38,7 @@ loader : AppState -> Html msg loader appState = flashView "alert-inline-loader" (faSet "_global.spinner" appState) - (l_ "loader.loading" appState) + (gettext "Loading..." appState.locale) flashView : String -> Html msg -> String -> Html msg diff --git a/engine-wizard/elm/Wizard/Common/View/FormActions.elm b/engine-wizard/elm/Wizard/Common/View/FormActions.elm index da6f1f464..898563ce7 100644 --- a/engine-wizard/elm/Wizard/Common/View/FormActions.elm +++ b/engine-wizard/elm/Wizard/Common/View/FormActions.elm @@ -5,20 +5,15 @@ module Wizard.Common.View.FormActions exposing , viewSubmit ) -import Html exposing (Html, div) +import Gettext exposing (gettext) +import Html exposing (Html, div, text) import Html.Attributes exposing (class) -import Shared.Locale exposing (lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.View.ActionButton as ActionButton import Wizard.Routes as Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.FormActions" - - {-| Helper to show action buttons below the form. - Cancel button simply redirects to another route @@ -28,7 +23,7 @@ lx_ = view : AppState -> Routes.Route -> ActionButton.ButtonConfig a msg -> Html msg view appState cancelRoute actionButtonConfig = div [ class "form-actions" ] - [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ lx_ "cancelButton.cancel" appState ] + [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ text (gettext "Cancel" appState.locale) ] , ActionButton.button appState actionButtonConfig ] @@ -36,7 +31,7 @@ view appState cancelRoute actionButtonConfig = viewCustomButton : AppState -> Routes.Route -> Html msg -> Html msg viewCustomButton appState cancelRoute actionButton = div [ class "form-actions" ] - [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ lx_ "cancelButton.cancel" appState ] + [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ text (gettext "Cancel" appState.locale) ] , actionButton ] @@ -44,7 +39,7 @@ viewCustomButton appState cancelRoute actionButton = viewSubmit : AppState -> Routes.Route -> ActionButton.SubmitConfig a -> Html msg viewSubmit appState cancelRoute submitConfig = div [ class "form-actions" ] - [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ lx_ "cancelButton.cancel" appState ] + [ linkTo appState cancelRoute [ class "btn btn-secondary" ] [ text (gettext "Cancel" appState.locale) ] , ActionButton.submit appState submitConfig ] diff --git a/engine-wizard/elm/Wizard/Common/View/FormGroup.elm b/engine-wizard/elm/Wizard/Common/View/FormGroup.elm index 6704232cb..8e7b7ca96 100644 --- a/engine-wizard/elm/Wizard/Common/View/FormGroup.elm +++ b/engine-wizard/elm/Wizard/Common/View/FormGroup.elm @@ -29,6 +29,7 @@ module Wizard.Common.View.FormGroup exposing import Form exposing (Form, Msg(..)) import Form.Field as Field import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, button, code, div, label, li, p, span, text, ul) import Html.Attributes exposing (autocomplete, checked, class, classList, disabled, for, id, name, rows, type_, value) import Html.Events exposing (onCheck, onClick, onMouseDown) @@ -37,7 +38,6 @@ import Shared.Data.Template.TemplateFormat exposing (TemplateFormat) import Shared.Form exposing (errorToString) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, fa) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown import Uuid import Wizard.Common.AppState exposing (AppState) @@ -46,20 +46,10 @@ import Wizard.Common.Html.Attribute exposing (dataCy, grammarlyAttributes) import Wizard.Common.View.Flash as Flash -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.View.FormGroup" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.FormGroup" - - optionalWrapper : AppState -> Html Form.Msg -> Html Form.Msg optionalWrapper appState content = div [ class "form-group form-group-optional-wrapper" ] - [ span [ class "optional-label" ] [ lx_ "optional" appState ] + [ span [ class "optional-label" ] [ text (gettext "(optional)" appState.locale) ] , content ] @@ -217,7 +207,7 @@ formatRadioGroup appState options = pdfOnlyInfo = if appState.config.feature.pdfOnlyEnabled then - Flash.info appState (l_ "formatRadioGroup.pdfOnly" appState) + Flash.info appState (gettext "Only PDF documents are enabled in this instance." appState.locale) else emptyNode @@ -318,7 +308,7 @@ list appState itemView form fieldName labelText = , onClick (Form.Append fieldName) , dataCy "form-group_list_add-button" ] - [ lx_ "list.add" appState ] + [ text (gettext "Add" appState.locale) ] ] @@ -340,7 +330,7 @@ listWithCustomMsg appState wrapMsg itemView form fieldName labelText = , onClick (wrapMsg <| Form.Append fieldName) , dataCy "form-group_list_add-button" ] - [ lx_ "list.add" appState ] + [ text (gettext "Add" appState.locale) ] ] @@ -363,7 +353,7 @@ listWithHeader appState header itemView form fieldName labelText = , onClick (Form.Append fieldName) , dataCy "form-group_list_add-button" ] - [ lx_ "list.add" appState ] + [ text (gettext "Add" appState.locale) ] ] @@ -446,7 +436,7 @@ markdownEditor appState form fieldName labelText = , class "nav-link" , classList [ ( "active", not previewActive ) ] ] - [ lx_ "markdownEditor.editor" appState ] + [ text (gettext "Editor" appState.locale) ] ] , li [ class "nav-item" ] [ a @@ -454,7 +444,7 @@ markdownEditor appState form fieldName labelText = , class "nav-link" , classList [ ( "active", previewActive ) ] ] - [ lx_ "markdownEditor.preview" appState ] + [ text (gettext "Preview" appState.locale) ] ] ] ] @@ -462,7 +452,7 @@ markdownEditor appState form fieldName labelText = [ content ] , div [ class "card-footer text-muted" ] - [ lx_ "markdownEditor.markdownDescription" appState ] + [ text (gettext "You can use markdown and see the result in the preview tab." appState.locale) ] ] , error ] diff --git a/engine-wizard/elm/Wizard/Common/View/Layout.elm b/engine-wizard/elm/Wizard/Common/View/Layout.elm index 41b703af0..e70a06df4 100644 --- a/engine-wizard/elm/Wizard/Common/View/Layout.elm +++ b/engine-wizard/elm/Wizard/Common/View/Layout.elm @@ -6,11 +6,11 @@ module Wizard.Common.View.Layout exposing ) import Browser exposing (Document) +import Gettext exposing (gettext) import Html exposing (Html, div, li, nav, text, ul) import Html.Attributes exposing (class, classList) import Shared.Data.BootstrapConfig.LookAndFeelConfig as LookAndFeelConfig import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw import Wizard.Common.AppState as AppState exposing (AppState) import Wizard.Common.Components.CookieConsent as CookieConsent @@ -23,31 +23,21 @@ import Wizard.Msgs exposing (Msg) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.View.Layout" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.Layout" - - misconfigured : AppState -> Document Msg misconfigured appState = let html = Page.illustratedMessage { image = Undraw.bugFixing - , heading = l_ "misconfigured.configurationError" appState + , heading = gettext "Configuration Error" appState.locale , lines = - [ l_ "misconfigured.appNotConfigured" appState - , l_ "misconfigured.contactAdmin" appState + [ gettext "Application is not configured correctly and cannot run." appState.locale + , gettext "Please, contact the administrator." appState.locale ] , cy = "misconfigured" } in - { title = l_ "misconfigured.configurationError" appState + { title = gettext "Configuration Error" appState.locale , body = [ html ] } @@ -101,7 +91,7 @@ publicHeader fluid model = [ linkTo model.appState Routes.appHome [ class "nav-link", dataCy "public_nav_go-to-app" ] - [ lx_ "header.goToApp" model.appState ] + [ text (gettext "Go to App" model.appState.locale) ] ] ] @@ -113,7 +103,7 @@ publicHeader fluid model = [ linkTo model.appState Routes.publicSignup [ class "nav-link", dataCy "public_nav_sign-up" ] - [ lx_ "header.signUp" model.appState ] + [ text (gettext "Sign Up" model.appState.locale) ] ] else @@ -123,7 +113,7 @@ publicHeader fluid model = [ linkTo model.appState (Routes.publicLogin Nothing) [ class "nav-link", dataCy "public_nav_login" ] - [ lx_ "header.logIn" model.appState ] + [ text (gettext "Log In" model.appState.locale) ] ] , signUpLink ] diff --git a/engine-wizard/elm/Wizard/Common/View/Modal.elm b/engine-wizard/elm/Wizard/Common/View/Modal.elm index 783a57ff2..7f35cc458 100644 --- a/engine-wizard/elm/Wizard/Common/View/Modal.elm +++ b/engine-wizard/elm/Wizard/Common/View/Modal.elm @@ -8,22 +8,17 @@ module Wizard.Common.View.Modal exposing ) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Attribute, Html, button, div, h5, pre, text) import Html.Attributes exposing (class, classList, disabled) import Html.Events exposing (onClick) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.ActionButton as ActionButton import Wizard.Common.View.FormResult as FormResult -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.Modal" - - type alias SimpleConfig msg = { modalContent : List (Html msg) , visible : Bool @@ -78,7 +73,7 @@ confirm appState cfg = , class "btn btn-secondary" , dataCy "modal_cancel-button" ] - [ lx_ "button.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] Nothing -> emptyNode @@ -124,7 +119,7 @@ error appState cfg = [ onClick cfg.actionMsg , class "btn btn-primary" ] - [ lx_ "button.ok" appState ] + [ text (gettext "OK" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/Common/View/Page.elm b/engine-wizard/elm/Wizard/Common/View/Page.elm index a4e107a14..7c61d70e5 100644 --- a/engine-wizard/elm/Wizard/Common/View/Page.elm +++ b/engine-wizard/elm/Wizard/Common/View/Page.elm @@ -10,25 +10,15 @@ module Wizard.Common.View.Page exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, br, div, h1, h2, p, text) import Html.Attributes exposing (class) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.View.Page" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.Page" - - header : String -> List (Html msg) -> Html msg header title actions = div [ class "header" ] @@ -47,7 +37,7 @@ loader : AppState -> Html msg loader appState = div [ class "full-page-loader" ] [ faSet "_global.spinner" appState - , div [] [ lx_ "loader.loading" appState ] + , div [] [ text (gettext "Loading..." appState.locale) ] ] @@ -55,7 +45,7 @@ error : AppState -> String -> Html msg error appState msg = illustratedMessage { image = Undraw.cancel - , heading = l_ "error.heading" appState + , heading = gettext "Error" appState.locale , lines = [ msg ] , cy = "error" } diff --git a/engine-wizard/elm/Wizard/Common/View/Tag.elm b/engine-wizard/elm/Wizard/Common/View/Tag.elm index 3ffde26f1..301b9fd67 100644 --- a/engine-wizard/elm/Wizard/Common/View/Tag.elm +++ b/engine-wizard/elm/Wizard/Common/View/Tag.elm @@ -1,13 +1,13 @@ module Wizard.Common.View.Tag exposing (TagListConfig, list, readOnlyList, selection, viewList) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, div, i, input, label, text) import Html.Attributes exposing (checked, class, classList, disabled, style, type_) import Html.Events exposing (onClick) import Shared.Data.KnowledgeModel as KnowledgeModel exposing (KnowledgeModel) import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lx) import Shared.Utils exposing (getContrastColorHex) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -22,16 +22,6 @@ type alias TagListConfig msg = } -l_ : String -> AppState -> String -l_ = - l "Wizard.Common.View.Tag" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Common.View.Tag" - - list : AppState -> TagListConfig msg -> List Tag -> Html msg list appState config tags = let @@ -40,7 +30,7 @@ list appState config tags = List.map (tagView appState config) (List.sortBy .name tags) else - [ Flash.info appState <| l_ "list.empty" appState ] + [ Flash.info appState <| gettext "There are no question tags configured for the Knowledge Model." appState.locale ] in div [ class "tag-list" ] content @@ -60,7 +50,7 @@ tagView appState config tag = ( untitled, tagName ) = if String.isEmpty tag.name then - ( True, lg "tag.untitled" appState ) + ( True, gettext "Untitled question tag" appState.locale ) else ( False, tag.name ) @@ -89,7 +79,7 @@ selection appState tagListConfig knowledgeModelResult = let viewContent content = div [ class "form-group form-group-tags" ] - [ label [] [ text (lg "tags" appState) ] + [ label [] [ text (gettext "Question Tags" appState.locale) ] , div [] [ content ] ] @@ -115,13 +105,13 @@ selection appState tagListConfig knowledgeModelResult = viewContent <| div [] [ list appState tagListConfig tags - , FormExtra.text <| l_ "selection.info" appState + , FormExtra.text <| gettext "You can filter questions in the questionnaire by question tags. If no question tags are selected, all questions will be used." appState.locale ] else viewContent <| Flash.info appState <| - l_ "selection.empty" appState + gettext "There are no question tags for this knowledge model." appState.locale readOnlyList : AppState -> List String -> List Tag -> Html msg @@ -133,7 +123,7 @@ readOnlyList appState selected tags = else [ div [ class "alert alert-light" ] - [ i [] [ lx_ "readOnlyList.noTags" appState ] ] + [ i [] [ text (gettext "No question tags" appState.locale) ] ] ] in div [ class "tag-list" ] content diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm index 69357bf63..d022d63ec 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/AdminDashboard.elm @@ -8,6 +8,7 @@ module Wizard.Dashboard.Dashboards.AdminDashboard exposing ) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, div) import Html.Attributes exposing (class) import Maybe.Extra as Maybe @@ -20,7 +21,6 @@ import Shared.Data.Pagination exposing (Pagination) import Shared.Data.Template exposing (Template) import Shared.Data.Usage exposing (Usage) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (listInsertIf) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.AddOpenIDWidget as AddOpenIDWidget @@ -78,7 +78,7 @@ update msg appState model = { model | usage = ActionResult.Success data } Err error -> - { model | usage = ApiError.toActionResult appState (lg "apiError.usage.getError" appState) error } + { model | usage = ApiError.toActionResult appState (gettext "Unable to get usage." appState.locale) error } GetPackagesComplete result -> case result of @@ -86,7 +86,7 @@ update msg appState model = { model | packages = ActionResult.Success data.items } Err error -> - { model | packages = ApiError.toActionResult appState (lg "apiError.packages.getListError" appState) error } + { model | packages = ApiError.toActionResult appState (gettext "Unable to get Knowledge Models." appState.locale) error } GetTemplatesComplete result -> case result of @@ -94,7 +94,7 @@ update msg appState model = { model | templates = ActionResult.Success data.items } Err error -> - { model | templates = ApiError.toActionResult appState (lg "apiError.templates.getListError" appState) error } + { model | templates = ApiError.toActionResult appState (gettext "Unable to get document templates." appState.locale) error } view : AppState -> Model -> Html msg diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm index 0fb862429..cc1bf54ac 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/DataStewardDashboard.elm @@ -1,6 +1,7 @@ module Wizard.Dashboard.Dashboards.DataStewardDashboard exposing (Model, Msg, fetchData, initialModel, update, view) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, div) import Html.Attributes exposing (class) import Shared.Api.Packages as PackagesApi @@ -9,7 +10,6 @@ import Shared.Data.Package exposing (Package) import Shared.Data.Pagination exposing (Pagination) import Shared.Data.Template exposing (Template) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget as CreateKnowledgeModelWidget import Wizard.Dashboard.Widgets.CreateProjectTemplateWidget as CreateProjectTemplateWidget @@ -59,7 +59,7 @@ update msg appState model = { model | packages = ActionResult.Success data.items } Err error -> - { model | packages = ApiError.toActionResult appState (lg "apiError.packages.getListError" appState) error } + { model | packages = ApiError.toActionResult appState (gettext "Unable to get Knowledge Models." appState.locale) error } GetTemplatesComplete result -> case result of @@ -67,7 +67,7 @@ update msg appState model = { model | templates = ActionResult.Success data.items } Err error -> - { model | templates = ApiError.toActionResult appState (lg "apiError.templates.getListError" appState) error } + { model | templates = ApiError.toActionResult appState (gettext "Unable to get document templates." appState.locale) error } view : AppState -> Model -> Html msg diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm index dbae78efb..d7b9ba690 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm @@ -8,6 +8,7 @@ module Wizard.Dashboard.Dashboards.ResearcherDashboard exposing ) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, div) import Html.Attributes exposing (class) import Shared.Api.Questionnaires as QuestionnairesApi @@ -16,7 +17,6 @@ import Shared.Data.Pagination exposing (Pagination) import Shared.Data.PaginationQueryString as PaginationQueryString import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.CreateProjectWidget as CreateProjectWidget import Wizard.Dashboard.Widgets.RecentProjectsWidget as RecentProjectsWidget @@ -68,7 +68,7 @@ update (GetQuestionnairesComplete result) appState model = { model | questionnaires = ActionResult.Success data.items } Err error -> - { model | questionnaires = ApiError.toActionResult appState (lg "apiError.questionnaires.getListError" appState) error } + { model | questionnaires = ApiError.toActionResult appState (gettext "Unable to get projects." appState.locale) error } view : AppState -> Model -> Html msg diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/WelcomeDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/WelcomeDashboard.elm index ca2a5d3e9..74e9a283b 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/WelcomeDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/WelcomeDashboard.elm @@ -1,24 +1,20 @@ module Wizard.Dashboard.Dashboards.WelcomeDashboard exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Attributes exposing (class) import Shared.Data.BootstrapConfig.LookAndFeelConfig as LookAndFeelConfig -import Shared.Locale exposing (lf) import Shared.Undraw as Undraw +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Dashboard.Dashboards.WelcomeDashboard" - - view : AppState -> Html msg view appState = div [ class "WelcomeDashboard", dataCy "dashboard_welcome" ] [ Undraw.teaching , div [ class "fs-3" ] - [ text <| lf_ "welcome" [ LookAndFeelConfig.getAppTitle appState.config.lookAndFeel ] appState + [ text <| String.format (gettext "Welcome to the %s!" appState.locale) [ LookAndFeelConfig.getAppTitle appState.config.lookAndFeel ] ] ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/AddOpenIDWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/AddOpenIDWidget.elm index 5f1c52026..8b4dae16f 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/AddOpenIDWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/AddOpenIDWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.AddOpenIDWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.AddOpenIDWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Add OpenID Service" appState.locale + , text = gettext "OpenID is an open standard for authentication that allows using existing accounts to login to other services without creating a new password. Configure your organization's OpenID to make it easier for your users to log in." appState.locale , action = { route = Routes.settingsAuthentication - , label = l_ "actionLabel" appState + , label = gettext "Add OpenID" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureLookAndFeelWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureLookAndFeelWidget.elm index 02eff2fe3..324e6956e 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureLookAndFeelWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureLookAndFeelWidget.elm @@ -1,32 +1,27 @@ module Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.ConfigureLookAndFeelWidget" - - view : AppState -> Html msg view appState = let widgetText = if appState.config.feature.clientCustomizationEnabled then - l_ "textWithCustomizations" appState + gettext "You can configure the application name and easily change the logo and colors to match your organization's style. You can also add additional menu links, for example, to your guidelines or documentation." appState.locale else - l_ "textWithoutCustomizations" appState + gettext "You can configure the application name, or add additional menu links, for example, to your guidelines or documentation." appState.locale in WidgetHelpers.ctaWidget appState - { title = l_ "title" appState + { title = gettext "Configure Look & Feel" appState.locale , text = widgetText , action = { route = Routes.settingsLookAndFeel - , label = l_ "actionLabel" appState + , label = gettext "Configure" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureOrganizationWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureOrganizationWidget.elm index 892d55171..f8b3ef2bb 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureOrganizationWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConfigureOrganizationWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.ConfigureOrganizationWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.ConfigureOrganizationWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Configure Organization Info" appState.locale + , text = gettext "Fill in your organization name and organization ID. For example, these values will be used with knowledge models created in this instance." appState.locale , action = { route = Routes.settingsOrganization - , label = l_ "actionLabel" appState + , label = gettext "Configure" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConnectRegistryWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConnectRegistryWidget.elm index 15aafb4f9..5dea10c07 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/ConnectRegistryWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/ConnectRegistryWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.ConnectRegistryWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.ConnectRegistryWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Connect to DSW Registry" appState.locale + , text = gettext "[DSW Registry](https://registry.ds-wizard.org) is a place for published knowledge models and document templates. When you connect your instance, data stewards can easily import them." appState.locale , action = { route = Routes.settingsRegistry - , label = l_ "actionLabel" appState + , label = gettext "Connect" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateKnowledgeModelWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateKnowledgeModelWidget.elm index 25370e85f..25bc7f124 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateKnowledgeModelWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateKnowledgeModelWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.CreateKnowledgeModelWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Create Knowledge Model" appState.locale + , text = gettext "Knowledge model is a tree-like structure containing the knowledge about what should be asked and how. It is used as a template for questionnaires in projects. You can create new ones from scratch or by modifying existing ones." appState.locale , action = { route = Routes.kmEditorCreate Nothing Nothing - , label = l_ "actionLabel" appState + , label = gettext "Create" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectTemplateWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectTemplateWidget.elm index 750ce5a18..e3c7d0936 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectTemplateWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectTemplateWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.CreateProjectTemplateWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.CreateProjectTemplateWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Create Project Template" appState.locale + , text = gettext "Project template is a special type of project that can be used as a starting point for new projects. You can select a knowledge model, set up a document template and format, or prefill some answers to make it easier to start for researchers." appState.locale , action = { route = Routes.projectsCreateCustom Nothing - , label = l_ "actionLabel" appState + , label = gettext "Create" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectWidget.elm index ec5f9289f..7f2ef8846 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/CreateProjectWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.CreateProjectWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.CreateProjectWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Create Project" appState.locale + , text = gettext "Project is a workspace where you create your DMP. It is based on a knowledge model, which contains knowledge about what should be asked and how based on the research field or organization's needs. You can use document templates to transform the answers into a document. This document can be anything, from PDF to machine-actionable JSON.\n\nYou can create a new project from a project template that data stewards prepare for you to have an easier start or from scratch where you set up everything yourself." appState.locale , action = { route = Routes.projectsCreate appState - , label = l_ "actionLabel" appState + , label = gettext "Create" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportDocumentTemplateWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportDocumentTemplateWidget.elm index 1132d4dee..d7ebb7c72 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportDocumentTemplateWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportDocumentTemplateWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.ImportDocumentTemplateWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Import Document Template" appState.locale + , text = gettext "Document templates transform answers from a questionnaire into a document. This document can be anything, from PDF to machine-actionable JSON. You can import existing document templates from [DSW Registry](https://registry.ds-wizard.org/templates) or create new ones using [DSW TDK](https://guide.ds-wizard.org/miscellaneous/development/template-development)." appState.locale , action = { route = Routes.templatesImport Nothing - , label = l_ "actionLabel" appState + , label = gettext "Import" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportKnowledgeModelWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportKnowledgeModelWidget.elm index 14abad98c..a4cc0ad04 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportKnowledgeModelWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/ImportKnowledgeModelWidget.elm @@ -1,24 +1,19 @@ module Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.ImportKnowledgeModelWidget" - - view : AppState -> Html msg view appState = WidgetHelpers.ctaWidget appState - { title = l_ "title" appState - , text = l_ "text" appState + { title = gettext "Import Knowledge Model" appState.locale + , text = gettext "Knowledge models are published in [DSW Registry](https://registry.ds-wizard.org). You can easily import them into your instance to make them available for researchers. You can also import other knowledge models exported from different instances." appState.locale , action = { route = Routes.knowledgeModelsImport Nothing - , label = l_ "actionLabel" appState + , label = gettext "Import" appState.locale } } diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm index 5c6dcc940..e81a77e76 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedPackagesWidget.elm @@ -1,12 +1,12 @@ module Wizard.Dashboard.Widgets.OutdatedPackagesWidget exposing (view) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, code, div, h2, strong, text) import Html.Attributes exposing (class) import Shared.Components.Badge as Badge import Shared.Data.Package exposing (Package) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.View.ItemIcon as ItemIcon @@ -14,11 +14,6 @@ import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Dashboard.Widgets.OutdatedPackagesWidget" - - view : AppState -> ActionResult (List Package) -> Html msg view appState packages = case packages of @@ -37,8 +32,8 @@ viewWidget : AppState -> List Package -> Html msg viewWidget appState packages = WidgetHelpers.widget [ div [ class "d-flex flex-column h-100" ] - [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "title" appState ] - , div [ class "mb-4" ] [ lx_ "description" appState ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ text (gettext "Update Knowledge Models" appState.locale) ] + , div [ class "mb-4" ] [ text (gettext "There are updates available for some knowledge models." appState.locale) ] , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewPackage appState) packages) ] ] @@ -54,7 +49,7 @@ viewPackage appState package = [ strong [] [ text package.name ] , div [ class "d-flex align-items-center mt-1" ] [ code [] [ text package.id ] - , Badge.warning [ class "ms-2" ] [ lx_ "updateBadge" appState ] + , Badge.warning [ class "ms-2" ] [ text (gettext "update available" appState.locale) ] ] ] ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm index c118bd635..bf0f02884 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/OutdatedTemplatesWidget.elm @@ -1,12 +1,12 @@ module Wizard.Dashboard.Widgets.OutdatedTemplatesWidget exposing (view) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, code, div, h2, strong, text) import Html.Attributes exposing (class) import Shared.Components.Badge as Badge import Shared.Data.Template exposing (Template) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.View.ItemIcon as ItemIcon @@ -14,11 +14,6 @@ import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Dashboard.Widgets.OutdatedTemplatesWidget" - - view : AppState -> ActionResult (List Template) -> Html msg view appState templates = case templates of @@ -37,8 +32,8 @@ viewWidget : AppState -> List Template -> Html msg viewWidget appState templates = WidgetHelpers.widget [ div [ class "d-flex flex-column h-100" ] - [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "title" appState ] - , div [ class "mb-4" ] [ lx_ "description" appState ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ text (gettext "Update Document Templates" appState.locale) ] + , div [ class "mb-4" ] [ text (gettext "There are updates available for some document templates." appState.locale) ] , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewTemplate appState) templates) ] ] @@ -54,7 +49,7 @@ viewTemplate appState template = [ strong [] [ text template.name ] , div [ class "d-flex align-items-center mt-1" ] [ code [] [ text template.id ] - , Badge.warning [ class "ms-2" ] [ lx_ "updateBadge" appState ] + , Badge.warning [ class "ms-2" ] [ text (gettext "update available" appState.locale) ] ] ] ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm index 269ff3e18..d16a4acee 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/RecentProjectsWidget.elm @@ -1,11 +1,11 @@ module Wizard.Dashboard.Widgets.RecentProjectsWidget exposing (view) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, br, div, h2, p, strong, text) import Html.Attributes exposing (class, style) import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Html exposing (faSet) -import Shared.Locale exposing (lx) import Time.Distance exposing (inWordsWithConfig) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) @@ -15,11 +15,6 @@ import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers import Wizard.Routes as Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Dashboard.Widgets.RecentProjectsWidget" - - view : AppState -> ActionResult (List Questionnaire) -> Html msg view appState questionnaires = WidgetHelpers.widget <| @@ -44,10 +39,10 @@ view appState questionnaires = viewRecentProjects : AppState -> List Questionnaire -> List (Html msg) viewRecentProjects appState questionnaires = [ div [ class "RecentProjectsWidget d-flex flex-column h-100" ] - [ h2 [ class "fs-4 fw-bold mb-4" ] [ lx_ "heading" appState ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ text (gettext "Recent Projects" appState.locale) ] , div [ class "Dashboard__ItemList flex-grow-1" ] (List.map (viewProject appState) questionnaires) , div [ class "mt-4" ] - [ linkTo appState (Routes.projectsIndex appState) [] [ lx_ "viewAll" appState ] ] + [ linkTo appState (Routes.projectsIndex appState) [] [ text (gettext "View all" appState.locale) ] ] ] ] @@ -84,7 +79,7 @@ viewRecentProjectsEmpty : AppState -> List (Html msg) viewRecentProjectsEmpty appState = [ div [ class "text-lighter d-flex flex-column justify-content-center h-100" ] [ p [ class "fs-5 m-0 mt-3 text-center" ] - [ lx_ "empty" appState + [ text (gettext "You have no projects yet, start by creating some." appState.locale) , br [] [] , faSet "_global.arrowRight" appState ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/UsageWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/UsageWidget.elm index 2b35de342..3de67b320 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/UsageWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/UsageWidget.elm @@ -1,10 +1,10 @@ module Wizard.Dashboard.Widgets.UsageWidget exposing (view) import ActionResult exposing (ActionResult(..)) -import Html exposing (Html, h2) +import Gettext exposing (gettext) +import Html exposing (Html, h2, text) import Html.Attributes exposing (class) import Shared.Data.Usage exposing (Usage) -import Shared.Locale exposing (lgx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.UsageTable as UsageTable import Wizard.Dashboard.Widgets.WidgetHelpers as WidgetHelpers @@ -24,6 +24,6 @@ view appState usage = [ WidgetHelpers.widgetError appState error ] Success usageData -> - [ h2 [ class "fs-4 fw-bold mb-4" ] [ lgx "usage" appState ] + [ h2 [ class "fs-4 fw-bold mb-4" ] [ text (gettext "Usage" appState.locale) ] , UsageTable.view appState usageData ] diff --git a/engine-wizard/elm/Wizard/Dashboard/Widgets/WelcomeWidget.elm b/engine-wizard/elm/Wizard/Dashboard/Widgets/WelcomeWidget.elm index 92d0200df..a8f34b6a0 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Widgets/WelcomeWidget.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Widgets/WelcomeWidget.elm @@ -1,40 +1,31 @@ module Wizard.Dashboard.Widgets.WelcomeWidget exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, h1, p, text) import Html.Attributes exposing (class) import Shared.Auth.Role as Role import Shared.Auth.Session as Session -import Shared.Locale exposing (l, lf) import Shared.Undraw as Undraw +import String.Format as String import Wizard.Common.AppState exposing (AppState) -l_ : String -> AppState -> String -l_ = - l "Wizard.Dashboard.Widgets.WelcomeWidget" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Dashboard.Widgets.WelcomeWidget" - - view : AppState -> Html msg view appState = let welcomeText = case appState.session.user of Just user -> - lf_ "welcomeName" [ user.firstName ] appState + String.format (gettext "Welcome, %s!" appState.locale) [ user.firstName ] Nothing -> - l_ "welcomeDefault" appState + gettext "Welcome!" appState.locale roleText = Role.switch (Session.getUserRole appState.session) - (l_ "roleAdmin" appState) - (l_ "roleDataSteward" appState) - (l_ "roleResearcher" appState) + (gettext "As an admin, you configure the instance and manage user accounts." appState.locale) + (gettext "As a data steward, you prepare knowledge models, document templates, and project templates for researchers." appState.locale) + (gettext "As a researcher, you create and collaborate on data management plans." appState.locale) "" in div [ class "col-12" ] diff --git a/engine-wizard/elm/Wizard/Documents/Index/Update.elm b/engine-wizard/elm/Wizard/Documents/Index/Update.elm index 82950d0a0..e0ac4fc9a 100644 --- a/engine-wizard/elm/Wizard/Documents/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Documents/Index/Update.elm @@ -4,6 +4,7 @@ module Wizard.Documents.Index.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Documents as DocumentsApi import Shared.Api.Questionnaires as QuestionnaireApi import Shared.Data.Document exposing (Document) @@ -11,7 +12,6 @@ import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Data.Submission exposing (Submission) import Shared.Data.SubmissionService exposing (SubmissionService) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setQuestionnaire) import Uuid import Wizard.Common.Api exposing (applyResult, getResultCmd) @@ -92,7 +92,7 @@ handleGetQuestionnaireCompleted : AppState -> Model -> Result ApiError Questionn handleGetQuestionnaireCompleted appState model result = applyResult appState { setResult = setQuestionnaire << Just - , defaultError = lg "apiError.documents.getListError" appState + , defaultError = gettext "Unable to get documents." appState.locale , model = model , result = result } @@ -132,7 +132,7 @@ handleDeleteDocumentCompleted appState model result = ) Err error -> - ( { model | deletingDocument = ApiError.toActionResult appState (lg "apiError.documents.deleteError" appState) error } + ( { model | deletingDocument = ApiError.toActionResult appState (gettext "Document could not be deleted." appState.locale) error } , getResultCmd result ) @@ -187,7 +187,7 @@ handleGetSubmissionServicesCompleted appState model result = in applyResult appState { setResult = setResult - , defaultError = lg "apiError.documents.getSubmissionServicesError" appState + , defaultError = gettext "Unable to get submission services for the document." appState.locale , model = model , result = result } @@ -224,7 +224,7 @@ handleSubmitDocumentCompleted appState model result = in applyResult appState { setResult = \value record -> updateSubmissions { record | submittingDocument = value } - , defaultError = lg "apiError.submissions.postError" appState + , defaultError = gettext "Unable to submit the document." appState.locale , model = model , result = result } @@ -237,7 +237,7 @@ handleSubmitDocumentCompleted appState model result = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Model -> Listing.UpdateConfig Document listingUpdateConfig wrapMsg appState model = { getRequest = DocumentsApi.getDocuments model.questionnaireUuid - , getError = lg "apiError.documents.getListError" appState + , getError = gettext "Unable to get documents." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.DocumentsRoute << IndexRoute model.questionnaireUuid } diff --git a/engine-wizard/elm/Wizard/Documents/Index/View.elm b/engine-wizard/elm/Wizard/Documents/Index/View.elm index df1ab853a..73932c5c8 100644 --- a/engine-wizard/elm/Wizard/Documents/Index/View.elm +++ b/engine-wizard/elm/Wizard/Documents/Index/View.elm @@ -1,6 +1,7 @@ module Wizard.Documents.Index.View exposing (view) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, h5, input, label, p, span, strong, table, tbody, td, text, tr) import Html.Attributes exposing (checked, class, classList, disabled, for, href, id, target, type_) import Html.Events exposing (onCheck, onClick) @@ -15,9 +16,9 @@ import Shared.Data.Submission as Submission exposing (Submission) import Shared.Data.Submission.SubmissionState as SubmissionState import Shared.Data.User as User import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (l, lf, lg, lgx, lh, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (listInsertIf) +import String.Format as String import Time.Distance as TimeDistance import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.View as Listing exposing (ListingActionType(..), ListingDropdownItem) @@ -38,26 +39,6 @@ import Wizard.Documents.Routes exposing (Route(..)) import Wizard.Routes as Routes exposing (Route(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Documents.Index.View" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Documents.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Documents.Index.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Documents.Index.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -91,7 +72,7 @@ viewDocuments appState model mbQuestionnaire = Maybe.map questionnaireFilterView mbQuestionnaire in div [ listClass "Documents__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Documents" appState.locale) [] , FormResult.successOnlyView appState model.deletingDocument , Listing.view appState (listingConfig appState model mbQuestionnaireFilterView) model.documents , deleteModal appState model @@ -110,7 +91,7 @@ listingConfig appState model mbQuestionnaireFilterView = else Just <| - [ strong [] [ lx_ "submissions.title" appState ] + [ strong [] [ text (gettext "Submissions" appState.locale) ] , table [ class "table table-sm table-borderless table-striped" ] [ tbody [] (List.map (viewSubmission appState) (List.sortWith Submission.compare document.submissions)) @@ -122,7 +103,7 @@ listingConfig appState model mbQuestionnaireFilterView = , dropdownItems = listingActions appState , itemAdditionalData = itemAdditionalData , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Create\" button to add a new document." appState.locale , updated = Just { getTime = .createdAt @@ -130,10 +111,10 @@ listingConfig appState model mbQuestionnaireFilterView = } , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search documents..." appState.locale) , sortOptions = - [ ( "name", lg "document.name" appState ) - , ( "createdAt", lg "document.createdAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.DocumentsRoute << IndexRoute model.questionnaireUuid @@ -149,7 +130,7 @@ listingTitle appState document = ( a [ onClick (DownloadDocument document) ] [ text document.name ] - , tooltipCustom "with-tooltip-right with-tooltip-align-left" (l_ "listing.name.title" appState) + , tooltipCustom "with-tooltip-right with-tooltip-align-left" (gettext "Click to download the document" appState.locale) ) else @@ -208,7 +189,7 @@ listingActions appState document = Listing.dropdownAction { extraClass = Nothing , icon = faSet "documents.download" appState - , label = l_ "action.download" appState + , label = gettext "Download" appState.locale , msg = ListingActionMsg (DownloadDocument document) , dataCy = "download" } @@ -220,7 +201,7 @@ listingActions appState document = Listing.dropdownAction { extraClass = Nothing , icon = faSet "documents.submit" appState - , label = l_ "action.submit" appState + , label = gettext "Submit" appState.locale , msg = ListingActionMsg (ShowHideSubmitDocument <| Just document) , dataCy = "submit" } @@ -232,7 +213,7 @@ listingActions appState document = Listing.dropdownAction { extraClass = Nothing , icon = faSet "documents.viewError" appState - , label = "View error" + , label = gettext "View error" appState.locale , msg = ListingActionMsg (SetDocumentErrorModal document.workerLog) , dataCy = "view-error" } @@ -244,7 +225,7 @@ listingActions appState document = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg (ShowHideDeleteDocument <| Just document) , dataCy = "delete" } @@ -263,13 +244,13 @@ stateBadge appState state = QueuedDocumentState -> Badge.info [ dataCy "documents_state-badge" ] [ faSet "_global.spinner" appState - , lx_ "badge.queued" appState + , text (gettext "Queued" appState.locale) ] InProgressDocumentState -> Badge.info [ dataCy "documents_state-badge" ] [ faSet "_global.spinner" appState - , lx_ "badge.inProgress" appState + , text (gettext "In Progress" appState.locale) ] DoneDocumentState -> @@ -277,7 +258,7 @@ stateBadge appState state = ErrorDocumentState -> Badge.danger [ dataCy "documents_state-badge" ] - [ lx_ "badge.error" appState ] + [ text (gettext "Error" appState.locale) ] viewSubmission : AppState -> Submission -> Html Msg @@ -288,14 +269,14 @@ viewSubmission appState submission = SubmissionState.InProgress -> Badge.info [] [ faSet "_global.spinner" appState - , lgx "submissionState.inProgress" appState + , text (gettext "Submitting" appState.locale) ] SubmissionState.Done -> - Badge.success [] [ lgx "submissionState.done" appState ] + Badge.success [] [ text (gettext "Submitted" appState.locale) ] SubmissionState.Error -> - Badge.danger [] [ lgx "submissionState.error" appState ] + Badge.danger [] [ text (gettext "Error" appState.locale) ] readableTime = TimeUtils.toReadableDateTime appState.timeZone submission.updatedAt @@ -307,13 +288,13 @@ viewSubmission appState submission = case ( submission.state, submission.location, submission.returnedData ) of ( SubmissionState.Done, Just location, _ ) -> a [ href location, class "with-icon-after", target "_blank" ] - [ lx_ "submissions.viewLink" appState + [ text (gettext "View submission" appState.locale) , faSet "_global.externalLink" appState ] ( SubmissionState.Error, _, Just _ ) -> a [ onClick (SetSubmissionErrorModal (Just (Submission.getReturnedData submission))) ] - [ lx_ "submissions.errorLink" appState ] + [ text (gettext "View error" appState.locale) ] _ -> emptyNode @@ -345,15 +326,15 @@ deleteModal appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text name ] ] appState) + (String.formatHtml (gettext "Are you sure you want to permanently delete %s?" appState.locale) [ strong [] [ text name ] ]) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete document" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingDocument - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteDocument , cancelMsg = Just <| ShowHideDeleteDocument Nothing , dangerous = True @@ -377,11 +358,11 @@ submitModal appState model = submitButton = if ActionResult.isSuccess model.submittingDocument then button [ class "btn btn-primary", onClick <| ShowHideSubmitDocument Nothing ] - [ lx_ "submitModal.button.done" appState ] + [ text (gettext "Done" appState.locale) ] else if ActionResult.isSuccess model.submissionServices && Maybe.isJust model.selectedSubmissionServiceId then ActionButton.button appState - { label = l_ "submitModal.button.submit" appState + { label = gettext "Submit" appState.locale , result = model.submittingDocument , msg = SubmitDocument , dangerous = False @@ -389,11 +370,11 @@ submitModal appState model = else button [ class "btn btn-primary", disabled True ] - [ lx_ "submitModal.button.submit" appState ] + [ text (gettext "Submit" appState.locale) ] cancelButton = button [ onClick <| ShowHideSubmitDocument Nothing, class "btn btn-secondary", disabled <| ActionResult.isLoading model.submittingDocument ] - [ lx_ "submitModal.button.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] viewOption submissionService = div [ class "form-check", classList [ ( "form-check-selected", model.selectedSubmissionServiceId == Just submissionService.id ) ] ] @@ -418,7 +399,7 @@ submitModal appState model = (List.map viewOption submissionServices) else - Flash.info appState <| l_ "submitModal.noSubmission" appState + Flash.info appState <| gettext "There are no submission services configured for this type of document." appState.locale submissionBody submissionServices = div [] @@ -434,7 +415,7 @@ submitModal appState model = case submission.location of Just location -> div [ class "mt-2" ] - [ lx_ "submitModal.success.link" appState + [ text (gettext "You can find it here: " appState.locale) , a [ href location, target "_blank" ] [ text location ] ] @@ -444,14 +425,14 @@ submitModal appState model = in div [ class "alert alert-success" ] [ faSet "_global.success" appState - , lx_ "submitModal.success.message" appState + , text (gettext "The document was successfully submitted." appState.locale) , link ] SubmissionState.Error -> div [ class "alert alert-danger" ] [ faSet "_global.error" appState - , lx_ "submitModal.error.message" appState + , text (gettext "The document submission failed." appState.locale) ] _ -> @@ -466,7 +447,7 @@ submitModal appState model = content = [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ text <| lf_ "submitModal.title" [ name ] appState ] + [ h5 [ class "modal-title" ] [ text <| String.format (gettext "Submit %s" appState.locale) [ name ] ] ] , div [ class "modal-body" ] [ body @@ -498,7 +479,7 @@ documentErrorModal appState model = ( False, "" ) modalConfig = - { title = l_ "documentErrorModal.title" appState + { title = gettext "Document error" appState.locale , message = message , visible = visible , actionMsg = SetDocumentErrorModal Nothing @@ -520,7 +501,7 @@ submissionErrorModal appState model = ( False, "" ) modalConfig = - { title = l_ "submissionErrorModal.title" appState + { title = gettext "Submission error" appState.locale , message = message , visible = visible , actionMsg = SetSubmissionErrorModal Nothing diff --git a/engine-wizard/elm/Wizard/KMEditor/Common/DeleteModal.elm b/engine-wizard/elm/Wizard/KMEditor/Common/DeleteModal.elm index c15db4e15..fc730bac2 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Common/DeleteModal.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Common/DeleteModal.elm @@ -9,25 +9,16 @@ module Wizard.KMEditor.Common.DeleteModal exposing ) import ActionResult exposing (ActionResult) +import Gettext exposing (gettext) import Html exposing (Html, p, strong, text) import Shared.Api.Branches as BranchesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lg, lh) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Modal as Modal -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Common.DeleteModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KMEditor.Common.DeleteModal" - - type alias Model = { branch : Maybe ( Uuid, String ) , deletingBranch : ActionResult String @@ -81,7 +72,7 @@ update cfg appState msg model = ( { model | branch = Nothing }, cfg.cmdDeleted ) Err error -> - ( { model | deletingBranch = ApiError.toActionResult appState (lg "apiError.branches.deleteError" appState) error } + ( { model | deletingBranch = ApiError.toActionResult appState (gettext "Knowledge model could not be deleted." appState.locale) error } , Cmd.none ) @@ -102,15 +93,15 @@ view appState model = content = [ p [] - (lh_ "text" [ strong [] [ text name ] ] appState) + (String.formatHtml (gettext "Are you sure you want to permanently delete %s?" appState.locale) [ strong [] [ text name ] ]) ] modalConfig = - { modalTitle = l_ "title" appState + { modalTitle = gettext "Delete knowledge model editor" appState.locale , modalContent = content , visible = visible , actionResult = model.deletingBranch - , actionName = "Delete" + , actionName = gettext "Delete" appState.locale , actionMsg = Delete , cancelMsg = Just Close , dangerous = True diff --git a/engine-wizard/elm/Wizard/KMEditor/Common/UpgradeModal.elm b/engine-wizard/elm/Wizard/KMEditor/Common/UpgradeModal.elm index 626f3d108..3966392dd 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Common/UpgradeModal.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Common/UpgradeModal.elm @@ -10,6 +10,7 @@ module Wizard.KMEditor.Common.UpgradeModal exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, p, strong, text) import Html.Attributes exposing (class) import Maybe.Extra as Maybe @@ -19,7 +20,7 @@ import Shared.Data.PackageDetail as PackageDetail exposing (PackageDetail) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lh) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormGroup as FormGroup @@ -28,16 +29,6 @@ import Wizard.Common.View.Page as Page import Wizard.KMEditor.Common.BranchUpgradeForm as BranchUpgradeForm exposing (BranchUpgradeForm) -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Common.UpgradeModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KMEditor.Common.UpgradeModal" - - type alias Model = { branch : Maybe ( Uuid, String ) , branchUpgradeForm : Form FormError BranchUpgradeForm @@ -112,7 +103,7 @@ update cfg appState msg model = ( { model | branch = Nothing }, cfg.cmdUpgraded kmUuid ) Err error -> - ( { model | creatingMigration = ApiError.toActionResult appState (lg "apiError.branches.migrations.postError" appState) error } + ( { model | creatingMigration = ApiError.toActionResult appState (gettext "Migration could not be created." appState.locale) error } , Cmd.none ) @@ -122,7 +113,7 @@ update cfg appState msg model = ( { model | package = ActionResult.Success package }, Cmd.none ) Err error -> - ( { model | package = ApiError.toActionResult appState (lg "apiError.packages.getError" appState) error } + ( { model | package = ApiError.toActionResult appState (gettext "Unable to get the Knowledge Model." appState.locale) error } , Cmd.none ) @@ -157,23 +148,23 @@ view appState model = options = case model.package of Success package -> - ( "", l_ "form.defaultOption" appState ) :: PackageDetail.createFormOptions package + ( "", gettext "- select parent package -" appState.locale ) :: PackageDetail.createFormOptions package _ -> [] in [ p [ class "alert alert-info" ] - (lh_ "text" [ strong [] [ text name ] ] appState) - , FormGroup.select appState options model.branchUpgradeForm "targetPackageId" (l_ "form.targetPackageId" appState) + (String.formatHtml (gettext "Select the new parent knowledge model for %s." appState.locale) [ strong [] [ text name ] ]) + , FormGroup.select appState options model.branchUpgradeForm "targetPackageId" (gettext "New parent package" appState.locale) |> Html.map FormMsg ] modalConfig = - { modalTitle = l_ "title" appState + { modalTitle = gettext "Create migration" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.creatingMigration - , actionName = l_ "action" appState + , actionName = gettext "Create" appState.locale , actionMsg = FormMsg Form.Submit , cancelMsg = Just Close , dangerous = False diff --git a/engine-wizard/elm/Wizard/KMEditor/Create/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Create/Update.elm index ca1911cef..4f62e3c28 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Create/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Create/Update.elm @@ -6,6 +6,7 @@ module Wizard.KMEditor.Create.Update exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Field as Field +import Gettext exposing (gettext) import Maybe.Extra as Maybe import Result exposing (Result) import Shared.Api.Branches as BranchesApi @@ -15,7 +16,6 @@ import Shared.Data.PackageSuggestion exposing (PackageSuggestion) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (lg) import String.Normalize as Normalize import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -62,7 +62,7 @@ update msg wrapMsg appState model = ( { model | package = Success package, form = form }, Cmd.none ) Err error -> - ( { model | package = ApiError.toActionResult appState (lg "apiError.packages.getError" appState) error }, Cmd.none ) + ( { model | package = ApiError.toActionResult appState (gettext "Unable to get the Knowledge Model." appState.locale) error }, Cmd.none ) handleFormMsg : (Msg -> Wizard.Msgs.Msg) -> Form.Msg -> AppState -> Model -> ( Model, Cmd Wizard.Msgs.Msg ) @@ -114,7 +114,7 @@ handlePostBranchCompleted appState model result = Err error -> ( { model | form = setFormErrors appState error model.form - , savingBranch = ApiError.toActionResult appState (lg "apiError.branches.postError" appState) error + , savingBranch = ApiError.toActionResult appState (gettext "Knowledge Model could not be created." appState.locale) error } , getResultCmd result ) @@ -129,7 +129,7 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = cfg = { wrapMsg = wrapMsg << PackageTypeHintInputMsg , getTypeHints = PackagesApi.getPackagesSuggestions - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = formMsg << .id , clearReply = Just <| formMsg "" , filterResults = Nothing diff --git a/engine-wizard/elm/Wizard/KMEditor/Create/View.elm b/engine-wizard/elm/Wizard/KMEditor/Create/View.elm index e11fa1b02..b5e5cd66c 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Create/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Create/View.elm @@ -2,9 +2,9 @@ module Wizard.KMEditor.Create.View exposing (view) import ActionResult import Form +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Events exposing (onSubmit) -import Shared.Locale exposing (l, lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput as TypeHintInput import Wizard.Common.Components.TypeHintInput.TypeHintItem as TypeHintItem @@ -20,11 +20,6 @@ import Wizard.KMEditor.Create.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Create.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -42,13 +37,13 @@ view appState model = viewCreate : AppState -> Model -> a -> Html Msg viewCreate appState model _ = div [ detailClass "KMEditor__Create" ] - [ Page.header (l_ "header" appState) [] + [ Page.header (gettext "Create Knowledge Model" appState.locale) [] , Html.form [ onSubmit (FormMsg Form.Submit) ] [ FormResult.errorOnlyView appState model.savingBranch , formView appState model , FormActions.viewSubmit appState Routes.kmEditorIndex - (ActionButton.SubmitConfig (l_ "create" appState) model.savingBranch) + (ActionButton.SubmitConfig (gettext "Create" appState.locale) model.savingBranch) ] ] @@ -76,9 +71,9 @@ formView appState model = FormGroup.formGroupCustom typeHintInput appState model.form "previousPackageId" in div [] - [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| lg "branch.name" appState - , Html.map FormMsg <| FormGroup.input appState model.form "kmId" <| lg "branch.kmId" appState - , FormExtra.textAfter <| l_ "form.kmIdHint" appState - , parentInput <| lg "branch.basedOn" appState - , FormExtra.textAfter <| l_ "form.basedOnHint" appState + [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Name" appState.locale + , Html.map FormMsg <| FormGroup.input appState model.form "kmId" <| gettext "Knowledge Model ID" appState.locale + , FormExtra.textAfter <| gettext "Knowledge Model ID can contain alphanumeric characters and dashes but cannot start or end with a dash." appState.locale + , parentInput <| gettext "Based on" appState.locale + , FormExtra.textAfter <| gettext "You can create a new Knowledge Model based on the existing one or start from scratch." appState.locale ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm index 7377b7bfe..b25198a48 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm @@ -24,6 +24,7 @@ module Wizard.KMEditor.Editor.Common.EditorBranch exposing ) import Dict +import Gettext exposing (gettext) import List.Extra as List import Maybe.Extra as Maybe import Regex @@ -64,7 +65,6 @@ import Shared.Data.KnowledgeModel.Phase exposing (Phase) import Shared.Data.KnowledgeModel.Question as Question exposing (Question(..)) import Shared.Data.KnowledgeModel.Reference as Reference exposing (Reference) import Shared.Data.KnowledgeModel.Tag exposing (Tag) -import Shared.Locale exposing (l, lg) import Shared.RegexPatterns as RegexPatterns import Shared.Utils exposing (flip) import String.Extra as String @@ -72,11 +72,6 @@ import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.Common.EditorBranch" - - type alias EditorBranch = { branch : BranchDetail , parentMap : KnowledgeModel.ParentMap @@ -244,34 +239,34 @@ getEditorName appState uuid editorBranch = Nothing getChapterName = - getEditorName_ (String.withDefault (lg "chapter.untitled" appState) << .title) KnowledgeModel.getChapter + getEditorName_ (String.withDefault (gettext "Untitled chapter" appState.locale) << .title) KnowledgeModel.getChapter getQuestionName = - getEditorName_ (String.withDefault (lg "question.untitled" appState) << Question.getTitle) KnowledgeModel.getQuestion + getEditorName_ (String.withDefault (gettext "Untitled question" appState.locale) << Question.getTitle) KnowledgeModel.getQuestion getMetricName = - getEditorName_ (String.withDefault (lg "metric.untitled" appState) << .title) KnowledgeModel.getMetric + getEditorName_ (String.withDefault (gettext "Untitled metric" appState.locale) << .title) KnowledgeModel.getMetric getPhaseName = - getEditorName_ (String.withDefault (lg "phase.untitled" appState) << .title) KnowledgeModel.getPhase + getEditorName_ (String.withDefault (gettext "Untitled phase" appState.locale) << .title) KnowledgeModel.getPhase getTagName = - getEditorName_ (String.withDefault (lg "tag.untitled" appState) << .name) KnowledgeModel.getTag + getEditorName_ (String.withDefault (gettext "Untitled tag" appState.locale) << .name) KnowledgeModel.getTag getIntegrationName = - getEditorName_ (String.withDefault (lg "integration.untitled" appState) << Integration.getName) KnowledgeModel.getIntegration + getEditorName_ (String.withDefault (gettext "Untitled integration" appState.locale) << Integration.getName) KnowledgeModel.getIntegration getAnswerName = - getEditorName_ (String.withDefault (lg "answer.untitled" appState) << .label) KnowledgeModel.getAnswer + getEditorName_ (String.withDefault (gettext "Untitled answer" appState.locale) << .label) KnowledgeModel.getAnswer getChoiceName = - getEditorName_ (String.withDefault (lg "choice.untitled" appState) << .label) KnowledgeModel.getChoice + getEditorName_ (String.withDefault (gettext "Untitled choice" appState.locale) << .label) KnowledgeModel.getChoice getReferenceName = - getEditorName_ (String.withDefault (lg "reference.untitled" appState) << Reference.getVisibleName) KnowledgeModel.getReference + getEditorName_ (String.withDefault (gettext "Untitled reference" appState.locale) << Reference.getVisibleName) KnowledgeModel.getReference getExpertName = - getEditorName_ (String.withDefault (lg "expert.untitled" appState) << Expert.getVisibleName) KnowledgeModel.getExpert + getEditorName_ (String.withDefault (gettext "Untitled expert" appState.locale) << Expert.getVisibleName) KnowledgeModel.getExpert in getKnowledgeModelName |> Maybe.orElse getChapterName @@ -762,7 +757,7 @@ computeChapterWarnings appState km chapter = titleWarning = if String.isEmpty chapter.title then [ { editorUuid = chapter.uuid - , message = l_ "warning.chapterTitleEmpty" appState + , message = gettext "Empty title for chapter" appState.locale } ] @@ -791,7 +786,7 @@ computeQuestionWarnings appState km question = titleWarning = if String.isEmpty (Question.getTitle question) then - createError (l_ "warning.questionTitleEmpty" appState) + createError (gettext "Empty title for question" appState.locale) else [] @@ -800,7 +795,7 @@ computeQuestionWarnings appState km question = case question of Question.OptionsQuestion _ data -> if List.isEmpty data.answerUuids then - createError (l_ "warning.questionEmptyAnswers" appState) + createError (gettext "No answers for options question" appState.locale) else List.concatMap @@ -809,7 +804,7 @@ computeQuestionWarnings appState km question = Question.ListQuestion _ data -> if List.isEmpty data.itemTemplateQuestionUuids then - createError (l_ "warning.questionEmptyItemQuestions" appState) + createError (gettext "No item questions for list question" appState.locale) else List.concatMap @@ -818,14 +813,14 @@ computeQuestionWarnings appState km question = Question.IntegrationQuestion _ data -> if data.integrationUuid == Uuid.toString Uuid.nil then - createError (l_ "warning.questionEmptyIntegration" appState) + createError (gettext "No integration selected for integration question" appState.locale) else [] Question.MultiChoiceQuestion _ data -> if List.isEmpty data.choiceUuids then - createError (l_ "warning.questionEmptyChoices" appState) + createError (gettext "No choices for multi-choice question" appState.locale) else List.concatMap @@ -854,7 +849,7 @@ computeAnswerWarnings appState km answer = labelWarning = if String.isEmpty answer.label then [ { editorUuid = answer.uuid - , message = l_ "warning.answerEmptyLabel" appState + , message = gettext "Empty label for answer" appState.locale } ] @@ -873,7 +868,7 @@ computeChoiceWarnings : AppState -> Choice -> List EditorBranchWarning computeChoiceWarnings appState choice = if String.isEmpty choice.label then [ { editorUuid = choice.uuid - , message = l_ "warning.choiceEmptyLabel" appState + , message = gettext "Empty label for choice" appState.locale } ] @@ -893,17 +888,17 @@ computeReferenceWarnings appState reference = case reference of Reference.ResourcePageReference data -> if String.isEmpty data.shortUuid then - createError (l_ "warning.referenceEmptyShortUuid" appState) + createError (gettext "Empty short UUID for page reference" appState.locale) else [] Reference.URLReference data -> if String.isEmpty data.url then - createError (l_ "warning.referenceEmptyUrl" appState) + createError (gettext "Empty URL for URL reference" appState.locale) else if not (Regex.contains RegexPatterns.url data.url) then - createError (l_ "warning.referenceInvalidUrl" appState) + createError (gettext "Invalid URL for URL reference" appState.locale) else [] @@ -922,10 +917,10 @@ computeExpertWarnings appState expert = ] in if String.isEmpty expert.email then - createError (l_ "warning.expertEmptyEmail" appState) + createError (gettext "Empty email for expert" appState.locale) else if not (Regex.contains RegexPatterns.email expert.email) then - createError (l_ "warning.expertInvalidEmail" appState) + createError (gettext "Invalid email for expert" appState.locale) else [] @@ -935,7 +930,7 @@ computeMetricWarnings : AppState -> Metric -> List EditorBranchWarning computeMetricWarnings appState metric = if String.isEmpty metric.title then [ { editorUuid = metric.uuid - , message = l_ "warning.metricEmptyTitle" appState + , message = gettext "Empty title for metric" appState.locale } ] @@ -947,7 +942,7 @@ computePhaseWarnings : AppState -> Phase -> List EditorBranchWarning computePhaseWarnings appState phase = if String.isEmpty phase.title then [ { editorUuid = phase.uuid - , message = l_ "warning.phaseEmptyTitle" appState + , message = gettext "Empty title for phase" appState.locale } ] @@ -959,7 +954,7 @@ computeTagWarnings : AppState -> Tag -> List EditorBranchWarning computeTagWarnings appState tag = if String.isEmpty tag.name then [ { editorUuid = tag.uuid - , message = l_ "warning.tagEmptyName" appState + , message = gettext "Empty name for tag" appState.locale } ] @@ -978,14 +973,14 @@ computeIntegrationWarnings appState integration = idWarning = if String.isEmpty (Integration.getId integration) then - createError (l_ "warning.integrationEmptyId" appState) + createError (gettext "Empty ID for integration" appState.locale) else [] itemUrlWarning = if String.isEmpty (Integration.getItemUrl integration) then - createError (l_ "warning.integrationEmptyItemUrl" appState) + createError (gettext "Empty item URL for integration" appState.locale) else [] @@ -996,28 +991,28 @@ computeIntegrationWarnings appState integration = let urlError = if String.isEmpty data.requestUrl then - createError (l_ "warning.integrationEmptyRequestUrl" appState) + createError (gettext "Empty request URL for integration" appState.locale) else [] requestMethod = if String.isEmpty data.requestMethod then - createError (l_ "warning.integrationEmptyRequestHttpMethod" appState) + createError (gettext "Empty request HTTP method for integration" appState.locale) else [] responseItemId = if String.isEmpty data.responseItemId then - createError (l_ "warning.integrationEmptyResponseItemID" appState) + createError (gettext "Empty response item ID for integration" appState.locale) else [] responseItemTemplate = if String.isEmpty data.responseItemTemplate then - createError (l_ "warning.integrationEmptyResponseItemTemplate" appState) + createError (gettext "Empty response item template for integration" appState.locale) else [] @@ -1026,7 +1021,7 @@ computeIntegrationWarnings appState integration = Integration.WidgetIntegration _ data -> if String.isEmpty data.widgetUrl then - createError (l_ "warning.integrationEmptyWidgetUrl" appState) + createError (gettext "Empty widget URL for integration" appState.locale) else [] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm index da80074ff..799416ce9 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm @@ -12,6 +12,7 @@ module Wizard.KMEditor.Editor.Components.KMEditor exposing ) import Dict exposing (Dict) +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, h3, h5, i, img, label, li, small, span, strong, text, ul) import Html.Attributes exposing (class, classList, disabled, id, src) import Html.Events exposing (onClick) @@ -68,7 +69,6 @@ import Shared.Data.KnowledgeModel.Question.QuestionValueType as QuestionValueTyp import Shared.Data.KnowledgeModel.Reference as Reference exposing (Reference(..)) import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lgx, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (compose2, dispatch, flip, httpMethodOptions, nilUuid) import SplitPane @@ -89,16 +89,6 @@ import Wizard.KMEditor.Editor.Components.KMEditor.TreeInput as TreeInput import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.Components.KMEditor" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.KMEditor" - - -- MODEL @@ -311,7 +301,7 @@ view appState wrapMsg eventMsg model integrationPrefabs editorBranch = , classList [ ( "selected", model.warningsPanelOpen ) ] , onClick (wrapMsg (SetWarningPanelsOpen (not model.warningsPanelOpen))) ] - [ lx_ "navbar.warnings" appState + [ text (gettext "Warnings" appState.locale) , Badge.danger [ class "rounded-pill" ] [ text (String.fromInt warningsCount) ] ] @@ -352,7 +342,7 @@ viewWarningsPanel appState editorBranch = warnings = if List.isEmpty editorBranch.warnings then - Flash.info appState (l_ "warnings.empty" appState) + Flash.info appState (gettext "There are no more warnings." appState.locale) else ul [] (List.map viewWarning editorBranch.warnings) @@ -460,7 +450,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km kmEditorTitle = editorTitle appState - { title = lg "knowledgeModel" appState + { title = gettext "Knowledge Model" appState.locale , uuid = kmUuid , wrapMsg = wrapMsg , mbDeleteModalState = Nothing @@ -496,7 +486,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km chaptersInput = Input.reorderable appState { name = "chapters" - , label = lg "chapters" appState + , label = gettext "Chapters" appState.locale , items = EditorBranch.filterDeleted editorBranch km.chapterUuids , entityUuid = kmUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -504,8 +494,8 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km , updateList = createEditEvent setChapterUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getChapterName km - , untitledLabel = lg "chapter.untitled" appState - , addChildLabel = l_ "knowledgeModel.addChapter" appState + , untitledLabel = gettext "Untitled chapter" appState.locale + , addChildLabel = gettext "Add chapter" appState.locale , addChildMsg = addChapterEvent , addChildDataCy = "chapter" } @@ -513,7 +503,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km metricsInput = Input.reorderable appState { name = "metrics" - , label = lg "metrics" appState + , label = gettext "Metrics" appState.locale , items = EditorBranch.filterDeleted editorBranch km.metricUuids , entityUuid = kmUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -521,8 +511,8 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km , updateList = createEditEvent setMetricUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getMetricName km - , untitledLabel = lg "metric.untitled" appState - , addChildLabel = l_ "knowledgeModel.addMetric" appState + , untitledLabel = gettext "Untitled metric" appState.locale + , addChildLabel = gettext "Add metric" appState.locale , addChildMsg = addMetricEvent , addChildDataCy = "metric" } @@ -530,7 +520,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km phasesInput = Input.reorderable appState { name = "phases" - , label = lg "phases" appState + , label = gettext "Phases" appState.locale , items = EditorBranch.filterDeleted editorBranch km.phaseUuids , entityUuid = kmUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -538,8 +528,8 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km , updateList = createEditEvent setPhaseUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getPhaseName km - , untitledLabel = lg "phase.untitled" appState - , addChildLabel = l_ "knowledgeModel.addPhase" appState + , untitledLabel = gettext "Untitled phase" appState.locale + , addChildLabel = gettext "Add phase" appState.locale , addChildMsg = addPhaseEvent , addChildDataCy = "phase" } @@ -547,7 +537,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km tagsInput = Input.reorderable appState { name = "tags" - , label = lg "tags" appState + , label = gettext "Question Tags" appState.locale , items = EditorBranch.filterDeleted editorBranch km.tagUuids , entityUuid = kmUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -555,8 +545,8 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km , updateList = createEditEvent setTagUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getTagName km - , untitledLabel = lg "tag.untitled" appState - , addChildLabel = l_ "knowledgeModel.addTag" appState + , untitledLabel = gettext "Untitled tag" appState.locale + , addChildLabel = gettext "Add tag" appState.locale , addChildMsg = addTagEvent , addChildDataCy = "tag" } @@ -564,7 +554,7 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km integrationsInput = Input.reorderable appState { name = "integrations" - , label = lg "integrations" appState + , label = gettext "Integrations" appState.locale , items = EditorBranch.filterDeleted editorBranch km.integrationUuids , entityUuid = kmUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -572,8 +562,8 @@ viewKnowledgeModelEditor { appState, wrapMsg, eventMsg, model, editorBranch } km , updateList = createEditEvent setIntegrationUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getIntegrationName km - , untitledLabel = lg "integration.untitled" appState - , addChildLabel = l_ "knowledgeModel.addIntegration" appState + , untitledLabel = gettext "Untitled integration" appState.locale + , addChildLabel = gettext "Add integration" appState.locale , addChildMsg = addIntegrationEvent , addChildDataCy = "integration" } @@ -614,7 +604,7 @@ viewChapterEditor { appState, wrapMsg, eventMsg, model, editorBranch } chapter = chapterEditorTitle = editorTitle appState - { title = lg "chapter" appState + { title = gettext "Chapter" appState.locale , uuid = chapter.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just ChapterState @@ -624,7 +614,7 @@ viewChapterEditor { appState, wrapMsg, eventMsg, model, editorBranch } chapter = titleInput = Input.string { name = "title" - , label = lg "chapter.title" appState + , label = gettext "Title" appState.locale , value = chapter.title , onInput = createEditEvent setTitle } @@ -632,7 +622,7 @@ viewChapterEditor { appState, wrapMsg, eventMsg, model, editorBranch } chapter = textInput = Input.markdown appState { name = "text" - , label = lg "chapter.text" appState + , label = gettext "Text" appState.locale , value = Maybe.withDefault "" chapter.text , onInput = createEditEvent setText << String.toMaybe , previewMsg = compose2 wrapMsg ShowHideMarkdownPreview @@ -643,7 +633,7 @@ viewChapterEditor { appState, wrapMsg, eventMsg, model, editorBranch } chapter = questionsInput = Input.reorderable appState { name = "questions" - , label = lg "questions" appState + , label = gettext "Questions" appState.locale , items = EditorBranch.filterDeleted editorBranch chapter.questionUuids , entityUuid = chapter.uuid , getReorderableState = flip Dict.get model.reorderableStates @@ -651,8 +641,8 @@ viewChapterEditor { appState, wrapMsg, eventMsg, model, editorBranch } chapter = , updateList = createEditEvent setQuestionUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getQuestionName editorBranch.branch.knowledgeModel - , untitledLabel = lg "question.untitled" appState - , addChildLabel = l_ "chapter.addQuestion" appState + , untitledLabel = gettext "Untitled question" appState.locale + , addChildLabel = gettext "Add question" appState.locale , addChildMsg = questionAddEvent , addChildDataCy = "question" } @@ -751,22 +741,22 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question |> eventMsg questionUuid Nothing questionTypeOptions = - [ ( "Options", lg "questionType.options" appState ) - , ( "List", lg "questionType.list" appState ) - , ( "Value", lg "questionType.value" appState ) - , ( "Integration", lg "questionType.integration" appState ) - , ( "MultiChoice", lg "questionType.multiChoice" appState ) + [ ( "Options", gettext "Options" appState.locale ) + , ( "List", gettext "List of Items" appState.locale ) + , ( "Value", gettext "Value" appState.locale ) + , ( "Integration", gettext "Integration" appState.locale ) + , ( "MultiChoice", gettext "Multi-Choice" appState.locale ) ] requiredPhaseUuidOptions = KnowledgeModel.getPhases editorBranch.branch.knowledgeModel |> EditorBranch.filterDeletedWith .uuid editorBranch |> List.map (\phase -> ( phase.uuid, phase.title )) - |> (::) ( "", l_ "question.phase.never" appState ) + |> (::) ( "", gettext "Never" appState.locale ) questionEditorTitle = editorTitle appState - { title = lg "question" appState + { title = gettext "Question" appState.locale , uuid = Question.getUuid question , wrapMsg = wrapMsg , mbDeleteModalState = Just QuestionState @@ -776,7 +766,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question typeInput = Input.select { name = "type" - , label = lg "question.type" appState + , label = gettext "Type" appState.locale , value = Question.getTypeString question , options = questionTypeOptions , onChange = onTypeChange @@ -791,7 +781,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question else FormExtra.blockAfter [ faSet "_global.warning" appState - , text (l_ "question.type.warning.options" appState) + , text (gettext "Changing a question type will remove all answers." appState.locale) ] ListQuestion _ _ -> @@ -801,7 +791,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question else FormExtra.blockAfter [ faSet "_global.warning" appState - , text (l_ "question.type.warning.list" appState) + , text (gettext "Changing a question type will remove all item questions." appState.locale) ] MultiChoiceQuestion _ _ -> @@ -811,7 +801,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question else FormExtra.blockAfter [ faSet "_global.warning" appState - , text (l_ "question.type.warning.multichoice" appState) + , text (gettext "Changing a question type will remove all choices." appState.locale) ] _ -> @@ -820,7 +810,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question titleInput = Input.string { name = "title" - , label = lg "question.title" appState + , label = gettext "Title" appState.locale , value = Question.getTitle question , onInput = createEditEvent setTitle setTitle setTitle setTitle setTitle } @@ -828,7 +818,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question textInput = Input.markdown appState { name = "text" - , label = lg "question.text" appState + , label = gettext "Text" appState.locale , value = Maybe.withDefault "" (Question.getText question) , onInput = createEditEvent setText setText setText setText setText << String.toMaybe , previewMsg = compose2 wrapMsg ShowHideMarkdownPreview @@ -839,7 +829,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question requiredPhaseUuidInput = Input.select { name = "requiredPhaseUuid" - , label = lg "question.requiredLevel" appState + , label = gettext "When does this question become desirable?" appState.locale , value = String.fromMaybe <| Question.getRequiredPhaseUuid question , options = requiredPhaseUuidOptions , onChange = createEditEvent setRequiredPhaseUuid setRequiredPhaseUuid setRequiredPhaseUuid setRequiredPhaseUuid setRequiredPhaseUuid << String.toMaybe @@ -847,7 +837,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question tagUuidsInput = Input.tags appState - { label = lg "tags" appState + { label = gettext "Question Tags" appState.locale , tags = EditorBranch.filterDeletedWith .uuid editorBranch <| KnowledgeModel.getTags editorBranch.branch.knowledgeModel , selected = Question.getTagUuids question , onChange = createEditEvent setTagUuids setTagUuids setTagUuids setTagUuids setTagUuids @@ -856,7 +846,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question referencesInput = Input.reorderable appState { name = "references" - , label = lg "references" appState + , label = gettext "References" appState.locale , items = EditorBranch.filterDeleted editorBranch <| Question.getReferenceUuids question , entityUuid = questionUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -864,8 +854,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question , updateList = createEditEvent setReferenceUuids setReferenceUuids setReferenceUuids setReferenceUuids setReferenceUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getReferenceName editorBranch.branch.knowledgeModel - , untitledLabel = lg "reference.untitled" appState - , addChildLabel = l_ "question.addReference" appState + , untitledLabel = gettext "Untitled reference" appState.locale + , addChildLabel = gettext "Add reference" appState.locale , addChildMsg = addReferenceEvent , addChildDataCy = "reference" } @@ -873,7 +863,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question expertsInput = Input.reorderable appState { name = "experts" - , label = lg "experts" appState + , label = gettext "Experts" appState.locale , items = EditorBranch.filterDeleted editorBranch <| Question.getExpertUuids question , entityUuid = questionUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -881,8 +871,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question , updateList = createEditEvent setExpertUuids setExpertUuids setExpertUuids setExpertUuids setExpertUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getExpertName editorBranch.branch.knowledgeModel - , untitledLabel = lg "expert.untitled" appState - , addChildLabel = l_ "question.addExpert" appState + , untitledLabel = gettext "Untitled expert" appState.locale + , addChildLabel = gettext "Add expert" appState.locale , addChildMsg = expertAddEvent , addChildDataCy = "expert" } @@ -911,7 +901,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question answersInput = Input.reorderable appState { name = "answers" - , label = lg "answers" appState + , label = gettext "Answers" appState.locale , items = EditorBranch.filterDeleted editorBranch <| Question.getAnswerUuids question , entityUuid = questionUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -919,8 +909,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question , updateList = createTypeEditEvent setAnswerUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getAnswerName editorBranch.branch.knowledgeModel - , untitledLabel = lg "answer.untitled" appState - , addChildLabel = l_ "question.addAnswer" appState + , untitledLabel = gettext "Untitled answer" appState.locale + , addChildLabel = gettext "Add answer" appState.locale , addChildMsg = addAnswerEvent , addChildDataCy = "answer" } @@ -943,7 +933,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question itemTemplateQuestionsInput = Input.reorderable appState { name = "questions" - , label = lg "questions" appState + , label = gettext "Questions" appState.locale , items = EditorBranch.filterDeleted editorBranch <| Question.getItemTemplateQuestionUuids question , entityUuid = questionUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -951,8 +941,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question , updateList = createTypeEditEvent setItemTemplateQuestionUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getQuestionName editorBranch.branch.knowledgeModel - , untitledLabel = lg "question.untitled" appState - , addChildLabel = l_ "question.addItemTemplateQuestion" appState + , untitledLabel = gettext "Untitled question" appState.locale + , addChildLabel = gettext "Add question" appState.locale , addChildMsg = addItemTemplateQuestionEvent , addChildDataCy = "question" } @@ -960,7 +950,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question [ div [ class "form-group" ] [ div [ class "card card-border-light card-item-template" ] [ div [ class "card-header" ] - [ lgx "question.itemTemplate" appState ] + [ text (gettext "Item Template" appState.locale) ] , div [ class "card-body" ] [ itemTemplateQuestionsInput ] ] @@ -976,21 +966,21 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question |> eventMsg parentUuid (Just questionUuid) questionValueTypeOptions = - [ ( "StringQuestionValueType", lg "questionValueType.string" appState ) - , ( "NumberQuestionValueType", lg "questionValueType.number" appState ) - , ( "DateQuestionValueType", lg "questionValueType.date" appState ) - , ( "DateTimeQuestionValueType", lg "questionValueType.datetime" appState ) - , ( "TimeQuestionValueType", lg "questionValueType.time" appState ) - , ( "TextQuestionValueType", lg "questionValueType.text" appState ) - , ( "EmailQuestionValueType", lg "questionValueType.email" appState ) - , ( "UrlQuestionValueType", lg "questionValueType.url" appState ) - , ( "ColorQuestionValueType", lg "questionValueType.color" appState ) + [ ( "StringQuestionValueType", gettext "String" appState.locale ) + , ( "NumberQuestionValueType", gettext "Number" appState.locale ) + , ( "DateQuestionValueType", gettext "Date" appState.locale ) + , ( "DateTimeQuestionValueType", gettext "Date Time" appState.locale ) + , ( "TimeQuestionValueType", gettext "Time" appState.locale ) + , ( "TextQuestionValueType", gettext "Text" appState.locale ) + , ( "EmailQuestionValueType", gettext "Email" appState.locale ) + , ( "UrlQuestionValueType", gettext "URL" appState.locale ) + , ( "ColorQuestionValueType", gettext "Color" appState.locale ) ] valueTypeInput = Input.select { name = "valueType" - , label = lg "questionValueType" appState + , label = gettext "Value Type" appState.locale , value = QuestionValueType.toString <| Maybe.withDefault QuestionValueType.default <| Question.getValueType question , options = questionValueTypeOptions , onChange = createTypeEditEvent setValueType << Maybe.withDefault QuestionValueType.default << QuestionValueType.fromString @@ -1009,8 +999,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question integrationUuidOptions = KnowledgeModel.getIntegrations editorBranch.branch.knowledgeModel |> EditorBranch.filterDeletedWith Integration.getUuid editorBranch - |> List.map (\integration -> ( Integration.getUuid integration, String.withDefault (lg "integration.untitled" appState) (Integration.getName integration) )) - |> (::) ( Uuid.toString Uuid.nil, l_ "question.integration.select" appState ) + |> List.map (\integration -> ( Integration.getUuid integration, String.withDefault (gettext "Untitled integration" appState.locale) (Integration.getName integration) )) + |> (::) ( Uuid.toString Uuid.nil, gettext "- select integration -" appState.locale ) selectedIntegrationProps = Question.getIntegrationUuid question @@ -1038,7 +1028,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question in div [ class "form-group" ] [ div [ class "card card-border-light" ] - [ div [ class "card-header" ] [ lx_ "question.integration.configuration" appState ] + [ div [ class "card-header" ] [ text (gettext "Integration Configuration" appState.locale) ] , div [ class "card-body" ] (List.map propInput selectedIntegrationProps) ] @@ -1050,7 +1040,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question integrationUuidInput = Input.select { name = "integrationUuid" - , label = lg "integration" appState + , label = gettext "Integration" appState.locale , value = String.fromMaybe <| Question.getIntegrationUuid question , options = integrationUuidOptions , onChange = createTypeEditEvent setIntegrationUuid @@ -1076,7 +1066,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question choicesInput = Input.reorderable appState { name = "choices" - , label = lg "choices" appState + , label = gettext "Choices" appState.locale , items = EditorBranch.filterDeleted editorBranch <| Question.getChoiceUuids question , entityUuid = questionUuid , getReorderableState = flip Dict.get model.reorderableStates @@ -1084,8 +1074,8 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question , updateList = createTypeEditEvent setChoiceUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getChoiceName editorBranch.branch.knowledgeModel - , untitledLabel = lg "choice.untitled" appState - , addChildLabel = l_ "question.addChoice" appState + , untitledLabel = gettext "Untitled choice" appState.locale + , addChildLabel = gettext "Add choice" appState.locale , addChildMsg = addChoiceEvent , addChildDataCy = "choice" } @@ -1123,7 +1113,7 @@ viewMetricEditor { appState, wrapMsg, eventMsg, model, editorBranch } metric = metricEditorTitle = editorTitle appState - { title = lg "metric" appState + { title = gettext "Metric" appState.locale , uuid = metric.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just MetricState @@ -1133,7 +1123,7 @@ viewMetricEditor { appState, wrapMsg, eventMsg, model, editorBranch } metric = titleInput = Input.string { name = "title" - , label = lg "metric.title" appState + , label = gettext "Title" appState.locale , value = metric.title , onInput = createEditEvent setTitle } @@ -1141,7 +1131,7 @@ viewMetricEditor { appState, wrapMsg, eventMsg, model, editorBranch } metric = abbreviationInput = Input.string { name = "abbreviation" - , label = lg "metric.abbreviation" appState + , label = gettext "Abbreviation" appState.locale , value = Maybe.withDefault "" metric.abbreviation , onInput = createEditEvent setAbbreviation << String.toMaybe } @@ -1149,7 +1139,7 @@ viewMetricEditor { appState, wrapMsg, eventMsg, model, editorBranch } metric = descriptionInput = Input.markdown appState { name = "description" - , label = lg "metric.description" appState + , label = gettext "Description" appState.locale , value = Maybe.withDefault "" metric.description , onInput = createEditEvent setDescription << String.toMaybe , previewMsg = compose2 wrapMsg ShowHideMarkdownPreview @@ -1186,7 +1176,7 @@ viewPhaseEditor { appState, wrapMsg, eventMsg, model, editorBranch } phase = phaseEditorTitle = editorTitle appState - { title = lg "phase" appState + { title = gettext "Phase" appState.locale , uuid = phase.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just PhaseState @@ -1196,7 +1186,7 @@ viewPhaseEditor { appState, wrapMsg, eventMsg, model, editorBranch } phase = titleInput = Input.string { name = "title" - , label = lg "phase.title" appState + , label = gettext "Title" appState.locale , value = phase.title , onInput = createEditEvent setTitle } @@ -1204,7 +1194,7 @@ viewPhaseEditor { appState, wrapMsg, eventMsg, model, editorBranch } phase = descriptionInput = Input.markdown appState { name = "description" - , label = lg "phase.description" appState + , label = gettext "Description" appState.locale , value = Maybe.withDefault "" phase.description , onInput = createEditEvent setDescription << String.toMaybe , previewMsg = compose2 wrapMsg ShowHideMarkdownPreview @@ -1240,7 +1230,7 @@ viewTagEditor { appState, wrapMsg, eventMsg, editorBranch } tag = tagEditorTitle = editorTitle appState - { title = lg "tag" appState + { title = gettext "Tag" appState.locale , uuid = tag.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just TagState @@ -1250,7 +1240,7 @@ viewTagEditor { appState, wrapMsg, eventMsg, editorBranch } tag = nameInput = Input.string { name = "name" - , label = lg "tag.name" appState + , label = gettext "Name" appState.locale , value = tag.name , onInput = createEditEvent setName } @@ -1258,7 +1248,7 @@ viewTagEditor { appState, wrapMsg, eventMsg, editorBranch } tag = descriptionInput = Input.textarea { name = "description" - , label = lg "tag.description" appState + , label = gettext "Description" appState.locale , value = Maybe.withDefault "" tag.description , onInput = createEditEvent setDescription << String.toMaybe } @@ -1266,7 +1256,7 @@ viewTagEditor { appState, wrapMsg, eventMsg, editorBranch } tag = colorInput = Input.color { name = "color" - , label = lg "tag.color" appState + , label = gettext "Color" appState.locale , value = tag.color , onInput = createEditEvent setColor } @@ -1356,13 +1346,13 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB |> EditIntegrationEvent integrationTypeOptions = - [ ( "Api", lg "integrationType.api" appState ) - , ( "Widget", lg "integrationType.widget" appState ) + [ ( "Api", gettext "API" appState.locale ) + , ( "Widget", gettext "Widget" appState.locale ) ] integrationEditorTitle = editorTitle appState - { title = lg "integration" appState + { title = gettext "Integration" appState.locale , uuid = integrationUuid , wrapMsg = wrapMsg , mbDeleteModalState = Just IntegrationState @@ -1372,7 +1362,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB typeInput = Input.select { name = "type" - , label = lg "integration.type" appState + , label = gettext "Type" appState.locale , value = Integration.getTypeString integration , options = integrationTypeOptions , onChange = onTypeChange @@ -1381,7 +1371,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB idInput = Input.string { name = "id" - , label = lg "integration.id" appState + , label = gettext "ID" appState.locale , value = Integration.getId integration , onInput = createEditEvent setId setId } @@ -1389,7 +1379,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB nameInput = Input.string { name = "name" - , label = lg "integration.name" appState + , label = gettext "Name" appState.locale , value = Integration.getName integration , onInput = createEditEvent setName setName } @@ -1397,14 +1387,14 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB logoUrlInput = Input.string { name = "logo" - , label = lg "integration.logo" appState + , label = gettext "Logo URL" appState.locale , value = Integration.getLogo integration , onInput = createEditEvent setLogo setLogo } propsInput = Input.props appState - { label = lg "integration.props" appState + { label = gettext "Props" appState.locale , values = Integration.getProps integration , onChange = createEditEvent setProps setProps } @@ -1412,7 +1402,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB itemUrl = Input.string { name = "itemUrl" - , label = lg "integration.itemUrl" appState + , label = gettext "Item URL" appState.locale , value = Integration.getItemUrl integration , onInput = createEditEvent setItemUrl setItemUrl } @@ -1436,7 +1426,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB requestUrlInput = Input.string { name = "requestUrl" - , label = lg "integration.request.url" appState + , label = gettext "Request URL" appState.locale , value = data.requestUrl , onInput = createTypeEditEvent setRequestUrl } @@ -1444,7 +1434,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB requestMethodInput = Input.select { name = "requestMethod" - , label = lg "integration.request.method" appState + , label = gettext "Request HTTP Method" appState.locale , value = data.requestMethod , options = httpMethodOptions , onChange = createTypeEditEvent setRequestMethod @@ -1452,7 +1442,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB requestHeadersInput = Input.headers appState - { label = lg "integration.request.headers" appState + { label = gettext "Request HTTP Headers" appState.locale , headers = data.requestHeaders , onEdit = createTypeEditEvent setRequestHeaders } @@ -1460,7 +1450,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB requestBodyInput = Input.textarea { name = "requestBody" - , label = lg "integration.request.body" appState + , label = gettext "Request HTTP Body" appState.locale , value = data.requestBody , onInput = createTypeEditEvent setRequestBody } @@ -1468,7 +1458,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB requestEmptySearchInput = Input.checkbox { name = "requestEmptySearch" - , label = lg "integration.request.emptySearch" appState + , label = gettext "Allow Empty Search" appState.locale , value = data.requestEmptySearch , onInput = createTypeEditEvent setRequestEmptySearch } @@ -1476,7 +1466,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB responseItemId = Input.string { name = "responseItemId" - , label = lg "integration.response.idField" appState + , label = gettext "Response Item ID" appState.locale , value = data.responseItemId , onInput = createTypeEditEvent setResponseItemId } @@ -1484,7 +1474,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB responseListFieldInput = Input.string { name = "responseListField" - , label = lg "integration.response.listField" appState + , label = gettext "Response List Field" appState.locale , value = data.responseListField , onInput = createTypeEditEvent setResponseListField } @@ -1492,38 +1482,38 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB responseItemTemplate = Input.textarea { name = "responseItemTemplate" - , label = lg "integration.response.itemTemplate" appState + , label = gettext "Response Item Template" appState.locale , value = data.responseItemTemplate , onInput = createTypeEditEvent setResponseItemTemplate } in [ div [ class "card card-border-light mb-5" ] - [ div [ class "card-header" ] [ lgx "integration.request" appState ] + [ div [ class "card-header" ] [ text (gettext "Request" appState.locale) ] , div [ class "card-body" ] - [ Markdown.toHtml [ class "alert alert-info mb-5" ] (l_ "integration.request.description" appState) + [ Markdown.toHtml [ class "alert alert-info mb-5" ] (gettext "Use this section to configure the search request. The service you want to integrate has to provide a search HTTP API where you send a search string and it returns a JSON with found items." appState.locale) , requestUrlInput - , FormExtra.mdAfter (l_ "integration.requestUrl.description" appState) + , FormExtra.mdAfter (gettext "A URL of the integrated service API that supports the search. Use `${q}` for the actual string that will be filled when users search for items, such as *ht​tps://example.com/search?q=${q}*." appState.locale) , requestMethodInput , requestHeadersInput , requestBodyInput , requestEmptySearchInput - , FormExtra.mdAfter (l_ "integration.requestEmptySearch.description" appState) + , FormExtra.mdAfter (gettext "Turn this off if the API cannot handle empty search requests. In that case, the requests will be made only after users type something." appState.locale) ] ] , div [ class "card card-border-light mb-5" ] - [ div [ class "card-header" ] [ lgx "integration.response" appState ] + [ div [ class "card-header" ] [ text (gettext "Response" appState.locale) ] , div [ class "card-body" ] - [ Markdown.toHtml [ class "alert alert-info mb-5" ] (l_ "integration.response.description" appState) + [ Markdown.toHtml [ class "alert alert-info mb-5" ] (gettext "Use this section to configure how to process the response returned from the search API." appState.locale) , responseListFieldInput - , FormExtra.mdAfter (l_ "integration.responseListField.description" appState) + , FormExtra.mdAfter (gettext "If the returned JSON is not an array of items directly but the items are nested, use this to define the name or path to the field in the response that contains the list of items. Keep empty otherwise." appState.locale) , responseItemId - , FormExtra.mdAfter (l_ "integration.responseItemId.description" appState) + , FormExtra.mdAfter (gettext "Use this to define an identifier for the item. This will be used in **Item URL** as `${id}` to compose a URL to the found item. You can use properties from the returned item in Jinja2 notation. For example, if the item has a field `id` use `{{item.id}}` here. You can also compose multiple fields together, e.g., `{{item.field1}}-{{item.field2}}`." appState.locale) , responseItemTemplate - , FormExtra.mdAfter (l_ "integration.responseItemTemplate.description" appState) + , FormExtra.mdAfter (gettext "This defines how the found items will be displayed for the user. You can use properties from the returned item in Jinja2 notation, you can also use Markdown for some formatting. For example, if the returned item has a field called name, you can use `**{{item.name}}**` to display the name in bold." appState.locale) ] ] , itemUrl - , FormExtra.mdAfter (l_ "integration.itemUrl.api.description" appState) + , FormExtra.mdAfter (gettext "Defines the URL to the selected item. Use `${id}` to get the value defined in **Response Item ID** field, for example `https://example.com/${id}`." appState.locale) ] WidgetIntegration _ data -> @@ -1537,15 +1527,15 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB widgetUrlInput = Input.string { name = "widgetUrl" - , label = lg "integration.widgetUrl" appState + , label = gettext "Widget URL" appState.locale , value = data.widgetUrl , onInput = createTypeEditEvent setWidgetUrl } in [ widgetUrlInput - , FormExtra.mdAfter (l_ "integration.widgetUrl.description" appState) + , FormExtra.mdAfter (gettext "The URL of the widget implemented using [DSW Integration Widget SDK](https://github.com/ds-wizard/dsw-integration-widget-sdk)." appState.locale) , itemUrl - , FormExtra.mdAfter (l_ "integration.itemUrl.widget.description" appState) + , FormExtra.mdAfter (gettext "Defines the URL to the selected item. Use `${id}` value returned from the widget, for example `https://example.com/${id}`." appState.locale) ] viewQuestionLink question = @@ -1558,7 +1548,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB wrapQuestionsWithIntegration questions = if List.isEmpty questions then - div [] [ i [] [ lx_ "integration.questions.noQuestions" appState ] ] + div [] [ i [] [ text (gettext "No questions" appState.locale) ] ] else ul [] questions @@ -1593,7 +1583,7 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB ] in div [ class "prefab-selection" ] - [ strong [] [ lx_ "integration.quickSetup" appState ] + [ strong [] [ text (gettext "Quick setup" appState.locale) ] , ul [] (List.map viewIntegrationButton <| List.sortBy Integration.getName integrationPrefabs) ] @@ -1605,17 +1595,17 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB , prefabsView , typeInput , idInput - , FormExtra.mdAfter (l_ "integration.id.description" appState) + , FormExtra.mdAfter (gettext "A string that identifies the integration. It has to be unique for each integration." appState.locale) , nameInput - , FormExtra.mdAfter (l_ "integration.name.description" appState) + , FormExtra.mdAfter (gettext "A name visible everywhere else in the KM Editor, such as when choosing the integration for a question." appState.locale) , logoUrlInput - , FormExtra.mdAfter (l_ "integration.logo.description" appState) + , FormExtra.mdAfter (gettext "Logo is displayed next to the link to the selected item in questionnaires. It can be either URL or base64 image." appState.locale) , propsInput - , FormExtra.mdAfter (l_ "integration.props.description" appState) + , FormExtra.mdAfter (gettext "Props can be used to parametrize the integration for each question. Use this to define the props whose value can be filled on the questions using this integration. The props can then be used in the URL configuration. For example, if you define prop named *type*, you can use it as `${type}`, such as *ht​tps://example.com/${type}*." appState.locale) ] ++ integrationTypeInputs ++ [ annotationsInput - , FormGroup.plainGroup questionsWithIntegration (l_ "integration.questions.label" appState) + , FormGroup.plainGroup questionsWithIntegration (gettext "Questions using this integration" appState.locale) ] ) @@ -1639,7 +1629,7 @@ viewAnswerEditor { appState, wrapMsg, eventMsg, model, editorBranch } answer = answerEditorTitle = editorTitle appState - { title = lg "answer" appState + { title = gettext "Answer" appState.locale , uuid = answer.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just AnswerState @@ -1649,7 +1639,7 @@ viewAnswerEditor { appState, wrapMsg, eventMsg, model, editorBranch } answer = labelInput = Input.string { name = "label" - , label = lg "answer.label" appState + , label = gettext "Label" appState.locale , value = answer.label , onInput = createEditEvent setLabel } @@ -1657,7 +1647,7 @@ viewAnswerEditor { appState, wrapMsg, eventMsg, model, editorBranch } answer = adviceInput = Input.markdown appState { name = "advice" - , label = lg "answer.advice" appState + , label = gettext "Advice" appState.locale , value = String.fromMaybe answer.advice , onInput = createEditEvent setAdvice << String.toMaybe , previewMsg = compose2 wrapMsg ShowHideMarkdownPreview @@ -1668,7 +1658,7 @@ viewAnswerEditor { appState, wrapMsg, eventMsg, model, editorBranch } answer = followUpsInput = Input.reorderable appState { name = "questions" - , label = lg "followupQuestions" appState + , label = gettext "Follow-Up Questions" appState.locale , items = EditorBranch.filterDeleted editorBranch answer.followUpUuids , entityUuid = answer.uuid , getReorderableState = flip Dict.get model.reorderableStates @@ -1676,8 +1666,8 @@ viewAnswerEditor { appState, wrapMsg, eventMsg, model, editorBranch } answer = , updateList = createEditEvent setFollowUpUuids , getRoute = editorRoute editorBranch , getName = KnowledgeModel.getQuestionName editorBranch.branch.knowledgeModel - , untitledLabel = lg "question.untitled" appState - , addChildLabel = l_ "answer.addQuestion" appState + , untitledLabel = gettext "Untitled question" appState.locale + , addChildLabel = gettext "Add question" appState.locale , addChildMsg = questionAddEvent , addChildDataCy = "question" } @@ -1727,7 +1717,7 @@ viewChoiceEditor { appState, wrapMsg, eventMsg, editorBranch } choice = choiceEditorTitle = editorTitle appState - { title = lg "choice" appState + { title = gettext "Choice" appState.locale , uuid = choice.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just ChoiceState @@ -1737,7 +1727,7 @@ viewChoiceEditor { appState, wrapMsg, eventMsg, editorBranch } choice = labelInput = Input.string { name = "label" - , label = lg "choice.label" appState + , label = gettext "Label" appState.locale , value = choice.label , onInput = createEditEvent setLabel } @@ -1776,13 +1766,13 @@ viewReferenceEditor { appState, wrapMsg, eventMsg, editorBranch } reference = |> (EditReferenceEvent << EditReferenceURLEvent) referenceTypeOptions = - [ ( "ResourcePage", lg "referenceType.resourcePage" appState ) - , ( "URL", lg "referenceType.url" appState ) + [ ( "ResourcePage", gettext "Resource Page" appState.locale ) + , ( "URL", gettext "URL" appState.locale ) ] referenceEditorTitle = editorTitle appState - { title = lg "reference" appState + { title = gettext "Reference" appState.locale , uuid = Reference.getUuid reference , wrapMsg = wrapMsg , mbDeleteModalState = Just ReferenceState @@ -1792,7 +1782,7 @@ viewReferenceEditor { appState, wrapMsg, eventMsg, editorBranch } reference = typeInput = Input.select { name = "type" - , label = lg "referenceType" appState + , label = gettext "Reference Type" appState.locale , value = Reference.getTypeString reference , options = referenceTypeOptions , onChange = onTypeChange @@ -1811,7 +1801,7 @@ viewReferenceEditor { appState, wrapMsg, eventMsg, editorBranch } reference = shortUuidInput = Input.string { name = "shortUuid" - , label = lg "reference.shortUuid" appState + , label = gettext "Short UUID" appState.locale , value = data.shortUuid , onInput = createTypeEditEvent setShortUuid } @@ -1835,7 +1825,7 @@ viewReferenceEditor { appState, wrapMsg, eventMsg, editorBranch } reference = urlInput = Input.string { name = "url" - , label = lg "reference.url" appState + , label = gettext "URL" appState.locale , value = data.url , onInput = createTypeEditEvent setUrl } @@ -1843,7 +1833,7 @@ viewReferenceEditor { appState, wrapMsg, eventMsg, editorBranch } reference = labelInput = Input.string { name = "label" - , label = lg "reference.label" appState + , label = gettext "Label" appState.locale , value = data.label , onInput = createTypeEditEvent setLabel } @@ -1884,7 +1874,7 @@ viewExpertEditor { appState, wrapMsg, eventMsg, editorBranch } expert = expertEditorTitle = editorTitle appState - { title = lg "expert" appState + { title = gettext "Expert" appState.locale , uuid = expert.uuid , wrapMsg = wrapMsg , mbDeleteModalState = Just ExpertState @@ -1894,7 +1884,7 @@ viewExpertEditor { appState, wrapMsg, eventMsg, editorBranch } expert = nameInput = Input.string { name = "name" - , label = lg "expert.name" appState + , label = gettext "Name" appState.locale , value = expert.name , onInput = createEditEvent setName } @@ -1902,7 +1892,7 @@ viewExpertEditor { appState, wrapMsg, eventMsg, editorBranch } expert = emailInput = Input.string { name = "email" - , label = lg "expert.email" appState + , label = gettext "Email" appState.locale , value = expert.email , onInput = createEditEvent setEmail } @@ -1924,7 +1914,7 @@ viewExpertEditor { appState, wrapMsg, eventMsg, editorBranch } expert = viewEmptyEditor : AppState -> Html msg viewEmptyEditor appState = editor "empty" - [ Flash.error appState (l_ "empty" appState) + [ Flash.error appState (gettext "The knowledge model entity you are trying to open does not exist." appState.locale) ] @@ -1955,7 +1945,7 @@ editorTitle appState config = ([ class "btn btn-link with-icon" , onClick <| config.wrapMsg <| CopyUuid config.uuid ] - ++ tooltip (l_ "editorTitle.copyUuid" appState) + ++ tooltip (gettext "Click to copy UUID" appState.locale) ) [ faSet "kmEditor.copyUuid" appState , small [] [ text <| String.slice 0 8 config.uuid ] @@ -1970,7 +1960,7 @@ editorTitle appState config = , dataCy "km-editor_move-button" ] [ faSet "kmEditor.move" appState - , lx_ "editorTitle.move" appState + , text (gettext "Move" appState.locale) ] Nothing -> @@ -1985,7 +1975,7 @@ editorTitle appState config = , onClick <| config.wrapMsg <| SetDeleteModalState <| deleteModalState config.uuid ] [ faSet "_global.delete" appState - , lx_ "editorTitle.delete" appState + , text (gettext "Delete" appState.locale) ] Nothing -> @@ -2016,70 +2006,70 @@ deleteModal appState wrapMsg eventMsg editorBranch deleteModalState = ChapterState uuid -> ( True , getContent - (l_ "deleteModal.chapter" appState) + (gettext "Are you sure you want to delete this chapter?" appState.locale) (createEvent DeleteChapterEvent uuid) ) QuestionState uuid -> ( True , getContent - (l_ "deleteModal.question" appState) + (gettext "Are you sure you want to delete this question?" appState.locale) (createEvent DeleteQuestionEvent uuid) ) MetricState uuid -> ( True , getContent - (l_ "deleteModal.metric" appState) + (gettext "Are you sure you want to delete this metric?" appState.locale) (createEvent DeleteMetricEvent uuid) ) PhaseState uuid -> ( True , getContent - (l_ "deleteModal.phase" appState) + (gettext "Are you sure you want to delete this phase?" appState.locale) (createEvent DeletePhaseEvent uuid) ) TagState uuid -> ( True , getContent - (l_ "deleteModal.tag" appState) + (gettext "Are you sure you want to delete this question tag?" appState.locale) (createEvent DeleteTagEvent uuid) ) IntegrationState uuid -> ( True , getContent - (l_ "deleteModal.integration" appState) + (gettext "Are you sure you want to delete this integration?" appState.locale) (createEvent DeleteIntegrationEvent uuid) ) AnswerState uuid -> ( True , getContent - (l_ "deleteModal.answer" appState) + (gettext "Are you sure you want to delete this answer?" appState.locale) (createEvent DeleteAnswerEvent uuid) ) ChoiceState uuid -> ( True , getContent - (l_ "deleteModal.choice" appState) + (gettext "Are you sure you want to delete this choice?" appState.locale) (createEvent DeleteChoiceEvent uuid) ) ReferenceState uuid -> ( True , getContent - (l_ "deleteModal.reference" appState) + (gettext "Are you sure you want to delete this reference?" appState.locale) (createEvent DeleteReferenceEvent uuid) ) ExpertState uuid -> ( True , getContent - (l_ "deleteModal.expert" appState) + (gettext "Are you sure you want to delete this expert?" appState.locale) (createEvent DeleteExpertEvent uuid) ) @@ -2088,7 +2078,7 @@ deleteModal appState wrapMsg eventMsg editorBranch deleteModalState = getContent contentText onDelete = [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ lx_ "deleteModal.title" appState ] + [ h5 [ class "modal-title" ] [ text (gettext "Heads up!" appState.locale) ] ] , div [ class "modal-body" ] [ text contentText ] @@ -2098,13 +2088,13 @@ deleteModal appState wrapMsg eventMsg editorBranch deleteModalState = , dataCy "modal_action-button" , onClick onDelete ] - [ lx_ "deleteModal.delete" appState ] + [ text (gettext "Delete" appState.locale) ] , button [ class "btn btn-secondary" , dataCy "modal_cancel-button" , onClick <| wrapMsg <| SetDeleteModalState Closed ] - [ lx_ "deleteModal.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] ] ] @@ -2162,10 +2152,10 @@ moveModal appState wrapMsg eventMsg editorBranch mbMoveModalState = createEvent MoveExpertEvent in [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ lx_ "moveModal.title" appState ] + [ h5 [ class "modal-title" ] [ text (gettext "Move" appState.locale) ] ] , div [ class "modal-body" ] - [ label [] [ lx_ "moveModal.label" appState ] + [ label [] [ text (gettext "Select a new parent" appState.locale) ] , Html.map (wrapMsg << MoveModalMsg) <| TreeInput.view appState viewProps moveModalState.treeInputModel ] , div [ class "modal-footer" ] @@ -2175,13 +2165,13 @@ moveModal appState wrapMsg eventMsg editorBranch mbMoveModalState = , disabled (String.isEmpty selectedUuid) , dataCy "modal_action-button" ] - [ lx_ "moveModal.move" appState ] + [ text (gettext "Move" appState.locale) ] , button [ class "btn btn-secondary" , onClick <| wrapMsg CloseMoveModal , dataCy "modal_cancel-button" ] - [ lx_ "moveModal.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Input.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Input.elm index aa1ccbd5b..dd16e6036 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Input.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Input.elm @@ -24,6 +24,7 @@ module Wizard.KMEditor.Editor.Components.KMEditor.Input exposing , textarea ) +import Gettext exposing (gettext) import Html exposing (Html, a, div, input, label, li, option, span, text, ul) import Html.Attributes exposing (attribute, checked, class, classList, for, id, name, placeholder, rows, selected, step, style, type_, value) import Html.Events exposing (onCheck, onClick, onInput) @@ -37,7 +38,6 @@ import Shared.Data.KnowledgeModel.Metric exposing (Metric) import Shared.Data.KnowledgeModel.MetricMeasure as MetricMeasure exposing (MetricMeasure) import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Html exposing (faSet) -import Shared.Locale exposing (lg, lgx, lx) import Shared.Markdown as Markdown import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) @@ -46,11 +46,6 @@ import Wizard.Common.View.Tag as Tag import Wizard.Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.KMEditor.Input" - - -- Basic Inputs @@ -210,7 +205,7 @@ markdown appState config = , class "nav-link" , classList [ ( "active", not previewActive ) ] ] - [ lx_ "markdown.editor" appState ] + [ text (gettext "Editor" appState.locale) ] ] , li [ class "nav-item" ] [ a @@ -218,13 +213,13 @@ markdown appState config = , class "nav-link" , classList [ ( "active", previewActive ) ] ] - [ lx_ "markdown.preview" appState ] + [ text (gettext "Preview" appState.locale) ] ] ] ] , div [ class "card-body" ] [ content ] , div [ class "card-footer text-muted" ] - [ lx_ "markdown.description" appState ] + [ text (gettext "You can use markdown and see the result in the preview tab." appState.locale) ] ] ] @@ -358,7 +353,7 @@ annotations appState config = , value annotation.key , onInput (config.onEdit << updateKeyAt i) , class "form-control" - , placeholder (lg "annotations.key" appState) + , placeholder (gettext "Key" appState.locale) , dataCy "annotation_key" ] [] @@ -366,7 +361,7 @@ annotations appState config = [ value annotation.value , onInput (config.onEdit << updateValAt i) , class "form-control" - , placeholder (lg "annotations.value" appState) + , placeholder (gettext "Value" appState.locale) , dataCy "annotation_value" , grammarlyAttribute , rows lines @@ -390,11 +385,11 @@ annotations appState config = , onClick (config.onEdit (config.annotations ++ [ Annotation.new ])) ] [ faSet "_global.add" appState - , lx_ "annotations.add" appState + , text (gettext "Add annotation" appState.locale) ] in div [ class "form-group" ] - [ label [] [ lgx "annotations" appState ] + [ label [] [ text (gettext "Annotations" appState.locale) ] , Html.Keyed.node "div" [] (List.indexedMap viewAnnotation config.annotations) , addAnnotation ] @@ -512,13 +507,13 @@ metrics appState config = ] ] , div [ class "metric-view-inputs", classList [ ( "metric-view-inputs-enabled", enabled ) ] ] - [ valueField (lg "metric.weight" appState) "weight" onWeightChange .weight - , valueField (lg "metric.measure" appState) "measure" onMeasureChange .measure + [ valueField (gettext "Weight" appState.locale) "weight" onWeightChange .weight + , valueField (gettext "Measure" appState.locale) "measure" onMeasureChange .measure ] ] in div [ class "form-group" ] - [ label [] [ lgx "metrics" appState ] + [ label [] [ text (gettext "Metrics" appState.locale) ] , div [] (List.map metricView config.metrics) ] @@ -637,7 +632,7 @@ props appState config = , class "with-icon" ] [ faSet "_global.add" appState - , lx_ "props.add" appState + , text (gettext "Add" appState.locale) ] in div [ class "form-group" ] @@ -688,7 +683,7 @@ headers appState config = [ type_ "text" , value header.key , onInput (config.onEdit << updateKeyAt i) - , placeholder (lg "integration.header.name" appState) + , placeholder (gettext "Header Name" appState.locale) , class "form-control" , dataCy "integration-input_name" ] @@ -697,7 +692,7 @@ headers appState config = [ type_ "text" , value header.value , onInput (config.onEdit << updateValAt i) - , placeholder (lg "integration.header.value" appState) + , placeholder (gettext "Header Value" appState.locale) , class "form-control" , dataCy "integration-input_value" ] @@ -718,7 +713,7 @@ headers appState config = , dataCy "integration-input_add-button" ] [ faSet "_global.add" appState - , lx_ "headers.add" appState + , text (gettext "Add" appState.locale) ] in div [ class "form-group" ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm index 2c0de6f3d..125a69707 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm @@ -3,6 +3,7 @@ module Wizard.KMEditor.Editor.Components.KMEditor.Tree exposing , view ) +import Gettext exposing (gettext) import Html exposing (Html, a, div, i, li, span, text, ul) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) @@ -18,7 +19,6 @@ import Shared.Data.KnowledgeModel.Question as Question exposing (Question) import Shared.Data.KnowledgeModel.Reference as Reference exposing (Reference) import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Html exposing (emptyNode, faKeyClass, faSet) -import Shared.Locale exposing (lg, lx) import Uuid import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) @@ -27,11 +27,6 @@ import Wizard.KMEditor.Editor.Common.EditorBranch as EditorBranch exposing (Edit import Wizard.Routes as Routes -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.KMEditor.Tree" - - type alias ViewProps msg = { expandAll : msg , collapseAll : msg @@ -47,11 +42,11 @@ view props appState editorBranch = [ div [ class "actions" ] [ a [ onClick props.expandAll ] [ faSet "kmEditor.expandAll" appState - , lx_ "expandAll" appState + , text (gettext "Expand all" appState.locale) ] , a [ onClick props.collapseAll ] [ faSet "kmEditor.collapseAll" appState - , lx_ "collapseAll" appState + , text (gettext "Collapse all" appState.locale) ] ] , ul [] [ treeNodeKM props appState editorBranch ] @@ -118,7 +113,7 @@ treeNodeChapter props appState editorBranch chapter = , icon = faSet "km.chapter" appState , label = chapter.title , children = questions - , untitledLabel = lg "chapter.untitled" appState + , untitledLabel = gettext "Untitled chapter" appState.locale } in treeNode props appState editorBranch config @@ -132,7 +127,7 @@ treeNodeMetric props appState editorBranch metric = , icon = faSet "km.metric" appState , label = metric.title , children = [] - , untitledLabel = lg "metric.untitled" appState + , untitledLabel = gettext "Untitled metric" appState.locale } in treeNode props appState editorBranch config @@ -146,7 +141,7 @@ treeNodePhase props appState editorBranch phase = , icon = faSet "km.phase" appState , label = phase.title , children = [] - , untitledLabel = lg "phase.untitled" appState + , untitledLabel = gettext "Untitled phase" appState.locale } in treeNode props appState editorBranch config @@ -160,7 +155,7 @@ treeNodeTag props appState editorBranch tag = , icon = faSet "km.tag" appState , label = tag.name , children = [] - , untitledLabel = lg "tag.untitled" appState + , untitledLabel = gettext "Untitled tag" appState.locale } in treeNode props appState editorBranch config @@ -174,7 +169,7 @@ treeNodeIntegration props appState editorBranch integration = , icon = faSet "km.integration" appState , label = Integration.getName integration , children = [] - , untitledLabel = lg "integration.untitled" appState + , untitledLabel = gettext "Untitled integration" appState.locale } in treeNode props appState editorBranch config @@ -216,7 +211,7 @@ treeNodeQuestion props appState editorBranch question = , icon = faSet "km.question" appState , label = Question.getTitle question , children = answers ++ itemTemplateQuestions ++ choices ++ references ++ experts - , untitledLabel = lg "question.untitled" appState + , untitledLabel = gettext "Untitled question" appState.locale } in treeNode props appState editorBranch config @@ -235,7 +230,7 @@ treeNodeAnswer props appState editorBranch answer = , icon = faSet "km.answer" appState , label = answer.label , children = followupQuestions - , untitledLabel = lg "answer.untitled" appState + , untitledLabel = gettext "Untitled answer" appState.locale } in treeNode props appState editorBranch config @@ -249,7 +244,7 @@ treeNodeChoice props appState editorBranch choice = , icon = faSet "km.choice" appState , label = choice.label , children = [] - , untitledLabel = lg "choice.untitled" appState + , untitledLabel = gettext "Untitled choice" appState.locale } in treeNode props appState editorBranch config @@ -263,7 +258,7 @@ treeNodeReference props appState editorBranch reference = , icon = faSet "km.reference" appState , label = Reference.getVisibleName reference , children = [] - , untitledLabel = lg "reference.untitled" appState + , untitledLabel = gettext "Untitled reference" appState.locale } in treeNode props appState editorBranch config @@ -277,7 +272,7 @@ treeNodeExperts props appState editorBranch expert = , icon = faSet "km.expert" appState , label = Expert.getVisibleName expert , children = [] - , untitledLabel = lg "expert.untitled" appState + , untitledLabel = gettext "Untitled expert" appState.locale } in treeNode props appState editorBranch config diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/TreeInput.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/TreeInput.elm index 8322b3147..76422387c 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/TreeInput.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/TreeInput.elm @@ -8,6 +8,7 @@ module Wizard.KMEditor.Editor.Components.KMEditor.TreeInput exposing , view ) +import Gettext exposing (gettext) import Html exposing (Html, a, div, i, li, span, text, ul) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) @@ -17,18 +18,12 @@ import Shared.Data.KnowledgeModel.Answer exposing (Answer) import Shared.Data.KnowledgeModel.Chapter exposing (Chapter) import Shared.Data.KnowledgeModel.Question as Question exposing (Question) import Shared.Html exposing (emptyNode, faKeyClass, faSet) -import Shared.Locale exposing (lg, lx) import Uuid import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.KMEditor.Editor.Common.EditorBranch as EditorBranch exposing (EditorBranch) -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.KMEditor.TreeInput" - - type alias Model = { selected : String , treeOpenUuids : Set String @@ -101,14 +96,14 @@ view appState props model = [ div [ class "diff-tree-input-actions" ] [ a [ onClick ExpandAll ] [ faSet "kmEditor.expandAll" appState - , lx_ "expandAll" appState + , text (gettext "Expand all" appState.locale) ] , a [ onClick CollapseAll , dataCy "km-editor_move-modal_collapse-all" ] [ faSet "kmEditor.collapseAll" appState - , lx_ "collapseAll" appState + , text (gettext "Collapse all" appState.locale) ] ] , div [ class "diff-tree diff-tree-input" ] @@ -163,7 +158,7 @@ treeNodeChapter appState props model chapter = , icon = faSet "km.chapter" appState , label = chapter.title , children = questions - , untitledLabel = lg "chapter.untitled" appState + , untitledLabel = gettext "Untitled chapter" appState.locale , allowed = allowed , open = isTreeOpen chapter.uuid model , selected = isSelected chapter.uuid model @@ -210,7 +205,7 @@ treeNodeQuestion appState props model isChild question = , icon = faSet "km.question" appState , label = Question.getTitle question , children = answers ++ itemTemplateQuestions - , untitledLabel = lg "question.untitled" appState + , untitledLabel = gettext "Untitled question" appState.locale , allowed = allowed , open = isTreeOpen uuid model , selected = isSelected uuid model @@ -241,7 +236,7 @@ treeNodeAnswer appState props model isChild answer = , icon = faSet "km.answer" appState , label = answer.label , children = followupQuestions - , untitledLabel = lg "answer.untitled" appState + , untitledLabel = gettext "Untitled answer" appState.locale , allowed = allowed , open = isTreeOpen answer.uuid model , selected = isSelected answer.uuid model diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Preview.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Preview.elm index 2bcc0caf2..95aa5cad1 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Preview.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Preview.elm @@ -10,7 +10,8 @@ module Wizard.KMEditor.Editor.Components.Preview exposing , view ) -import Html exposing (Html, a, div, strong) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, strong, text) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) import Maybe.Extra as Maybe @@ -20,7 +21,6 @@ import Shared.Data.KnowledgeModel as KnowledgeModel exposing (KnowledgeModel) import Shared.Data.Package as Package import Shared.Data.QuestionnaireDetail as QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (lgx, lx) import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire as Questionnaire exposing (ActivePage(..)) @@ -30,11 +30,6 @@ import Wizard.Common.View.Tag as Tag import Wizard.KMEditor.Editor.Common.EditorBranch as EditorBranch exposing (EditorBranch) -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.Preview" - - type alias Model = { questionnaireModel : Questionnaire.Model , tags : Set String @@ -209,9 +204,9 @@ tagSelection appState selected knowledgeModel = in div [ class "tag-selection" ] [ div [ class "tag-selection-header" ] - [ strong [] [ lgx "tags" appState ] - , a [ onClick SelectAllTags, dataCy "km-editor_preview_tags_select-all" ] [ lx_ "tags.selectAll" appState ] - , a [ onClick SelectNoneTags, dataCy "km-editor_preview_tags_select-none" ] [ lx_ "tags.selectNone" appState ] + [ strong [] [ text (gettext "Tags" appState.locale) ] + , a [ onClick SelectAllTags, dataCy "km-editor_preview_tags_select-all" ] [ text (gettext "Select all" appState.locale) ] + , a [ onClick SelectNoneTags, dataCy "km-editor_preview_tags_select-none" ] [ text (gettext "Select none" appState.locale) ] ] , Tag.list appState tagListConfig tags ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Settings.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Settings.elm index 2a9c96b12..f9b97b525 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Settings.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/Settings.elm @@ -10,7 +10,8 @@ module Wizard.KMEditor.Editor.Components.Settings exposing import ActionResult exposing (ActionResult) import Form exposing (Form) -import Html exposing (Html, br, button, div, h2, hr, p, strong) +import Gettext exposing (gettext) +import Html exposing (Html, br, button, div, h2, hr, p, strong, text) import Html.Attributes exposing (class) import Html.Events exposing (onClick) import Shared.Api.Branches as BranchesApi @@ -21,7 +22,6 @@ import Shared.Data.PackageSuggestion as PackageSuggestion import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lx) import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput.TypeHintItem as TypeHintItem @@ -39,16 +39,6 @@ import Wizard.Ports as Ports import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.Components.Settings" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.Components.Settings" - - type alias Model = { form : Form FormError BranchEditForm , savingBranch : ActionResult String @@ -109,7 +99,7 @@ update cfg appState msg model = ) Err error -> - ( { model | savingBranch = ApiError.toActionResult appState (lg "apiError.branches.putError" appState) error } + ( { model | savingBranch = ApiError.toActionResult appState (gettext "Knowledge Model could not be saved." appState.locale) error } , Cmd.none ) @@ -153,13 +143,13 @@ view appState branchDetail model = in div [ class "KMEditor__Editor__SettingsEditor", dataCy "km-editor_settings" ] [ div [ detailClass "" ] - ([ Page.header (l_ "title" appState) [] + ([ Page.header (gettext "Settings" appState.locale) [] , div [] [ FormResult.errorOnlyView appState model.savingBranch - , Html.map FormMsg <| FormGroup.input appState model.form "name" (l_ "form.name" appState) - , Html.map FormMsg <| FormGroup.input appState model.form "kmId" (l_ "form.kmId" appState) + , Html.map FormMsg <| FormGroup.input appState model.form "name" (gettext "Name" appState.locale) + , Html.map FormMsg <| FormGroup.input appState model.form "kmId" (gettext "Knowledge Model ID" appState.locale) , FormActions.viewActionOnly appState - (ActionButton.ButtonConfig (l_ "form.save" appState) model.savingBranch (FormMsg Form.Submit) False) + (ActionButton.ButtonConfig (gettext "Save" appState.locale) model.savingBranch (FormMsg Form.Submit) False) ] ] ++ parentKnowledgeModelView @@ -179,19 +169,19 @@ parentKnowledgeModel appState branchState forkOfPackage branchDetail = case branchState of BranchState.Outdated -> div [ class "alert alert-warning mt-2 d-flex justify-content-between align-items-center" ] - [ div [] [ lx_ "parent.warning" appState ] + [ div [] [ text (gettext "This is not the latest version of the parent knowledge model." appState.locale) ] , button [ class "btn btn-warning" , onClick (UpgradeModalMsg (UpgradeModal.open branchDetail.uuid branchDetail.name forkOfPackage.id)) ] - [ lx_ "parent.upgrade" appState ] + [ text (gettext "Upgrade" appState.locale) ] ] _ -> emptyNode in div [] - [ h2 [] [ lx_ "parent.title" appState ] + [ h2 [] [ text (gettext "Parent Knowledge Model" appState.locale) ] , linkTo appState (Routes.knowledgeModelsDetail forkOfPackage.id) [ class "package-link" ] @@ -203,19 +193,19 @@ parentKnowledgeModel appState branchState forkOfPackage branchDetail = dangerZone : AppState -> BranchDetail -> Html Msg dangerZone appState branchDetail = div [] - [ h2 [] [ lx_ "dangerZone.title" appState ] + [ h2 [] [ text (gettext "Danger Zone" appState.locale) ] , div [ class "card border-danger mt-3" ] [ div [ class "card-body d-flex justify-content-between align-items-center" ] [ p [ class "card-text" ] - [ strong [] [ lx_ "dangerZone.deleteText" appState ] + [ strong [] [ text (gettext "Delete this knowledge model editor" appState.locale) ] , br [] [] - , lx_ "dangerZone.deleteWarning" appState + , text (gettext "Deleted knowledge model editors cannot be recovered." appState.locale) ] , button [ class "btn btn-outline-danger" , onClick (DeleteModalMsg (DeleteModal.open branchDetail.uuid branchDetail.name)) ] - [ lx_ "dangerZone.delete" appState ] + [ text (gettext "Delete" appState.locale) ] ] ] ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/TagEditor.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/TagEditor.elm index be8d8f31d..6914c6360 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/TagEditor.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/TagEditor.elm @@ -8,6 +8,7 @@ module Wizard.KMEditor.Editor.Components.TagEditor exposing ) import Dict +import Gettext exposing (gettext) import Html exposing (Attribute, Html, div, input, label, table, tbody, td, text, th, thead, tr) import Html.Attributes exposing (checked, class, classList, style, type_) import Html.Events exposing (onClick, onMouseOut, onMouseOver) @@ -27,7 +28,6 @@ import Shared.Data.KnowledgeModel.Chapter exposing (Chapter) import Shared.Data.KnowledgeModel.Question as Question exposing (Question(..)) import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lg) import Shared.Utils exposing (getContrastColorHex) import String.Extra as String import Wizard.Common.AppState exposing (AppState) @@ -36,11 +36,6 @@ import Wizard.Common.View.Flash as Flash import Wizard.KMEditor.Editor.Common.EditorBranch as EditorBranch exposing (EditorBranch) -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.Components.TagEditor" - - type alias Model = { highlightedTagUuid : Maybe String } @@ -111,10 +106,10 @@ view appState wrapMsg eventMsg editorBranch model = content = if List.isEmpty editorBranch.branch.knowledgeModel.tagUuids then - Flash.info appState (l_ "noTags" appState) + Flash.info appState (gettext "There are no question tags, create them first." appState.locale) else if Dict.isEmpty editorBranch.branch.knowledgeModel.entities.questions then - Flash.info appState (l_ "noQuestions" appState) + Flash.info appState (gettext "There are no questions create them first." appState.locale) else let @@ -170,7 +165,7 @@ thTag appState model tag = ( untitled, tagName ) = if String.isEmpty tag.name then - ( True, lg "tag.untitled" appState ) + ( True, gettext "Untitled tag" appState.locale ) else ( False, tag.name ) @@ -257,7 +252,7 @@ trQuestion : AppState -> Props msg -> Model -> Int -> List Tag -> Question -> Ht trQuestion appState props model indent tags question = let questionTitle = - String.withDefault (lg "question.untitled" appState) (Question.getTitle question) + String.withDefault (gettext "Untitled question" appState.locale) (Question.getTitle question) in tr [] (th [ onClick <| props.wrapMsg <| CopyUuid <| Question.getUuid question ] @@ -312,7 +307,7 @@ trChapter : AppState -> Props msg -> Chapter -> List Tag -> Html msg trChapter appState props chapter = trSeparator props (Just chapter.uuid) - (String.withDefault (lg "chapter.untitled" appState) chapter.title) + (String.withDefault (gettext "Untitled chapter" appState.locale) chapter.title) (faSet "km.chapter" appState) "separator-chapter" 0 @@ -322,7 +317,7 @@ trAnswer : AppState -> Props msg -> Answer -> Int -> List Tag -> Html msg trAnswer appState props answer = trSeparator props (Just answer.uuid) - (String.withDefault (lg "answer.untitled" appState) answer.label) + (String.withDefault (gettext "Untitled answer" appState.locale) answer.label) (faSet "km.answer" appState) "" @@ -331,7 +326,7 @@ trItemTemplate : AppState -> Props msg -> Int -> List Tag -> Html msg trItemTemplate appState props = trSeparator props Nothing - (lg "question.itemTemplate" appState) + (gettext "Item Template" appState.locale) (faSet "km.itemTemplate" appState) "" diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm index 1b6a30082..fef6aa01f 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Update.elm @@ -1,6 +1,7 @@ module Wizard.KMEditor.Editor.Update exposing (fetchData, isGuarded, onUnload, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Random exposing (Seed) import Shared.Api.Branches as BranchesApi import Shared.Api.Prefabs as PrefabsApi @@ -10,7 +11,6 @@ import Shared.Data.WebSockets.ClientBranchAction as ClientBranchAction import Shared.Data.WebSockets.ServerBranchAction as ServerBranchAction import Shared.Data.WebSockets.WebSocketServerAction as WebSocketServerAction import Shared.Error.ApiError as ApiError -import Shared.Locale exposing (l, lg) import Shared.Utils exposing (dispatch, getUuid, getUuidString) import Shared.WebSocket as WebSocket import Uuid exposing (Uuid) @@ -32,11 +32,6 @@ import Wizard.Routes as Routes exposing (Route(..)) import Wizard.Routing exposing (cmdNavigate) -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.Update" - - fetchData : AppState -> Uuid -> Model -> Cmd Msg fetchData appState uuid model = if ActionResult.unwrap False (.branch >> .uuid >> (==) uuid) model.branchModel then @@ -81,7 +76,7 @@ isGuarded appState nextRoute model = Nothing else - Just (l_ "unloadMessage" appState) + Just (gettext "Some changes are still saving." appState.locale) onUnload : Routes.Route -> Model -> Cmd Msg @@ -141,7 +136,7 @@ update wrapMsg msg appState model = Err error -> withSeed <| - ( { model | branchModel = ApiError.toActionResult appState (lg "apiError.branches.getError" appState) error } + ( { model | branchModel = ApiError.toActionResult appState (gettext "Unable to get the knowledge model editor." appState.locale) error } , getResultCmd result ) @@ -252,7 +247,7 @@ update wrapMsg msg appState model = ActionResult.map (EditorBranch.applyEvent appState True event) model.branchModel setUnloadMessageCmd = - Ports.setUnloadMessage (l_ "unloadMessage" appState) + Ports.setUnloadMessage (gettext "Some changes are still saving." appState.locale) navigateCmd = getNavigateCmd appState model.uuid model.branchModel newBranchModel diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm index 47d22b8d5..102cc6c73 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/View.elm @@ -1,11 +1,11 @@ module Wizard.KMEditor.Editor.View exposing (view) import ActionResult +import Gettext exposing (gettext) import Html exposing (Html, button, div, p, text) import Html.Attributes exposing (class) import Html.Events exposing (onClick) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Shared.Undraw as Undraw import Uuid import Wizard.Common.AppState as AppState exposing (AppState) @@ -25,16 +25,6 @@ import Wizard.Projects.Detail.Components.ProjectSaving as ProjectSaving import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Editor.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Editor.View" - - view : KMEditorRoute -> AppState -> Model -> Html Msg view route appState model = if model.error then @@ -55,10 +45,10 @@ viewOffline : AppState -> Html Msg viewOffline appState = Page.illustratedMessageHtml { image = Undraw.warning - , heading = l_ "offline.heading" appState + , heading = gettext "Disconnected" appState.locale , content = - [ p [] [ lx_ "offline.text" appState ] - , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ lx_ "offline.refresh" appState ] ] + [ p [] [ text (gettext "You have been disconnected, try to refresh the page." appState.locale) ] + , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ text (gettext "Refresh" appState.locale) ] ] ] , cy = "offline" } @@ -68,10 +58,10 @@ viewError : AppState -> Html Msg viewError appState = Page.illustratedMessageHtml { image = Undraw.warning - , heading = l_ "error.heading" appState + , heading = gettext "Oops!" appState.locale , content = - [ p [] [ lx_ "error.text" appState ] - , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ lx_ "error.refresh" appState ] ] + [ p [] [ text (gettext "Something went wrong, try to refresh the page." appState.locale) ] + , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ text (gettext "Refresh" appState.locale) ] ] ] , cy = "error" } @@ -129,7 +119,7 @@ viewKMEditorNavigationTitleRow appState model branch = , dataCy "km-editor_publish-button" ] [ faSet "kmEditorList.publish" appState - , lx_ "header.publish" appState + , text (gettext "Publish" appState.locale) ] ] ] @@ -169,7 +159,7 @@ viewKMEditorNavigationNav appState route editorBranch = editorLink = { route = Routes.kmEditorEditor branchUuid editUuid - , label = l_ "nav.knowledgeModel" appState + , label = gettext "Knowledge Model" appState.locale , icon = faSet "kmEditor.knowledgeModel" appState , isActive = isEditorRoute , isVisible = True @@ -178,7 +168,7 @@ viewKMEditorNavigationNav appState route editorBranch = questionTagsLink = { route = Routes.kmEditorEditorQuestionTags branchUuid - , label = l_ "nav.tags" appState + , label = gettext "Question Tags" appState.locale , icon = faSet "kmEditor.tags" appState , isActive = route == KMEditorRoute.QuestionTags , isVisible = True @@ -187,7 +177,7 @@ viewKMEditorNavigationNav appState route editorBranch = previewLink = { route = Routes.kmEditorEditorPreview branchUuid - , label = l_ "nav.preview" appState + , label = gettext "Preview" appState.locale , icon = faSet "kmEditor.preview" appState , isActive = route == KMEditorRoute.Preview , isVisible = True @@ -196,7 +186,7 @@ viewKMEditorNavigationNav appState route editorBranch = settingsLink = { route = Routes.kmEditorEditorSettings branchUuid - , label = l_ "nav.settings" appState + , label = gettext "Settings" appState.locale , icon = faSet "kmEditor.settings" appState , isActive = route == KMEditorRoute.Settings , isVisible = True diff --git a/engine-wizard/elm/Wizard/KMEditor/Index/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Index/Update.elm index b6826d3cd..11c18545a 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Index/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Index/Update.elm @@ -1,11 +1,11 @@ module Wizard.KMEditor.Index.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Branches as BranchesApi import Shared.Data.Branch exposing (Branch) import Shared.Data.PaginationQueryFilters as PaginationQueryFilters import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Uuid exposing (Uuid) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -65,14 +65,14 @@ handleDeleteMigrationCompleted wrapMsg appState model result = Listing.update (listingUpdateConfig wrapMsg appState) appState ListingMsgs.Reload model.branches in ( { model - | deletingMigration = Success <| lg "apiSuccess.migration.delete" appState + | deletingMigration = Success <| gettext "Migration was successfully canceled." appState.locale , branches = branches } , cmd ) Err error -> - ( { model | deletingMigration = ApiError.toActionResult appState (lg "apiError.branches.migrations.deleteError" appState) error } + ( { model | deletingMigration = ApiError.toActionResult appState (gettext "Migration could not be deleted." appState.locale) error } , getResultCmd result ) @@ -123,7 +123,7 @@ handleUpgradeModalMsg wrapMsg appState upgradeModalMsg model = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Listing.UpdateConfig Branch listingUpdateConfig wrapMsg appState = { getRequest = BranchesApi.getBranches - , getError = lg "apiError.branches.getListError" appState + , getError = gettext "Unable to get knowledge model editors." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.kmEditorIndexWithFilters PaginationQueryFilters.empty } diff --git a/engine-wizard/elm/Wizard/KMEditor/Index/View.elm b/engine-wizard/elm/Wizard/KMEditor/Index/View.elm index 951634aa4..2346e397f 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Index/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Index/View.elm @@ -1,5 +1,6 @@ module Wizard.KMEditor.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Attribute, Html, a, code, div, span, text) import Html.Attributes exposing (class, title) import Html.Events exposing (onClick) @@ -7,7 +8,6 @@ import Shared.Components.Badge as Badge import Shared.Data.Branch exposing (Branch) import Shared.Data.Branch.BranchState as BranchState import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lx) import Shared.Utils exposing (listInsertIf, packageIdToComponents) import Version import Wizard.Common.AppState exposing (AppState) @@ -27,20 +27,10 @@ import Wizard.KMEditor.Routes exposing (Route(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "KMEditor__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Knowledge Model Editors" appState.locale) [] , FormResult.view appState model.deletingMigration , Listing.view appState (listingConfig appState) model.branches , Html.map DeleteModalMsg <| DeleteModal.view appState model.deleteModal @@ -55,7 +45,7 @@ createButton appState = [ class "btn btn-primary" , dataCy "km-editor_create-button" ] - [ lx_ "header.create" appState ] + [ text (gettext "Create" appState.locale) ] listingConfig : AppState -> ViewConfig Branch Msg @@ -65,7 +55,7 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Create\" button to add a new Knowledge Model Editor." appState.locale , updated = Just { getTime = .updatedAt @@ -73,11 +63,11 @@ listingConfig appState = } , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search KM editors..." appState.locale) , sortOptions = - [ ( "name", lg "branch.name" appState ) - , ( "createdAt", lg "branch.createdAt" appState ) - , ( "updatedAt", lg "branch.updatedAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) + , ( "updatedAt", gettext "Updated" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.KMEditorRoute << IndexRoute @@ -119,7 +109,7 @@ listingTitleLastPublishedVersionBadge : AppState -> Branch -> Html msg listingTitleLastPublishedVersionBadge appState branch = let badge version = - Badge.light (tooltip <| l_ "badge.lastPublishedVersion.title" appState) + Badge.light (tooltip <| gettext "Last published version" appState.locale) [ text <| Version.toString version ] in BranchUtils.lastVersion appState branch @@ -136,22 +126,22 @@ listingTitleBadge appState branch = , onClick (UpgradeModalMsg (UpgradeModal.open branch.uuid branch.name (Maybe.withDefault "" branch.forkOfPackageId))) , dataCy "km-editor_list_outdated-badge" ] - ++ tooltip (l_ "badge.outdated.title" appState) + ++ tooltip (gettext "There is a new version of parent Knowledge Model." appState.locale) ) - [ lx_ "badge.outdated" appState ] + [ text (gettext "update available" appState.locale) ] BranchState.Migrating -> Badge.info - (tooltip <| l_ "badge.migrating.title" appState) - [ lx_ "badge.migrating" appState ] + (tooltip <| gettext "This Editor is in the process of migration to a new parent Knowledge Model." appState.locale) + [ text (gettext "migrating" appState.locale) ] BranchState.Migrated -> Badge.success - (tooltip <| l_ "badge.migrated.title" appState) - [ lx_ "badge.migrated" appState ] + (tooltip <| gettext "This Editor has been migrated to a new parent Knowledge Model, you can publish it now." appState.locale) + [ text (gettext "migrated" appState.locale) ] BranchState.Edited -> - span (tooltip (l_ "badge.edited.title" appState)) + span (tooltip (gettext "This Editor contains unpublished changes." appState.locale)) [ faSet "kmEditorList.edited" appState ] _ -> @@ -173,7 +163,7 @@ listingDescription appState branch = _ -> span in - elem [ class "fragment", title <| lg "package.parentKM" appState ] + elem [ class "fragment", title <| gettext "Parent Knowledge Model" appState.locale ] [ faSet "km.fork" appState , text forkOfPackageId ] @@ -194,7 +184,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmEditorList.edit" appState - , label = l_ "action.openEditor" appState + , label = gettext "Open Editor" appState.locale , msg = ListingActionLink (Routes.KMEditorRoute <| EditorRoute branch.uuid (KMEditorRoute.Edit Nothing)) , dataCy = "open-editor" } @@ -203,7 +193,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmEditorList.publish" appState - , label = l_ "action.publish" appState + , label = gettext "Publish" appState.locale , msg = ListingActionLink <| Routes.KMEditorRoute <| PublishRoute branch.uuid , dataCy = "publish" } @@ -212,7 +202,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmEditorList.upgrade" appState - , label = l_ "action.upgrade" appState + , label = gettext "Upgrade" appState.locale , msg = ListingActionMsg <| UpgradeModalMsg (UpgradeModal.open branch.uuid branch.name (Maybe.withDefault "" branch.forkOfPackageId)) , dataCy = "upgrade" } @@ -221,7 +211,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmEditorList.continueMigration" appState - , label = l_ "action.continueMigration" appState + , label = gettext "Continue migration" appState.locale , msg = ListingActionLink <| Routes.KMEditorRoute <| MigrationRoute branch.uuid , dataCy = "continue-migration" } @@ -230,7 +220,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.cancel" appState - , label = l_ "action.cancelMigration" appState + , label = gettext "Cancel migration" appState.locale , msg = ListingActionMsg <| DeleteMigration branch.uuid , dataCy = "cancel-migration" } @@ -239,7 +229,7 @@ listingActions appState branch = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg <| DeleteModalMsg (DeleteModal.open branch.uuid branch.name) , dataCy = "delete-migration" } diff --git a/engine-wizard/elm/Wizard/KMEditor/Migration/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Migration/Update.elm index f94146989..393cce9de 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Migration/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Migration/Update.elm @@ -4,12 +4,12 @@ module Wizard.KMEditor.Migration.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Branches as BranchesApi import Shared.Data.Event as Event import Shared.Data.Migration exposing (Migration) import Shared.Data.MigrationResolution as MigrationResolution exposing (MigrationResolution) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setMigration) import Uuid exposing (Uuid) import Wizard.Common.Api exposing (applyResult, getResultCmd) @@ -51,7 +51,7 @@ handleGetMigrationCompleted : AppState -> Model -> Result ApiError Migration -> handleGetMigrationCompleted appState model result = applyResult appState { setResult = setMigration - , defaultError = lg "apiError.branches.migrations.getError" appState + , defaultError = gettext "Unable to get migration." appState.locale , model = model , result = result } @@ -88,7 +88,7 @@ handlePostMigrationConflictCompleted wrapMsg appState model result = ( { model | migration = Loading, conflict = Unset }, cmd ) Err error -> - ( { model | conflict = ApiError.toActionResult appState (lg "apiError.branches.migrations.conflict.postError" appState) error } + ( { model | conflict = ApiError.toActionResult appState (gettext "Unable to resolve conflict." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/KMEditor/Migration/View.elm b/engine-wizard/elm/Wizard/KMEditor/Migration/View.elm index 510fb6087..7bc555ca5 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Migration/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Migration/View.elm @@ -2,6 +2,7 @@ module Wizard.KMEditor.Migration.View exposing (view) import ActionResult exposing (ActionResult(..)) import Dict exposing (Dict) +import Gettext exposing (gettext) import Html exposing (Html, br, button, code, dd, del, div, dl, dt, h1, h3, ins, label, li, p, span, strong, text, ul) import Html.Attributes exposing (class, disabled) import Html.Events exposing (onClick) @@ -55,8 +56,7 @@ import Shared.Data.KnowledgeModel.Tag exposing (Tag) import Shared.Data.Migration exposing (Migration) import Shared.Data.Migration.MigrationState.MigrationStateType exposing (MigrationStateType(..)) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lh, lx) -import String.Format exposing (format) +import String.Format as String exposing (format) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -69,21 +69,6 @@ import Wizard.KMEditor.Migration.View.DiffTree as DiffTree import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Migration.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KMEditor.Migration.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Migration.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (migrationView appState model) model.migration @@ -94,7 +79,7 @@ migrationView appState model migration = let errorMessage = div [ class "alert alert-danger" ] - [ lx_ "stateError" appState ] + [ text (gettext "Migration state is corrupted." appState.locale) ] currentView = case migration.migrationState.stateType of @@ -123,13 +108,13 @@ migrationView appState model migration = RunningState -> div [ class "alert alert-warning" ] - [ lx_ "running" appState ] + [ text (gettext "Migration is still running, try again later." appState.locale) ] _ -> errorMessage in div [ class "col KMEditor__Migration", dataCy "km-editor_migration" ] - [ div [] [ Page.header (lg "kmMigration" appState) [] ] + [ div [] [ Page.header (gettext "Migration" appState.locale) [] ] , FormResult.view appState model.conflict , currentView ] @@ -139,12 +124,11 @@ migrationSummary : AppState -> Migration -> Html Msg migrationSummary appState migration = div [ class "col-12" ] [ p [] - (lh_ "summary" + (String.formatHtml (gettext "Migration of %s from %s to %s." appState.locale) [ strong [] [ text migration.branchName ] , code [] [ text migration.branchPreviousPackageId ] , code [] [ text migration.targetPackageId ] ] - appState ) ] @@ -154,7 +138,7 @@ getEventView appState model migration event = let errorMessage = div [ class "alert alert-danger" ] - [ lx_ "eventError" appState ] + [ text (gettext "The event is not connected to any entity in the Knowledge Model." appState.locale) ] in case event of AddKnowledgeModelEvent _ _ -> @@ -164,196 +148,196 @@ getEventView appState model migration event = EditKnowledgeModelEvent eventData _ -> migration.currentKnowledgeModel |> viewEditKnowledgeModelDiff appState eventData - |> viewEvent appState model event (lg "event.editKM" appState) + |> viewEvent appState model event (gettext "Edit Knowledge Model" appState.locale) AddMetricEvent eventData _ -> viewAddMetricDiff appState eventData - |> viewEvent appState model event (lg "event.addMetric" appState) + |> viewEvent appState model event (gettext "Add metric" appState.locale) EditMetricEvent eventData commonData -> KnowledgeModel.getMetric commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditMetricDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editMetric" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit metric" appState.locale)) |> Maybe.withDefault errorMessage DeleteMetricEvent commonData -> KnowledgeModel.getMetric commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteMetricDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteMetric" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete metric" appState.locale)) |> Maybe.withDefault errorMessage AddPhaseEvent eventData _ -> viewAddPhaseDiff appState eventData - |> viewEvent appState model event (lg "event.addPhase" appState) + |> viewEvent appState model event (gettext "Add phase" appState.locale) EditPhaseEvent eventData commonData -> KnowledgeModel.getPhase commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditPhaseDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editPhase" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit phase" appState.locale)) |> Maybe.withDefault errorMessage DeletePhaseEvent commonData -> KnowledgeModel.getPhase commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeletePhaseDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deletePhase" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete phase" appState.locale)) |> Maybe.withDefault errorMessage AddTagEvent eventData _ -> viewAddTagDiff appState eventData - |> viewEvent appState model event (lg "event.addTag" appState) + |> viewEvent appState model event (gettext "Add question tag" appState.locale) EditTagEvent eventData commonData -> KnowledgeModel.getTag commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditTagDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editTag" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit question tag" appState.locale)) |> Maybe.withDefault errorMessage DeleteTagEvent commonData -> KnowledgeModel.getTag commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteTagDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteTag" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete question tag" appState.locale)) |> Maybe.withDefault errorMessage AddIntegrationEvent eventData _ -> viewAddIntegrationDiff appState eventData - |> viewEvent appState model event (lg "event.addIntegration" appState) + |> viewEvent appState model event (gettext "Add integration" appState.locale) EditIntegrationEvent eventData commonData -> KnowledgeModel.getIntegration commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditIntegrationDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editIntegration" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit integration" appState.locale)) |> Maybe.withDefault errorMessage DeleteIntegrationEvent commonData -> KnowledgeModel.getIntegration commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteIntegrationDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteIntegration" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete integration" appState.locale)) |> Maybe.withDefault errorMessage AddChapterEvent eventData _ -> viewAddChapterDiff appState eventData - |> viewEvent appState model event (lg "event.addChapter" appState) + |> viewEvent appState model event (gettext "Add chapter" appState.locale) EditChapterEvent eventData commonData -> KnowledgeModel.getChapter commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditChapterDiff appState migration.currentKnowledgeModel eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editChapter" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit chapter" appState.locale)) |> Maybe.withDefault errorMessage DeleteChapterEvent commonData -> KnowledgeModel.getChapter commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteChapterDiff appState migration.currentKnowledgeModel) - |> Maybe.map (viewEvent appState model event (lg "event.deleteChapter" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete chapter" appState.locale)) |> Maybe.withDefault errorMessage AddQuestionEvent eventData _ -> viewAddQuestionDiff appState migration.currentKnowledgeModel eventData - |> viewEvent appState model event (lg "event.addQuestion" appState) + |> viewEvent appState model event (gettext "Add question" appState.locale) EditQuestionEvent eventData commonData -> KnowledgeModel.getQuestion commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditQuestionDiff appState migration.currentKnowledgeModel eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editQuestion" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit question" appState.locale)) |> Maybe.withDefault errorMessage DeleteQuestionEvent commonData -> KnowledgeModel.getQuestion commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteQuestionDiff appState migration.currentKnowledgeModel) - |> Maybe.map (viewEvent appState model event (lg "event.deleteQuestion" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete question" appState.locale)) |> Maybe.withDefault errorMessage AddAnswerEvent eventData _ -> viewAddAnswerDiff appState migration.currentKnowledgeModel eventData - |> viewEvent appState model event (lg "event.addAnswer" appState) + |> viewEvent appState model event (gettext "Add answer" appState.locale) EditAnswerEvent eventData commonData -> KnowledgeModel.getAnswer commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditAnswerDiff appState migration.currentKnowledgeModel eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editAnswer" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit answer" appState.locale)) |> Maybe.withDefault errorMessage DeleteAnswerEvent commonData -> KnowledgeModel.getAnswer commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteAnswerDiff appState migration.currentKnowledgeModel) - |> Maybe.map (viewEvent appState model event (lg "event.deleteAnswer" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete answer" appState.locale)) |> Maybe.withDefault errorMessage AddChoiceEvent eventData _ -> viewAddChoiceDiff appState eventData - |> viewEvent appState model event (lg "event.addChoice" appState) + |> viewEvent appState model event (gettext "Add choice" appState.locale) EditChoiceEvent eventData commonData -> KnowledgeModel.getChoice commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditChoiceDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editChoice" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit choice" appState.locale)) |> Maybe.withDefault errorMessage DeleteChoiceEvent commonData -> KnowledgeModel.getChoice commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteChoiceDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteChoice" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete choice" appState.locale)) |> Maybe.withDefault errorMessage AddReferenceEvent eventData _ -> viewAddReferenceDiff appState eventData - |> viewEvent appState model event (lg "event.addReference" appState) + |> viewEvent appState model event (gettext "Add reference" appState.locale) EditReferenceEvent eventData commonData -> KnowledgeModel.getReference commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditReferenceDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editReference" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit reference" appState.locale)) |> Maybe.withDefault errorMessage DeleteReferenceEvent commonData -> KnowledgeModel.getReference commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteReferenceDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteReference" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete reference" appState.locale)) |> Maybe.withDefault errorMessage AddExpertEvent eventData _ -> viewAddExpertDiff appState eventData - |> viewEvent appState model event (lg "event.addExpert" appState) + |> viewEvent appState model event (gettext "Add expert" appState.locale) EditExpertEvent eventData commonData -> KnowledgeModel.getExpert commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewEditExpertDiff appState eventData) - |> Maybe.map (viewEvent appState model event (lg "event.editExpert" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Edit expert" appState.locale)) |> Maybe.withDefault errorMessage DeleteExpertEvent commonData -> KnowledgeModel.getExpert commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewDeleteExpertDiff appState) - |> Maybe.map (viewEvent appState model event (lg "event.deleteExpert" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Delete expert" appState.locale)) |> Maybe.withDefault errorMessage MoveQuestionEvent _ commonData -> KnowledgeModel.getQuestion commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewMoveQuestion appState migration.currentKnowledgeModel) - |> Maybe.map (viewEvent appState model event (lg "event.moveQuestion" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Move question" appState.locale)) |> Maybe.withDefault errorMessage MoveAnswerEvent _ commonData -> KnowledgeModel.getAnswer commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewMoveAnswer appState migration.currentKnowledgeModel) - |> Maybe.map (viewEvent appState model event (lg "event.moveAnswer" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Move answer" appState.locale)) |> Maybe.withDefault errorMessage MoveChoiceEvent _ commonData -> KnowledgeModel.getChoice commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewMoveChoice appState) - |> Maybe.map (viewEvent appState model event (lg "event.moveChoice" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Move choice" appState.locale)) |> Maybe.withDefault errorMessage MoveReferenceEvent _ commonData -> KnowledgeModel.getReference commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewMoveReference appState) - |> Maybe.map (viewEvent appState model event (lg "event.moveReference" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Move reference" appState.locale)) |> Maybe.withDefault errorMessage MoveExpertEvent _ commonData -> KnowledgeModel.getExpert commonData.entityUuid migration.currentKnowledgeModel |> Maybe.map (viewMoveExpert appState) - |> Maybe.map (viewEvent appState model event (lg "event.moveExpert" appState)) + |> Maybe.map (viewEvent appState model event (gettext "Move expert" appState.locale)) |> Maybe.withDefault errorMessage @@ -383,7 +367,7 @@ viewEditKnowledgeModelDiff appState event km = Dict.fromList <| List.map (\c -> ( c.uuid, c.title )) chapters chaptersDiff = - viewDiffChildren (lg "chapters" appState) originalChapters (EventField.getValueWithDefault event.chapterUuids originalChapters) chapterNames + viewDiffChildren (gettext "Chapters" appState.locale) originalChapters (EventField.getValueWithDefault event.chapterUuids originalChapters) chapterNames metrics = KnowledgeModel.getMetrics km @@ -395,7 +379,7 @@ viewEditKnowledgeModelDiff appState event km = Dict.fromList <| List.map (\m -> ( m.uuid, m.title )) metrics metricsDiff = - viewDiffChildren (lg "metrics" appState) + viewDiffChildren (gettext "Metrics" appState.locale) originalMetrics (EventField.getValueWithDefault event.metricUuids originalMetrics) metricNames @@ -410,7 +394,7 @@ viewEditKnowledgeModelDiff appState event km = Dict.fromList <| List.map (\p -> ( p.uuid, p.title )) phases phasesDiff = - viewDiffChildren (lg "phases" appState) + viewDiffChildren (gettext "Phases" appState.locale) originalPhases (EventField.getValueWithDefault event.phaseUuids originalPhases) phaseNames @@ -425,7 +409,7 @@ viewEditKnowledgeModelDiff appState event km = Dict.fromList <| List.map (\t -> ( t.uuid, t.name )) tags tagsDiff = - viewDiffChildren (lg "tags" appState) + viewDiffChildren (gettext "Question Tags" appState.locale) originalTags (EventField.getValueWithDefault event.tagUuids originalTags) tagNames @@ -440,7 +424,7 @@ viewEditKnowledgeModelDiff appState event km = Dict.fromList <| List.map (\i -> ( Integration.getUuid i, Integration.getName i )) integrations integrationsDiff = - viewDiffChildren (lg "integrations" appState) + viewDiffChildren (gettext "Integrations" appState.locale) originalIntegrations (EventField.getValueWithDefault event.integrationUuids originalIntegrations) integrationNames @@ -458,9 +442,9 @@ viewAddMetricDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "metric.title" appState - , lg "metric.abbreviation" appState - , lg "metric.description" appState + [ gettext "Title" appState.locale + , gettext "Abbreviation" appState.locale + , gettext "Description" appState.locale ] [ event.title , Maybe.withDefault "" event.abbreviation @@ -479,9 +463,9 @@ viewEditMetricDiff appState event metric = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "metric.title" appState - , lg "metric.abbreviation" appState - , lg "metric.description" appState + [ gettext "Title" appState.locale + , gettext "Abbreviation" appState.locale + , gettext "Description" appState.locale ] [ metric.title , Maybe.withDefault "" metric.abbreviation @@ -504,9 +488,9 @@ viewDeleteMetricDiff appState metric = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "metric.title" appState - , lg "metric.abbreviation" appState - , lg "metric.description" appState + [ gettext "Title" appState.locale + , gettext "Abbreviation" appState.locale + , gettext "Description" appState.locale ] [ metric.title , Maybe.withDefault "" metric.abbreviation @@ -525,8 +509,8 @@ viewAddPhaseDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "phase.title" appState - , lg "phase.description" appState + [ gettext "Title" appState.locale + , gettext "Description" appState.locale ] [ event.title , Maybe.withDefault "" event.description @@ -544,8 +528,8 @@ viewEditPhaseDiff appState event phase = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "phase.title" appState - , lg "phase.description" appState + [ gettext "Title" appState.locale + , gettext "Description" appState.locale ] [ phase.title , Maybe.withDefault "" phase.description @@ -566,8 +550,8 @@ viewDeletePhaseDiff appState phase = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "phase.title" appState - , lg "phase.description" appState + [ gettext "Title" appState.locale + , gettext "Description" appState.locale ] [ phase.title , Maybe.withDefault "" phase.description @@ -585,9 +569,9 @@ viewAddTagDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "tag.name" appState - , lg "tag.description" appState - , lg "tag.color" appState + [ gettext "Name" appState.locale + , gettext "Description" appState.locale + , gettext "Color" appState.locale ] [ event.name , event.description |> Maybe.withDefault "" @@ -607,9 +591,9 @@ viewEditTagDiff appState event tag = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "tag.name" appState - , lg "tag.description" appState - , lg "tag.color" appState + [ gettext "Name" appState.locale + , gettext "Description" appState.locale + , gettext "Color" appState.locale ] [ tag.name , Maybe.withDefault "" tag.description @@ -632,9 +616,9 @@ viewDeleteTagDiff appState tag = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "tag.name" appState - , lg "tag.description" appState - , lg "tag.color" appState + [ gettext "Name" appState.locale + , gettext "Description" appState.locale + , gettext "Color" appState.locale ] [ tag.name , tag.description |> Maybe.withDefault "" @@ -652,11 +636,11 @@ viewAddIntegrationDiff appState event = let fields = List.map2 (\a b -> ( a, b )) - [ lg "integration.type" appState - , lg "integration.id" appState - , lg "integration.name" appState - , lg "integration.props" appState - , lg "integration.itemUrl" appState + [ gettext "Type" appState.locale + , gettext "ID" appState.locale + , gettext "Name" appState.locale + , gettext "Props" appState.locale + , gettext "Item URL" appState.locale ] [ AddIntegrationEventData.getTypeString event , AddIntegrationEventData.map .id .id event @@ -669,13 +653,13 @@ viewAddIntegrationDiff appState event = case event of AddIntegrationApiEvent data -> List.map2 (\a b -> ( a, b )) - [ lg "integration.request.method" appState - , lg "integration.request.url" appState - , lg "integration.request.headers" appState - , lg "integration.request.body" appState - , lg "integration.response.listField" appState - , lg "integration.response.idField" appState - , lg "integration.response.itemTemplate" appState + [ gettext "Request HTTP Method" appState.locale + , gettext "Request URL" appState.locale + , gettext "Request HTTP Headers" appState.locale + , gettext "Request HTTP Body" appState.locale + , gettext "Response List Field" appState.locale + , gettext "Response Item ID" appState.locale + , gettext "Response Item Template" appState.locale ] [ data.requestMethod , data.requestUrl @@ -688,7 +672,7 @@ viewAddIntegrationDiff appState event = AddIntegrationWidgetEvent data -> List.map2 (\a b -> ( a, b )) - [ lg "integration.widgetUrl" appState + [ gettext "Widget URL" appState.locale ] [ data.widgetUrl ] @@ -707,11 +691,11 @@ viewEditIntegrationDiff appState event integration = let fields = List.map3 (\a b c -> ( a, b, c )) - [ lg "integration.type" appState - , lg "integration.id" appState - , lg "integration.name" appState - , lg "integration.props" appState - , lg "integration.itemUrl" appState + [ gettext "Type" appState.locale + , gettext "ID" appState.locale + , gettext "Name" appState.locale + , gettext "Props" appState.locale + , gettext "Item URL" appState.locale ] [ Integration.getTypeString integration , Integration.getId integration @@ -730,13 +714,13 @@ viewEditIntegrationDiff appState event integration = case event of EditIntegrationApiEvent data -> List.map3 (\a b c -> ( a, b, c )) - [ lg "integration.request.method" appState - , lg "integration.request.url" appState - , lg "integration.request.headers" appState - , lg "integration.request.body" appState - , lg "integration.response.listField" appState - , lg "integration.response.idField" appState - , lg "integration.response.itemTemplate" appState + [ gettext "Request HTTP Method" appState.locale + , gettext "Request URL" appState.locale + , gettext "Request HTTP Headers" appState.locale + , gettext "Request HTTP Body" appState.locale + , gettext "Response List Field" appState.locale + , gettext "Response Item ID" appState.locale + , gettext "Response Item Template" appState.locale ] [ Maybe.withDefault "" <| Integration.getRequestMethod integration , Maybe.withDefault "" <| Integration.getRequestUrl integration @@ -757,7 +741,7 @@ viewEditIntegrationDiff appState event integration = EditIntegrationWidgetEvent data -> List.map3 (\a b c -> ( a, b, c )) - [ lg "integration.widgetUrl" appState + [ gettext "Widget URL" appState.locale ] [ Maybe.withDefault "" <| Integration.getWidgetUrl integration ] @@ -780,11 +764,11 @@ viewDeleteIntegrationDiff appState integration = let fields = List.map2 (\a b -> ( a, b )) - [ lg "integration.type" appState - , lg "integration.id" appState - , lg "integration.name" appState - , lg "integration.props" appState - , lg "integration.itemUrl" appState + [ gettext "Type" appState.locale + , gettext "ID" appState.locale + , gettext "Name" appState.locale + , gettext "Props" appState.locale + , gettext "Item URL" appState.locale ] [ Integration.getTypeString integration , Integration.getId integration @@ -797,13 +781,13 @@ viewDeleteIntegrationDiff appState integration = case integration of ApiIntegration _ data -> List.map2 (\a b -> ( a, b )) - [ lg "integration.request.method" appState - , lg "integration.request.url" appState - , lg "integration.request.headers" appState - , lg "integration.request.body" appState - , lg "integration.response.listField" appState - , lg "integration.response.idField" appState - , lg "integration.response.itemTemplate" appState + [ gettext "Request HTTP Method" appState.locale + , gettext "Request URL" appState.locale + , gettext "Request HTTP Headers" appState.locale + , gettext "Request HTTP Body" appState.locale + , gettext "Response List Field" appState.locale + , gettext "Response Item ID" appState.locale + , gettext "Response Item Template" appState.locale ] [ data.requestMethod , data.requestUrl @@ -816,7 +800,7 @@ viewDeleteIntegrationDiff appState integration = WidgetIntegration _ data -> List.map2 (\a b -> ( a, b )) - [ lg "integration.widgetUrl" appState + [ gettext "Widget URL" appState.locale ] [ data.widgetUrl ] @@ -836,8 +820,8 @@ viewAddChapterDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "chapter.title" appState - , lg "chapter.text" appState + [ gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ event.title , Maybe.withDefault "" event.text @@ -855,8 +839,8 @@ viewEditChapterDiff appState km event chapter = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "chapter.title" appState - , lg "chapter.text" appState + [ gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ chapter.title , Maybe.withDefault "" chapter.text @@ -875,7 +859,7 @@ viewEditChapterDiff appState km event chapter = Dict.fromList <| List.map (\q -> ( Question.getUuid q, Question.getTitle q )) questions questionsDiff = - viewDiffChildren (lg "questions" appState) + viewDiffChildren (gettext "Questions" appState.locale) originalQuestions (EventField.getValueWithDefault event.questionUuids originalQuestions) questionNames @@ -892,8 +876,8 @@ viewDeleteChapterDiff appState km chapter = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "chapter.title" appState - , lg "chapter.text" appState + [ gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ chapter.title , Maybe.withDefault "" chapter.text @@ -906,7 +890,7 @@ viewDeleteChapterDiff appState km chapter = List.map Question.getTitle questions questionsDiff = - viewDeletedChildren (lg "questions" appState) questionNames + viewDeletedChildren (gettext "Questions" appState.locale) questionNames annotationsDiff = viewAnnotationsDiff appState chapter.annotations [] @@ -919,9 +903,9 @@ viewAddQuestionDiff appState km event = let fields = List.map2 (\a b -> ( a, b )) - [ lg "question.type" appState - , lg "question.title" appState - , lg "question.text" appState + [ gettext "Type" appState.locale + , gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ AddQuestionEventQuestionData.getTypeString event , AddQuestionEventQuestionData.map .title .title .title .title .title event @@ -931,10 +915,10 @@ viewAddQuestionDiff appState km event = extraFields = case event of AddQuestionValueEvent data -> - [ ( lg "questionValueType" appState, QuestionValueType.toString data.valueType ) ] + [ ( gettext "Value Type" appState.locale, QuestionValueType.toString data.valueType ) ] AddQuestionIntegrationEvent data -> - [ ( lg "integration" appState, getIntegrationName km data.integrationUuid ) ] + [ ( gettext "Integration" appState.locale, getIntegrationName km data.integrationUuid ) ] _ -> [] @@ -949,7 +933,7 @@ viewAddQuestionDiff appState km event = props = List.map (\( p, v ) -> p ++ " = " ++ v) <| Dict.toList data.props in - viewAddedChildren (lg "integration.props" appState) props + viewAddedChildren (gettext "Props" appState.locale) props _ -> emptyNode @@ -967,7 +951,7 @@ viewAddQuestionDiff appState km event = List.map (\_ -> "") tagUuids tagsDiff = - viewDiffChildren (lg "tags" appState) originalTags tagUuids tagNames + viewDiffChildren (gettext "Question Tags" appState.locale) originalTags tagUuids tagNames annotations = AddQuestionEventQuestionData.map .annotations .annotations .annotations .annotations .annotations event @@ -994,9 +978,9 @@ viewEditQuestionDiff appState km event question = fields = List.map3 (\a b c -> ( a, b, c )) - [ lg "question.type" appState - , lg "question.title" appState - , lg "question.text" appState + [ gettext "Type" appState.locale + , gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ Question.getTypeString question , Question.getTitle question @@ -1022,7 +1006,7 @@ viewEditQuestionDiff appState km event question = newStr = Maybe.withDefault originalStr <| Maybe.map QuestionValueType.toString new in - [ ( lg "questionValueType" appState, originalStr, newStr ) ] + [ ( gettext "Value Type" appState.locale, originalStr, newStr ) ] EditQuestionIntegrationEvent data -> case ( Question.getIntegrationUuid question, EventField.getValue data.integrationUuid ) of @@ -1041,7 +1025,7 @@ viewEditQuestionDiff appState km event question = |> Maybe.map (getIntegrationName km) |> Maybe.withDefault originalStr in - [ ( lg "integration" appState, originalStr, newStr ) ] + [ ( gettext "Integration" appState.locale, originalStr, newStr ) ] _ -> [] @@ -1064,7 +1048,7 @@ viewEditQuestionDiff appState km event question = |> Maybe.map (List.map (\( p, v ) -> p ++ " = " ++ v) << Dict.toList) |> Maybe.withDefault originalProps in - viewAddedAndDeletedChildren (lg "integration.props" appState) originalProps newProps + viewAddedAndDeletedChildren (gettext "Props" appState.locale) originalProps newProps _ -> emptyNode @@ -1080,7 +1064,7 @@ viewEditQuestionDiff appState km event question = Dict.fromList <| List.map (\t -> ( t.uuid, t.name )) tags tagsDiff = - viewDiffChildren (lg "tags" appState) + viewDiffChildren (gettext "Question Tags" appState.locale) originalTags (EventField.getValueWithDefault (EditQuestionEventData.map .tagUuids .tagUuids .tagUuids .tagUuids .tagUuids event) originalTags) tagNames @@ -1099,7 +1083,7 @@ viewEditQuestionDiff appState km event question = answerNames = Dict.fromList <| List.map (\a -> ( a.uuid, a.label )) answers in - viewDiffChildren (lg "answers" appState) + viewDiffChildren (gettext "Answers" appState.locale) originalAnswers (EventField.getValueWithDefault data.answerUuids originalAnswers) answerNames @@ -1111,7 +1095,7 @@ viewEditQuestionDiff appState km event question = choicesDiff = case question of MultiChoiceQuestion _ _ -> - viewPlainChildren (lg "choices" appState) <| + viewPlainChildren (gettext "Choices" appState.locale) <| List.map .label <| KnowledgeModel.getQuestionChoices questionUuid km @@ -1132,7 +1116,7 @@ viewEditQuestionDiff appState km event question = itemTemplateQuestionNames = Dict.fromList <| List.map (\q -> ( Question.getUuid q, Question.getTitle q )) itemTemplateQuestions in - viewDiffChildren (lg "questions" appState) + viewDiffChildren (gettext "Questions" appState.locale) originalItemTemplateQuestions (EventField.getValueWithDefault data.itemTemplateQuestionUuids originalItemTemplateQuestions) itemTemplateQuestionNames @@ -1151,7 +1135,7 @@ viewEditQuestionDiff appState km event question = Dict.fromList <| List.map (\r -> ( Reference.getUuid r, Reference.getVisibleName r )) references referencesDiff = - viewDiffChildren (lg "references" appState) + viewDiffChildren (gettext "References" appState.locale) originalReferences (EventField.getValueWithDefault (EditQuestionEventData.map .referenceUuids .referenceUuids .referenceUuids .referenceUuids .referenceUuids event) originalReferences) referenceNames @@ -1167,7 +1151,7 @@ viewEditQuestionDiff appState km event question = Dict.fromList <| List.map (\e -> ( e.uuid, e.name )) experts expertsDiff = - viewDiffChildren (lg "experts" appState) + viewDiffChildren (gettext "Experts" appState.locale) originalExperts (EventField.getValueWithDefault (EditQuestionEventData.map .expertUuids .expertUuids .expertUuids .expertUuids .expertUuids event) originalExperts) expertNames @@ -1197,9 +1181,9 @@ viewDeleteQuestionDiff appState km question = fields = List.map2 (\a b -> ( a, b )) - [ lg "question.type" appState - , lg "question.title" appState - , lg "question.text" appState + [ gettext "Type" appState.locale + , gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ Question.getTypeString question , Question.getTitle question @@ -1209,10 +1193,10 @@ viewDeleteQuestionDiff appState km question = extraFields = case question of ValueQuestion _ data -> - [ ( lg "questionValueType" appState, QuestionValueType.toString data.valueType ) ] + [ ( gettext "Value Type" appState.locale, QuestionValueType.toString data.valueType ) ] IntegrationQuestion _ data -> - [ ( lg "integration" appState, getIntegrationName km data.integrationUuid ) ] + [ ( gettext "Integration" appState.locale, getIntegrationName km data.integrationUuid ) ] _ -> [] @@ -1228,13 +1212,13 @@ viewDeleteQuestionDiff appState km question = List.map .name <| List.filter (\t -> List.member t.uuid (Question.getTagUuids question)) tags tagsDiff = - viewDeletedChildren (lg "tags" appState) tagNames + viewDeletedChildren (gettext "Question Tags" appState.locale) tagNames -- Answers answersDiff = case question of OptionsQuestion _ _ -> - viewDeletedChildren (lg "answers" appState) <| + viewDeletedChildren (gettext "Answers" appState.locale) <| List.map .label <| KnowledgeModel.getQuestionAnswers questionUuid km @@ -1245,7 +1229,7 @@ viewDeleteQuestionDiff appState km question = choicesDiff = case question of MultiChoiceQuestion _ _ -> - viewPlainChildren (lg "choices" appState) <| + viewPlainChildren (gettext "Choices" appState.locale) <| List.map .label <| KnowledgeModel.getQuestionChoices questionUuid km @@ -1256,7 +1240,7 @@ viewDeleteQuestionDiff appState km question = itemTemplateQuestionsDiff = case question of ListQuestion _ _ -> - viewDeletedChildren (lg "questions" appState) <| + viewDeletedChildren (gettext "Questions" appState.locale) <| List.map Question.getTitle <| KnowledgeModel.getQuestionItemTemplateQuestions questionUuid km @@ -1268,14 +1252,14 @@ viewDeleteQuestionDiff appState km question = KnowledgeModel.getQuestionReferences questionUuid km referencesDiff = - viewDeletedChildren (lg "references" appState) <| List.map Reference.getVisibleName references + viewDeletedChildren (gettext "References" appState.locale) <| List.map Reference.getVisibleName references -- Experts experts = KnowledgeModel.getQuestionExperts questionUuid km expertsDiff = - viewDeletedChildren (lg "experts" appState) <| List.map .name experts + viewDeletedChildren (gettext "Experts" appState.locale) <| List.map .name experts -- Annotations annotationsDiff = @@ -1294,9 +1278,9 @@ viewMoveQuestion appState km question = fields = List.map2 (\a b -> ( a, b )) - [ lg "question.type" appState - , lg "question.title" appState - , lg "question.text" appState + [ gettext "Type" appState.locale + , gettext "Title" appState.locale + , gettext "Text" appState.locale ] [ Question.getTypeString question , Question.getTitle question @@ -1306,10 +1290,10 @@ viewMoveQuestion appState km question = extraFields = case question of ValueQuestion _ data -> - [ ( lg "questionValueType" appState, QuestionValueType.toString data.valueType ) ] + [ ( gettext "Value Type" appState.locale, QuestionValueType.toString data.valueType ) ] IntegrationQuestion _ data -> - [ ( lg "integration" appState, getIntegrationName km data.integrationUuid ) ] + [ ( gettext "Integration" appState.locale, getIntegrationName km data.integrationUuid ) ] _ -> [] @@ -1325,13 +1309,13 @@ viewMoveQuestion appState km question = List.map .name <| List.filter (\t -> List.member t.uuid (Question.getTagUuids question)) tags tagsDiff = - viewPlainChildren (lg "tags" appState) tagNames + viewPlainChildren (gettext "Question Tags" appState.locale) tagNames -- Answers answersDiff = case question of OptionsQuestion _ _ -> - viewPlainChildren (lg "answers" appState) <| + viewPlainChildren (gettext "Answers" appState.locale) <| List.map .label <| KnowledgeModel.getQuestionAnswers questionUuid km @@ -1342,7 +1326,7 @@ viewMoveQuestion appState km question = choicesDiff = case question of MultiChoiceQuestion _ _ -> - viewPlainChildren (lg "choices" appState) <| + viewPlainChildren (gettext "Choices" appState.locale) <| List.map .label <| KnowledgeModel.getQuestionChoices questionUuid km @@ -1353,7 +1337,7 @@ viewMoveQuestion appState km question = itemTemplateQuestionsDiff = case question of ListQuestion _ _ -> - viewPlainChildren (lg "questions" appState) <| + viewPlainChildren (gettext "Questions" appState.locale) <| List.map Question.getTitle <| KnowledgeModel.getQuestionItemTemplateQuestions questionUuid km @@ -1365,14 +1349,14 @@ viewMoveQuestion appState km question = KnowledgeModel.getQuestionReferences questionUuid km referencesDiff = - viewPlainChildren (lg "references" appState) <| List.map Reference.getVisibleName references + viewPlainChildren (gettext "References" appState.locale) <| List.map Reference.getVisibleName references -- Experts experts = KnowledgeModel.getQuestionExperts questionUuid km expertsDiff = - viewPlainChildren (lg "experts" appState) <| List.map .name experts + viewPlainChildren (gettext "Experts" appState.locale) <| List.map .name experts -- Annotations annotations = @@ -1401,15 +1385,15 @@ viewAddAnswerDiff appState km event = fieldsDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "answer.label" appState - , lg "answer.advice" appState + [ gettext "Label" appState.locale + , gettext "Advice" appState.locale ] [ event.label , event.advice |> Maybe.withDefault "" ] metricsDiff = - viewAddedChildren (lg "metrics" appState) <| + viewAddedChildren (gettext "Metrics" appState.locale) <| List.map (metricMeasureToString metrics) event.metricMeasures annotationsDiff = @@ -1427,8 +1411,8 @@ viewEditAnswerDiff appState km event answer = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "answer.label" appState - , lg "answer.advice" appState + [ gettext "Label" appState.locale + , gettext "Advice" appState.locale ] [ answer.label , Maybe.withDefault "" answer.advice @@ -1447,7 +1431,7 @@ viewEditAnswerDiff appState km event answer = Dict.fromList <| List.map (\q -> ( Question.getUuid q, Question.getTitle q )) questions questionsDiff = - viewDiffChildren (lg "questions" appState) + viewDiffChildren (gettext "Questions" appState.locale) originalQuestions (EventField.getValueWithDefault event.followUpUuids originalQuestions) questionNames @@ -1460,7 +1444,7 @@ viewEditAnswerDiff appState km event answer = |> List.map (metricMeasureToString metrics) metricsPropsDiff = - viewAddedAndDeletedChildren (lg "metrics" appState) originalMetrics newMetrics + viewAddedAndDeletedChildren (gettext "Metrics" appState.locale) originalMetrics newMetrics annotationsDiff = viewAnnotationsDiff appState answer.annotations (EventField.getValueWithDefault event.annotations answer.annotations) @@ -1478,8 +1462,8 @@ viewDeleteAnswerDiff appState km answer = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "answer.label" appState - , lg "answer.advice" appState + [ gettext "Label" appState.locale + , gettext "Advice" appState.locale ] [ answer.label , answer.advice |> Maybe.withDefault "" @@ -1492,13 +1476,13 @@ viewDeleteAnswerDiff appState km answer = List.map Question.getTitle questions questionsDiff = - viewDeletedChildren (lg "questions" appState) questionNames + viewDeletedChildren (gettext "Questions" appState.locale) questionNames originalMetrics = List.map (metricMeasureToString metrics) answer.metricMeasures metricsDiff = - viewDeletedChildren (lg "metrics" appState) originalMetrics + viewDeletedChildren (gettext "Metrics" appState.locale) originalMetrics annotationsDiff = viewAnnotationsDiff appState answer.annotations [] @@ -1516,8 +1500,8 @@ viewMoveAnswer appState km answer = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "answer.label" appState - , lg "answer.advice" appState + [ gettext "Label" appState.locale + , gettext "Advice" appState.locale ] [ answer.label , answer.advice |> Maybe.withDefault "" @@ -1530,13 +1514,13 @@ viewMoveAnswer appState km answer = List.map Question.getTitle questions questionsDiff = - viewPlainChildren (lg "questions" appState) questionNames + viewPlainChildren (gettext "Questions" appState.locale) questionNames originalMetrics = List.map (metricMeasureToString metrics) answer.metricMeasures metricsDiff = - viewPlainChildren (lg "metrics" appState) originalMetrics + viewPlainChildren (gettext "Metrics" appState.locale) originalMetrics annotationsDiff = viewAnnotationsDiff appState answer.annotations answer.annotations @@ -1567,7 +1551,7 @@ viewAddChoiceDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "choice.label" appState + [ gettext "Label" appState.locale ] [ event.label ] @@ -1584,7 +1568,7 @@ viewEditChoiceDiff appState event choice = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "choice.label" appState + [ gettext "Label" appState.locale ] [ choice.label ] @@ -1603,7 +1587,7 @@ viewDeleteChoiceDiff appState choice = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "choice.label" appState + [ gettext "Label" appState.locale ] [ choice.label ] @@ -1620,7 +1604,7 @@ viewMoveChoice appState choice = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "choice.label" appState + [ gettext "Label" appState.locale ] [ choice.label ] @@ -1645,10 +1629,10 @@ viewAddResourcePageReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.shortUuid" appState + [ gettext "Reference Type" appState.locale + , gettext "Short UUID" appState.locale ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , data.shortUuid ] @@ -1664,11 +1648,11 @@ viewAddURLReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.url" appState - , lg "reference.label" appState + [ gettext "Reference Type" appState.locale + , gettext "URL" appState.locale + , gettext "Label" appState.locale ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , data.url , data.label ] @@ -1685,11 +1669,11 @@ viewAddCrossReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.targetUuid" appState - , lg "reference.description" appState + [ gettext "Reference Type" appState.locale + , gettext "Target UUID" appState.locale + , gettext "Description" appState.locale ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , data.targetUuid , data.description ] @@ -1708,13 +1692,13 @@ viewEditReferenceDiff appState event reference = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "referenceType" appState - , lg "reference.shortUuid" appState + [ gettext "Reference Type" appState.locale + , gettext "Short UUID" appState.locale ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , referenceData.shortUuid ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , EventField.getValueWithDefault eventData.shortUuid referenceData.shortUuid ] @@ -1728,15 +1712,15 @@ viewEditReferenceDiff appState event reference = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "referenceType" appState - , lg "reference.url" appState - , lg "reference.label" appState + [ gettext "Reference Type" appState.locale + , gettext "URL" appState.locale + , gettext "Label" appState.locale ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , referenceData.url , referenceData.label ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , EventField.getValueWithDefault eventData.url referenceData.url , EventField.getValueWithDefault eventData.label referenceData.label ] @@ -1751,15 +1735,15 @@ viewEditReferenceDiff appState event reference = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "referenceType" appState - , lg "reference.targetUuid" appState - , lg "reference.description" appState + [ gettext "Reference Type" appState.locale + , gettext "Target UUID" appState.locale + , gettext "Description" appState.locale ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , referenceData.targetUuid , referenceData.description ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , EventField.getValueWithDefault eventData.targetUuid referenceData.targetUuid , EventField.getValueWithDefault eventData.description referenceData.description ] @@ -1790,10 +1774,10 @@ viewEditResourcePageReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.shortUuid" appState + [ gettext "Reference Type" appState.locale + , gettext "Short UUID" appState.locale ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , EventField.getValueWithDefault data.shortUuid "" ] @@ -1809,11 +1793,11 @@ viewEditURLReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.url" appState - , lg "reference.label" appState + [ gettext "Reference Type" appState.locale + , gettext "URL" appState.locale + , gettext "Label" appState.locale ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , EventField.getValueWithDefault data.url "" , EventField.getValueWithDefault data.label "" ] @@ -1830,11 +1814,11 @@ viewEditCrossReferenceDiff appState data = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.targetUuid" appState - , lg "reference.description" appState + [ gettext "Reference Type" appState.locale + , gettext "Target UUID" appState.locale + , gettext "Description" appState.locale ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , EventField.getValueWithDefault data.targetUuid "" , EventField.getValueWithDefault data.description "" ] @@ -1859,10 +1843,10 @@ viewDeleteResourcePageReferenceDiff appState data = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.shortUuid" appState + [ gettext "Reference Type" appState.locale + , gettext "Short UUID" appState.locale ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , data.shortUuid ] @@ -1878,11 +1862,11 @@ viewDeleteURLReferenceDiff appState data = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.url" appState - , lg "reference.label" appState + [ gettext "Reference Type" appState.locale + , gettext "URL" appState.locale + , gettext "Label" appState.locale ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , data.url , data.label ] @@ -1899,11 +1883,11 @@ viewDeleteCrossReferenceDiff appState data = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.targetUuid" appState - , lg "reference.description" appState + [ gettext "Reference Type" appState.locale + , gettext "Target UUID" appState.locale + , gettext "Description" appState.locale ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , data.targetUuid , data.description ] @@ -1928,10 +1912,10 @@ viewMoveResourcePageReference appState data = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.shortUuid" appState + [ gettext "Reference Type" appState.locale + , gettext "Short UUID" appState.locale ] - [ lg "referenceType.resourcePage" appState + [ gettext "Resource Page" appState.locale , data.shortUuid ] @@ -1947,11 +1931,11 @@ viewMoveURLReference appState data = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.url" appState - , lg "reference.label" appState + [ gettext "Reference Type" appState.locale + , gettext "URL" appState.locale + , gettext "Label" appState.locale ] - [ lg "referenceType.url" appState + [ gettext "URL" appState.locale , data.url , data.label ] @@ -1968,11 +1952,11 @@ viewMoveCrossReference appState data = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "referenceType" appState - , lg "reference.targetUuid" appState - , lg "reference.description" appState + [ gettext "Reference Type" appState.locale + , gettext "Target UUID" appState.locale + , gettext "Description" appState.locale ] - [ lg "referenceType.cross" appState + [ gettext "Cross Reference" appState.locale , data.targetUuid , data.description ] @@ -1989,8 +1973,8 @@ viewAddExpertDiff appState event = fieldDiff = viewAdd <| List.map2 (\a b -> ( a, b )) - [ lg "expert.name" appState - , lg "expert.email" appState + [ gettext "Name" appState.locale + , gettext "Email" appState.locale ] [ event.name , event.email @@ -2008,8 +1992,8 @@ viewEditExpertDiff appState event expert = fieldDiff = viewDiff <| List.map3 (\a b c -> ( a, b, c )) - [ lg "expert.name" appState - , lg "expert.email" appState + [ gettext "Name" appState.locale + , gettext "Email" appState.locale ] [ expert.name , expert.email @@ -2030,8 +2014,8 @@ viewDeleteExpertDiff appState expert = fieldDiff = viewDelete <| List.map2 (\a b -> ( a, b )) - [ lg "expert.name" appState - , lg "expert.email" appState + [ gettext "Name" appState.locale + , gettext "Email" appState.locale ] [ expert.name , expert.email @@ -2049,8 +2033,8 @@ viewMoveExpert appState expert = fieldDiff = viewPlain <| List.map2 (\a b -> ( a, b )) - [ lg "expert.name" appState - , lg "expert.email" appState + [ gettext "Name" appState.locale + , gettext "Email" appState.locale ] [ expert.name , expert.email @@ -2295,7 +2279,7 @@ viewAnnotationsDiff appState originalAnnotations currentAnnotations = in div [ class "form-group" ] [ label [ class "control-label" ] - [ text (lg "annotations" appState) ] + [ text (gettext "Annotations" appState.locale) ] , div [ class "form-value" ] [ valueView ] ] @@ -2305,13 +2289,13 @@ formActions : AppState -> Model -> Html Msg formActions appState model = let ( rejectLabel, rejectDisabled ) = - actionState appState model RejectButtonClicked (l_ "action.reject" appState) + actionState appState model RejectButtonClicked (gettext "Reject" appState.locale) ( applyLabel, applyDisabled ) = - actionState appState model ApplyButtonClicked (l_ "action.apply" appState) + actionState appState model ApplyButtonClicked (gettext "Apply" appState.locale) ( applyAllLabel, applyAllDisabled ) = - actionState appState model ApplyAllButtonClicked (l_ "action.applyAll" appState) + actionState appState model ApplyAllButtonClicked (gettext "Apply all" appState.locale) in div [ class "form-actions" ] [ button [ class "btn btn-warning btn-with-loader", onClick RejectEvent, rejectDisabled, dataCy "km-migration_reject-button" ] @@ -2353,16 +2337,16 @@ viewCompletedMigration appState model = [ div [ class "p-5 mb-4 bg-light rounded-3 full-page-error", dataCy "km-migration_completed" ] [ h1 [ class "display-3" ] [ faSet "_global.success" appState ] , p [ class "fs-4" ] - [ lx_ "completed.msg1" appState + [ text (gettext "Migration successfully completed." appState.locale) , br [] [] - , lx_ "completed.msg2" appState + , text (gettext "You can publish the new version now." appState.locale) ] , linkTo appState (Routes.kmEditorPublish model.branchUuid) [ class "btn btn-primary btn-lg with-icon-after" , dataCy "km-migration_publish-button" ] - [ lx_ "completed.publish" appState + [ text (gettext "Publish" appState.locale) , faSet "_global.arrowRight" appState ] ] diff --git a/engine-wizard/elm/Wizard/KMEditor/Publish/Update.elm b/engine-wizard/elm/Wizard/KMEditor/Publish/Update.elm index 573058537..28cb295d7 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Publish/Update.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Publish/Update.elm @@ -6,12 +6,12 @@ module Wizard.KMEditor.Publish.Update exposing import ActionResult exposing (ActionResult(..)) import Form import Form.Field as Field +import Gettext exposing (gettext) import Shared.Api.Branches as BranchesApi import Shared.Api.Packages as PackagesApi import Shared.Data.BranchDetail exposing (BranchDetail) import Shared.Data.PackageDetail exposing (PackageDetail) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Uuid exposing (Uuid) import Version exposing (Version) import Wizard.Common.Api exposing (getResultCmd) @@ -71,7 +71,7 @@ handleGetBranchCompleted wrapMsg appState model result = ) Err error -> - ( { model | branch = ApiError.toActionResult appState (lg "apiError.branches.getError" appState) error } + ( { model | branch = ApiError.toActionResult appState (gettext "Unable to get the knowledge model editor." appState.locale) error } , getResultCmd result ) @@ -142,6 +142,6 @@ handlePutBranchCompleted appState model result = ( model, cmdNavigate appState Routes.knowledgeModelsIndex ) Err error -> - ( { model | publishingBranch = ApiError.toActionResult appState (lg "apiError.packages.version.postError" appState) error } + ( { model | publishingBranch = ApiError.toActionResult appState (gettext "Publishing the new version failed." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/KMEditor/Publish/View.elm b/engine-wizard/elm/Wizard/KMEditor/Publish/View.elm index 976cb1e20..3b414a85c 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Publish/View.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Publish/View.elm @@ -3,13 +3,14 @@ module Wizard.KMEditor.Publish.View exposing (view) import Form exposing (Form) import Form.Field exposing (FieldValue(..)) import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, div, label, p, text) import Html.Attributes exposing (class, href, id, name, target) import Html.Events exposing (onClick) import Shared.Data.BranchDetail exposing (BranchDetail) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lh, lx) import Shared.Utils exposing (flip) +import String.Format as String import Version exposing (Version) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy, wideDetailClass) @@ -28,21 +29,6 @@ import Wizard.KMEditor.Routes as KMEditorRoutes import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KMEditor.Publish.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KMEditor.Publish.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KMEditor.Publish.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (contentView appState model) model.branch @@ -51,14 +37,14 @@ view appState model = contentView : AppState -> Model -> BranchDetail -> Html Msg contentView appState model branch = div [ wideDetailClass "KMEditor__Publish" ] - [ Page.header (l_ "header" appState) [] + [ Page.header (gettext "Publish new version" appState.locale) [] , div [] [ FormResult.view appState model.publishingBranch , formView appState model.form branch , FormActions.viewCustomButton appState (Routes.KMEditorRoute (KMEditorRoutes.EditorRoute branch.uuid (KMEditorRoute.Edit Nothing))) (ActionButton.buttonWithAttrs appState - (ActionButton.ButtonWithAttrsConfig (l_ "action" appState) + (ActionButton.ButtonWithAttrsConfig (gettext "Publish" appState.locale) model.publishingBranch (FormMsg Form.Submit) False @@ -76,16 +62,21 @@ formView appState form branch = BranchUtils.lastVersion appState branch in div [] - [ Html.map FormMsg <| FormGroup.textView "name" branch.name <| l_ "form.name" appState - , Html.map FormMsg <| FormGroup.codeView branch.kmId <| l_ "form.kmId" appState + [ Html.map FormMsg <| FormGroup.textView "name" branch.name <| gettext "Knowledge Model" appState.locale + , Html.map FormMsg <| FormGroup.codeView branch.kmId <| gettext "Knowledge Model ID" appState.locale , lastVersion appState mbVersion , versionInputGroup appState form mbVersion - , Html.map FormMsg <| FormGroup.input appState form "license" <| l_ "form.license" appState - , FormExtra.blockAfter <| lh_ "form.license.description" [ a [ href "https://spdx.org/licenses/", target "_blank" ] [ text (l_ "form.license.description.license" appState) ] ] appState - , Html.map FormMsg <| FormGroup.input appState form "description" <| l_ "form.description" appState - , FormExtra.textAfter <| l_ "form.description.description" appState - , Html.map FormMsg <| FormGroup.markdownEditor appState form "readme" <| l_ "form.readme" appState - , FormExtra.textAfter <| l_ "form.readme.description" appState + , Html.map FormMsg <| FormGroup.input appState form "license" <| gettext "License" appState.locale + , FormExtra.blockAfter <| + String.formatHtml + (gettext "Choose a %s so others can use your Knowledge Model." appState.locale) + [ a [ href "https://spdx.org/licenses/", target "_blank" ] + [ text (gettext "license" appState.locale) ] + ] + , Html.map FormMsg <| FormGroup.input appState form "description" <| gettext "Description" appState.locale + , FormExtra.textAfter <| gettext "Short description of the Knowledge Model." appState.locale + , Html.map FormMsg <| FormGroup.markdownEditor appState form "readme" <| gettext "Readme" appState.locale + , FormExtra.textAfter <| gettext "Describe the Knowledge Model, you can use markdown." appState.locale ] @@ -93,8 +84,8 @@ lastVersion : AppState -> Maybe Version -> Html msg lastVersion appState mbVersion = mbVersion |> Maybe.map Version.toString - |> Maybe.withDefault (l_ "form.lastVersion.empty" appState) - |> flip (FormGroup.textView "last-version") (l_ "form.lastVersion" appState) + |> Maybe.withDefault (gettext "No version of this package has been published yet." appState.locale) + |> flip (FormGroup.textView "last-version") (gettext "Last version" appState.locale) versionInputGroup : AppState -> Form FormError BranchPublishForm -> Maybe Version -> Html Msg @@ -133,7 +124,7 @@ versionInputGroup appState form mbVersion = |> Maybe.withDefault (Version.create 0 0 1) in div [ class "form-group" ] - [ label [ class "control-label" ] [ lx_ "form.newVersion" appState ] + [ label [ class "control-label" ] [ text (gettext "New version" appState.locale) ] , div [ class "version-inputs" ] [ Html.map FormMsg <| Input.baseInput "number" String Form.Text majorField [ class <| "form-control" ++ errorClass, Html.Attributes.min "0", name "version-major", id "version-major" ] , text "." @@ -142,10 +133,10 @@ versionInputGroup appState form mbVersion = , Html.map FormMsg <| Input.baseInput "number" String Form.Text patchField [ class <| "form-control" ++ errorClass, Html.Attributes.min "0", name "version-patch", id "version-patch" ] ] , p [ class "form-text text-muted version-suggestions" ] - [ lx_ "form.newVersion.suggestions" appState + [ text (gettext "Suggestions: " appState.locale) , a [ onClick <| FormSetVersion nextMajor ] [ text <| Version.toString nextMajor ] , a [ onClick <| FormSetVersion nextMinor ] [ text <| Version.toString nextMinor ] , a [ onClick <| FormSetVersion nextPatch ] [ text <| Version.toString nextPatch ] ] - , FormExtra.text <| l_ "form.newVersion.description" appState + , FormExtra.text <| gettext "The version number is in format X.Y.Z. Increasing number Z indicates only some fixes, number Y minor changes, and number X indicates a major change." appState.locale ] diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Detail/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Detail/Update.elm index 1645d7685..9be117e88 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Detail/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Detail/Update.elm @@ -4,9 +4,9 @@ module Wizard.KnowledgeModels.Detail.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Packages as PackagesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setPackage) import Wizard.Common.Api exposing (applyResult, getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -29,7 +29,7 @@ update msg wrapMsg appState model = GetPackageCompleted result -> applyResult appState { setResult = setPackage - , defaultError = lg "apiError.packages.getError" appState + , defaultError = gettext "Unable to get the Knowledge Model." appState.locale , model = model , result = result } @@ -66,6 +66,6 @@ deleteVersionCompleted appState model result = ( model, cmdNavigate appState Routes.knowledgeModelsIndex ) Err error -> - ( { model | deletingVersion = ApiError.toActionResult appState (lg "apiError.packages.deleteError" appState) error } + ( { model | deletingVersion = ApiError.toActionResult appState (gettext "Knowledge Model could not be deleted." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Detail/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Detail/View.elm index cd31627fd..d8e07a0e3 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Detail/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Detail/View.elm @@ -1,5 +1,6 @@ module Wizard.KnowledgeModels.Detail.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, a, div, li, p, strong, text, ul) import Html.Attributes exposing (class, href, target) import Html.Events exposing (onClick) @@ -8,9 +9,9 @@ import Shared.Data.OrganizationInfo exposing (OrganizationInfo) import Shared.Data.Package.PackageState as PackageState import Shared.Data.PackageDetail exposing (PackageDetail) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lgx, lh, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (listFilterJust, listInsertIf) +import String.Format as String import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.DetailPage as DetailPage @@ -25,21 +26,6 @@ import Wizard.KnowledgeModels.Detail.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Detail.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KnowledgeModels.Detail.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Detail.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewPackage appState model) model.package @@ -64,7 +50,7 @@ header appState package = [ dataCy "km-detail_preview-link" ] [ faSet "kmDetail.preview" appState - , lgx "km.action.preview" appState + , text (gettext "Preview" appState.locale) ] previewActionVisible = @@ -76,7 +62,7 @@ header appState package = [ dataCy "km-detail_create-editor-link" ] [ faSet "kmDetail.createKMEditor" appState - , lgx "km.action.kmEditor" appState + , text (gettext "Create KM editor" appState.locale) ] createEditorActionVisible = @@ -88,7 +74,7 @@ header appState package = [ dataCy "km-detail_fork-link" ] [ faSet "kmDetail.fork" appState - , lgx "km.action.fork" appState + , text (gettext "Fork KM" appState.locale) ] forkActionVisible = @@ -101,7 +87,7 @@ header appState package = , dataCy "km-detail_create-project-link" ] [ faSet "kmDetail.createQuestionnaire" appState - , lgx "km.action.project" appState + , text (gettext "Create project" appState.locale) ] createProjectActionVisible = @@ -113,7 +99,7 @@ header appState package = , dataCy "km-detail_export-link" ] [ faSet "_global.export" appState - , lgx "km.action.export" appState + , text (gettext "Export" appState.locale) ] exportActionVisible = @@ -126,7 +112,7 @@ header appState package = , dataCy "km-detail_delete-link" ] [ faSet "_global.delete" appState - , lgx "km.action.delete" appState + , text (gettext "Delete" appState.locale) ] deleteActionVisible = @@ -153,7 +139,7 @@ readme appState package = warning = if containsNewerVersions then div [ class "alert alert-warning" ] - [ lx_ "readme.versionWarning" appState ] + [ text (gettext "This is not the latest available version of this Knowledge Model." appState.locale) ] else newVersionInRegistryWarning appState package @@ -174,13 +160,14 @@ newVersionInRegistryWarning appState package = in div [ class "alert alert-warning" ] (faSet "_global.warning" appState - :: lh_ "registryVersion.warning" + :: String.formatHtml (gettext "There is a newer version (%s) available." appState.locale) [ strong [] [ text (Version.toString remoteLatestVersion) ] ] - appState ++ [ linkTo appState (Routes.templatesImport (Just latestPackageId)) [ class "btn btn-primary btn-sm with-icon ms-2" ] - [ faSet "kmImport.fromRegistry" appState, lx_ "registryVersion.warning.import" appState ] + [ faSet "kmImport.fromRegistry" appState + , text (gettext "Import" appState.locale) + ] ] ) @@ -206,16 +193,16 @@ sidePanelKmInfo : AppState -> PackageDetail -> Maybe ( String, String, Html msg sidePanelKmInfo appState package = let kmInfoList = - [ ( lg "package.id" appState, "id", text package.id ) - , ( lg "package.version" appState, "version", text <| Version.toString package.version ) - , ( lg "package.metamodel" appState, "metamodel", text <| String.fromInt package.metamodelVersion ) - , ( lg "package.license" appState, "license", text package.license ) + [ ( gettext "ID" appState.locale, "id", text package.id ) + , ( gettext "Version" appState.locale, "version", text <| Version.toString package.version ) + , ( gettext "Metamodel" appState.locale, "metamodel", text <| String.fromInt package.metamodelVersion ) + , ( gettext "License" appState.locale, "license", text package.license ) ] parentInfo = case package.forkOfPackageId of Just parentPackageId -> - [ ( lg "package.forkOf" appState + [ ( gettext "Fork of" appState.locale , "fork-of" , linkTo appState (Routes.knowledgeModelsDetail parentPackageId) [] [ text parentPackageId ] ) @@ -224,7 +211,7 @@ sidePanelKmInfo appState package = Nothing -> [] in - Just ( lg "package" appState, "package", DetailPage.sidePanelList 4 8 <| kmInfoList ++ parentInfo ) + Just ( gettext "Knowledge Model" appState.locale, "package", DetailPage.sidePanelList 4 8 <| kmInfoList ++ parentInfo ) sidePanelOtherVersions : AppState -> PackageDetail -> Maybe ( String, String, Html msg ) @@ -246,7 +233,7 @@ sidePanelOtherVersions appState package = |> List.map versionLink in if List.length versionLinks > 0 then - Just ( lg "package.otherVersions" appState, "other-versions", ul [] versionLinks ) + Just ( gettext "Other versions" appState.locale, "other-versions", ul [] versionLinks ) else Nothing @@ -256,7 +243,7 @@ sidePanelOrganizationInfo : AppState -> PackageDetail -> Maybe ( String, String, sidePanelOrganizationInfo appState package = let toOrganizationInfo organization = - ( lg "package.publishedBy" appState, "published-by", viewOrganization organization ) + ( gettext "Published by" appState.locale, "published-by", viewOrganization organization ) in Maybe.map toOrganizationInfo package.organization @@ -265,11 +252,11 @@ sidePanelRegistryLink : AppState -> PackageDetail -> Maybe ( String, String, Htm sidePanelRegistryLink appState package = let toRegistryLinkInfo registryLink = - ( lg "package.registryLink" appState + ( gettext "Registry Link" appState.locale , "registry-link" , a [ href registryLink, target "_blank", class "with-icon" ] [ faSet "kmDetail.registryLink" appState - , lx_ "registryLinkLabel" appState + , text (gettext "View in registry" appState.locale) ] ) in @@ -288,15 +275,18 @@ deleteVersionModal appState model package = let modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text package.id ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s?" appState.locale) + [ strong [] [ text package.id ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete version" appState.locale , modalContent = modalContent , visible = model.showDeleteDialog , actionResult = model.deletingVersion - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteVersion , cancelMsg = Just <| ShowDeleteDialog False , dangerous = True diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/Update.elm index 9a2e71edb..cb65e3fc5 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/Update.elm @@ -2,10 +2,10 @@ module Wizard.KnowledgeModels.Import.FileImport.Update exposing (update) import ActionResult exposing (ActionResult(..)) import File +import Gettext exposing (gettext) import Json.Decode exposing (decodeValue) import Shared.Api.Packages as PackagesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.KnowledgeModels.Import.FileImport.Models exposing (Model, dropzoneId, fileInputId) @@ -68,6 +68,6 @@ importPackageCompleted appState model result = ( model, cmdNavigate appState Routes.knowledgeModelsIndex ) Err error -> - ( { model | importing = ApiError.toActionResult appState (lg "apiError.packages.importError" appState) error } + ( { model | importing = ApiError.toActionResult appState (gettext "Importing the package failed." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/View.elm index 2234f8e39..107c7746d 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/FileImport/View.elm @@ -2,12 +2,12 @@ module Wizard.KnowledgeModels.Import.FileImport.View exposing (view) import ActionResult exposing (ActionResult(..)) import File +import Gettext exposing (gettext) import Html exposing (Attribute, Html, button, div, input, label, p, text) import Html.Attributes exposing (class, disabled, id, type_) import Html.Events exposing (custom, on, onClick) import Json.Decode as Decode import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.ActionButton as ActionButton @@ -16,16 +16,6 @@ import Wizard.KnowledgeModels.Import.FileImport.Models exposing (Model, dropzone import Wizard.KnowledgeModels.Import.FileImport.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Import.FileImport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Import.FileImport.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -62,8 +52,8 @@ fileView appState model fileName = ] , div [ class "actions" ] [ button [ disabled cancelDisabled, onClick Cancel, class "btn btn-secondary" ] - [ lx_ "fileView.cancel" appState ] - , ActionButton.button appState <| ActionButton.ButtonConfig (l_ "fileView.upload" appState) model.importing Submit False + [ text (gettext "Cancel" appState.locale) ] + , ActionButton.button appState <| ActionButton.ButtonConfig (gettext "Upload" appState.locale) model.importing Submit False ] ] @@ -72,10 +62,10 @@ dropzone : AppState -> Model -> Html Msg dropzone appState model = div (dropzoneAttributes model) [ label [ class "btn btn-secondary btn-file" ] - [ lx_ "dropzone.choose" appState + [ text (gettext "Choose a file" appState.locale) , input [ id fileInputId, type_ "file", on "change" (Decode.succeed FileSelected) ] [] ] - , p [] [ lx_ "dropzone.drop" appState ] + , p [] [ text (gettext "Or just drop it here" appState.locale) ] ] diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/Update.elm index 6d59ac5d2..5e6a3241a 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/Update.elm @@ -3,10 +3,10 @@ module Wizard.KnowledgeModels.Import.OwlImport.Update exposing (update) import ActionResult exposing (ActionResult(..)) import File import Form +import Gettext exposing (gettext) import Json.Decode exposing (decodeValue) import Shared.Api.Packages as PackagesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.KnowledgeModels.Common.OwlImportForm as OwlImportForm @@ -82,6 +82,6 @@ importOwlCompleted appState model result = ( model, cmdNavigate appState Routes.knowledgeModelsIndex ) Err error -> - ( { model | importing = ApiError.toActionResult appState (lg "apiError.packages.importError" appState) error } + ( { model | importing = ApiError.toActionResult appState (gettext "Importing the package failed." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/View.elm index 097ee0ae9..4d3d5d4ff 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/OwlImport/View.elm @@ -3,12 +3,12 @@ module Wizard.KnowledgeModels.Import.OwlImport.View exposing (view) import ActionResult exposing (ActionResult(..)) import File import Form +import Gettext exposing (gettext) import Html exposing (Attribute, Html, a, div, input, label, p, text) import Html.Attributes exposing (class, disabled, id, type_) import Html.Events exposing (custom, on, onClick) import Json.Decode as Decode import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.ActionButton as ActionButton @@ -20,16 +20,6 @@ import Wizard.KnowledgeModels.Import.OwlImport.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Import.OwlImport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Import.OwlImport.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -43,25 +33,25 @@ view appState model = fileGroup = div [ class "form-group" ] - [ label [] [ lx_ "form.file" appState ] + [ label [] [ text (gettext "File" appState.locale) ] , content ] formView = Html.map FormMsg <| div [] - [ FormGroup.input appState model.form "name" (l_ "form.name" appState) - , FormGroup.input appState model.form "organizationId" (l_ "form.organizationId" appState) - , FormGroup.input appState model.form "kmId" (l_ "form.kmId" appState) - , FormGroup.input appState model.form "version" (l_ "form.version" appState) - , FormGroup.input appState model.form "previousPackageId" (l_ "form.previousPackageId" appState) - , FormGroup.input appState model.form "rootElement" (l_ "form.rootElement" appState) + [ FormGroup.input appState model.form "name" (gettext "Name" appState.locale) + , FormGroup.input appState model.form "organizationId" (gettext "Organization ID" appState.locale) + , FormGroup.input appState model.form "kmId" (gettext "Knowledge Model ID" appState.locale) + , FormGroup.input appState model.form "version" (gettext "Version" appState.locale) + , FormGroup.input appState model.form "previousPackageId" (gettext "Previous Package ID" appState.locale) + , FormGroup.input appState model.form "rootElement" (gettext "Root Element" appState.locale) ] formActions = FormActions.view appState Routes.knowledgeModelsIndex - (ActionButton.ButtonConfig (l_ "form.upload" appState) model.importing (FormMsg <| Form.Submit) False) + (ActionButton.ButtonConfig (gettext "Upload" appState.locale) model.importing (FormMsg <| Form.Submit) False) in div [ class "KnowledgeModels__Import__FileImport", id dropzoneId, dataCy "km_import_file" ] [ FormResult.view appState model.importing @@ -98,10 +88,10 @@ dropzone : AppState -> Model -> Html Msg dropzone appState model = div (dropzoneAttributes model) [ label [ class "btn btn-secondary btn-file" ] - [ lx_ "dropzone.choose" appState + [ text (gettext "Choose a file" appState.locale) , input [ id fileInputId, type_ "file", on "change" (Decode.succeed FileSelected) ] [] ] - , p [] [ lx_ "dropzone.drop" appState ] + , p [] [ text (gettext "Or just drop it here" appState.locale) ] ] diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/Update.elm index a10e2f346..a129f5e82 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/Update.elm @@ -1,8 +1,8 @@ module Wizard.KnowledgeModels.Import.RegistryImport.Update exposing (update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Packages as PackagesApi -import Shared.Locale exposing (lg) import Shared.Setters exposing (setPulling) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -29,7 +29,7 @@ update msg wrapMsg appState model = PullPackageCompleted result -> applyResult appState { setResult = setPulling - , defaultError = lg "apiError.packages.pullError" appState + , defaultError = gettext "Unable to import the package." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/View.elm index fc1f179a7..efab392b0 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/RegistryImport/View.elm @@ -1,12 +1,13 @@ module Wizard.KnowledgeModels.Import.RegistryImport.View exposing (view) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, code, div, h1, hr, input, p, text) import Html.Attributes exposing (class, href, placeholder, target, type_, value) import Html.Events exposing (onInput, onSubmit) import Shared.Data.BootstrapConfig.RegistryConfig exposing (RegistryConfig(..)) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -17,21 +18,6 @@ import Wizard.KnowledgeModels.Import.RegistryImport.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Import.RegistryImport.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KnowledgeModels.Import.RegistryImport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Import.RegistryImport.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -58,11 +44,11 @@ viewForm appState model = , type_ "text" , value model.packageId , class "form-control" - , placeholder <| lg "package.knowledgeModelId" appState + , placeholder <| gettext "Knowledge Model ID" appState.locale ] [] , ActionButton.submit appState - { label = l_ "form.import" appState + { label = gettext "Import" appState.locale , result = model.pulling } ] @@ -77,10 +63,11 @@ viewRegistryText appState = case appState.config.registry of RegistryEnabled url -> p [] - (lh_ "registryLink" - [ a [ href url, target "_blank" ] [ lx_ "registry" appState ] + (String.formatHtml + (gettext "You can find Knowledge Models in %s." appState.locale) + [ a [ href url, target "_blank" ] + [ text (gettext "DSW Registry" appState.locale) ] ] - appState ) _ -> @@ -92,11 +79,14 @@ viewImported appState packageId = div [ class "px-4 py-5 bg-light rounded-3" ] [ h1 [] [ faSet "_global.success" appState ] , p [ class "lead" ] - (lh_ "imported.message" [ code [] [ text packageId ] ] appState) + (String.formatHtml + (gettext "Knowledge Model %s has been imported!" appState.locale) + [ code [] [ text packageId ] ] + ) , p [ class "lead" ] [ linkTo appState (Routes.knowledgeModelsDetail packageId) [ class "btn btn-primary" ] - [ lx_ "imported.action" appState ] + [ text (gettext "View detail" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Import/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Import/View.elm index 19f892257..12507ec38 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Import/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Import/View.elm @@ -1,11 +1,11 @@ module Wizard.KnowledgeModels.Import.View exposing (view) -import Html exposing (Html, a, div, li, ul) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, li, text, ul) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) import Shared.Data.BootstrapConfig.RegistryConfig exposing (RegistryConfig(..)) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Shared.Utils exposing (listInsertIf) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy, detailClass) @@ -17,22 +17,12 @@ import Wizard.KnowledgeModels.Import.OwlImport.View as OwlImportView import Wizard.KnowledgeModels.Import.RegistryImport.View as RegistryImportView -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Import.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Import.View" - - view : AppState -> Model -> Html Msg view appState model = let owlNavItem = viewNavbarItem - (lx_ "navbar.fromOwl" appState) + (text (gettext "From OWL" appState.locale)) (faSet "kmImport.fromOwl" appState) (isOwlImportModel model) ShowOwlImport @@ -40,7 +30,7 @@ view appState model = registryNavItem = viewNavbarItem - (lx_ "navbar.fromRegistry" appState) + (text (gettext "From DSW Registry" appState.locale)) (faSet "kmImport.fromRegistry" appState) (isRegistryImportModel model) ShowRegistryImport @@ -48,7 +38,7 @@ view appState model = fileNavItem = viewNavbarItem - (lx_ "navbar.fromFile" appState) + (text (gettext "From file" appState.locale)) (faSet "kmImport.fromFile" appState) (isFileImportModel model) ShowFileImport @@ -90,7 +80,7 @@ view appState model = emptyNode in div [ detailClass "KnowledgeModels__Import" ] - [ Page.header (l_ "header" appState) [] + [ Page.header (gettext "Import Knowledge Model" appState.locale) [] , navbar , content ] diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Index/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Index/Update.elm index e4aacd4bb..ebce244f2 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Index/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Index/Update.elm @@ -4,11 +4,11 @@ module Wizard.KnowledgeModels.Index.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Packages as PackagesApi import Shared.Data.Package exposing (Package) import Shared.Data.PaginationQueryFilters as PaginationQueryFilters import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.Models as Listing @@ -68,7 +68,7 @@ deletePackageCompleted appState model result = ) Err error -> - ( { model | deletingPackage = ApiError.toActionResult appState (lg "apiError.packages.deleteError" appState) error } + ( { model | deletingPackage = ApiError.toActionResult appState (gettext "Knowledge Model could not be deleted." appState.locale) error } , getResultCmd result ) @@ -91,7 +91,7 @@ handleListingMsg wrapMsg appState listingMsg model = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Listing.UpdateConfig Package listingUpdateConfig wrapMsg appState = { getRequest = PackagesApi.getPackages - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.knowledgeModelsIndexWithFilters PaginationQueryFilters.empty } diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Index/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Index/View.elm index d6f356b7a..805a7ad75 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Index/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Index/View.elm @@ -1,13 +1,14 @@ module Wizard.KnowledgeModels.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, code, div, img, p, span, strong, text) import Html.Attributes exposing (class, src, title) import Shared.Components.Badge as Badge import Shared.Data.Package exposing (Package) import Shared.Data.Package.PackageState as PackageState import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lh, lx) import Shared.Utils exposing (listInsertIf) +import String.Format as String import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.View as Listing exposing (ListingActionType(..), ListingDropdownItem, ViewConfig) @@ -23,25 +24,10 @@ import Wizard.KnowledgeModels.Routes exposing (Route(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Index.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.KnowledgeModels.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.KnowledgeModels.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "KnowledgeModels__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Knowledge Models" appState.locale) [] , FormResult.successOnlyView appState model.deletingPackage , Listing.view appState (listingConfig appState) model.packages , deleteModal appState model @@ -55,7 +41,7 @@ importButton appState = (Routes.knowledgeModelsImport Nothing) [ class "btn btn-primary with-icon" ] [ faSet "kms.upload" appState - , lx_ "header.import" appState + , text (gettext "Import" appState.locale) ] else @@ -69,7 +55,7 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Import\" button to import a new Knowledge Model." appState.locale , updated = Just { getTime = .createdAt @@ -77,10 +63,10 @@ listingConfig appState = } , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search KMs..." appState.locale) , sortOptions = - [ ( "name", lg "package.name" appState ) - , ( "createdAt", lg "package.createdAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.KnowledgeModelsRoute << IndexRoute @@ -93,7 +79,7 @@ listingTitle appState package = span [] [ linkTo appState (Routes.knowledgeModelsDetail package.id) [] [ text package.name ] , Badge.light - (tooltip <| lg "package.latestVersion" appState) + (tooltip <| gettext "Latest version" appState.locale) [ text <| Version.toString package.version ] , listingTitleOutdatedBadge appState package ] @@ -109,7 +95,7 @@ listingTitleOutdatedBadge appState package = linkTo appState (Routes.knowledgeModelsImport packageId) [ class Badge.warningClass ] - [ lx_ "badge.outdated" appState ] + [ text (gettext "update available" appState.locale) ] else emptyNode @@ -130,7 +116,7 @@ listingDescription appState package = Nothing -> emptyNode in - span [ class "fragment", title <| lg "package.publishedBy" appState ] + span [ class "fragment", title <| gettext "Published by" appState.locale ] [ logo , text organization.name ] @@ -152,7 +138,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.view" appState - , label = lg "km.action.view" appState + , label = gettext "View detail" appState.locale , msg = ListingActionLink (Routes.knowledgeModelsDetail package.id) , dataCy = "view" } @@ -164,7 +150,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.export" appState - , label = lg "km.action.export" appState + , label = gettext "Export" appState.locale , msg = ListingActionMsg (ExportPackage package) , dataCy = "export" } @@ -176,7 +162,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmDetail.createKMEditor" appState - , label = lg "km.action.kmEditor" appState + , label = gettext "Create KM editor" appState.locale , msg = ListingActionLink (Routes.kmEditorCreate (Just package.id) (Just True)) , dataCy = "create-km-editor" } @@ -188,7 +174,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmDetail.fork" appState - , label = lg "km.action.fork" appState + , label = gettext "Fork KM" appState.locale , msg = ListingActionLink (Routes.kmEditorCreate (Just package.id) Nothing) , dataCy = "fork" } @@ -200,7 +186,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Nothing , icon = faSet "kmDetail.createQuestionnaire" appState - , label = lg "km.action.project" appState + , label = gettext "Create project" appState.locale , msg = ListingActionLink (Routes.projectsCreateCustom <| Just package.id) , dataCy = "create-project" } @@ -212,7 +198,7 @@ listingActions appState package = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = lg "km.action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg <| ShowHideDeletePackage <| Just package , dataCy = "delete" } @@ -244,15 +230,18 @@ deleteModal appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text version ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s and all its versions?" appState.locale) + [ strong [] [ text version ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete package" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingPackage - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeletePackage , cancelMsg = Just <| ShowHideDeletePackage Nothing , dangerous = True diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Preview/Update.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Preview/Update.elm index 2dcc91970..1307b4c51 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Preview/Update.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Preview/Update.elm @@ -6,6 +6,7 @@ module Wizard.KnowledgeModels.Preview.Update exposing import ActionResult exposing (ActionResult(..)) import Dict exposing (Dict) import Dict.Extra as Dict +import Gettext exposing (gettext) import Json.Encode as E import Json.Encode.Extra as E import Random exposing (Seed) @@ -23,7 +24,6 @@ import Shared.Data.QuestionnaireDetail.Reply exposing (Reply) import Shared.Data.QuestionnaireDetail.Reply.ReplyValue as ReplyValue import Shared.Data.SummaryReport.AnsweredIndicationData as AnsweredIndicationData import Shared.Error.ApiError as ApiError -import Shared.Locale exposing (lg) import Shared.Setters exposing (setKnowledgeModel, setPackage) import Shared.Utils exposing (getUuid, getUuidString) import Wizard.Common.Api exposing (applyResult) @@ -52,7 +52,7 @@ update msg wrapMsg appState model = initQuestionnaireModel appState <| applyResult appState { setResult = setKnowledgeModel - , defaultError = lg "apiError.knowledgeModels.preview.fetchError" appState + , defaultError = gettext "Unable to get the Knowledge Model." appState.locale , model = model , result = result } @@ -61,7 +61,7 @@ update msg wrapMsg appState model = initQuestionnaireModel appState <| applyResult appState { setResult = setPackage - , defaultError = lg "apiError.packages.getListError" appState + , defaultError = gettext "Unable to get Knowledge Models." appState.locale , model = model , result = result } @@ -131,7 +131,7 @@ update msg wrapMsg appState model = Err error -> ( appState.seed - , { model | creatingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.postError" appState) error } + , { model | creatingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be created." appState.locale) error } , Cmd.none ) @@ -142,7 +142,7 @@ update msg wrapMsg appState model = Err error -> ( appState.seed - , { model | creatingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.putError" appState) error } + , { model | creatingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be saved." appState.locale) error } , Cmd.none ) diff --git a/engine-wizard/elm/Wizard/KnowledgeModels/Preview/View.elm b/engine-wizard/elm/Wizard/KnowledgeModels/Preview/View.elm index 231eab8c7..a3ec65e08 100644 --- a/engine-wizard/elm/Wizard/KnowledgeModels/Preview/View.elm +++ b/engine-wizard/elm/Wizard/KnowledgeModels/Preview/View.elm @@ -1,9 +1,9 @@ module Wizard.KnowledgeModels.Preview.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Attributes exposing (class) import Shared.Data.Package exposing (Package) -import Shared.Locale exposing (l) import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.ActionResultView as ActionResultView @@ -17,11 +17,6 @@ import Wizard.KnowledgeModels.Preview.Models exposing (Model) import Wizard.KnowledgeModels.Preview.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.KnowledgeModels.Preview.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewProject appState model) model.questionnaireModel @@ -60,7 +55,7 @@ viewHeader appState model package = if Features.projectsCreateCustom appState then let cfg = - { label = l_ "createProject" appState + { label = gettext "Create project" appState.locale , result = model.creatingQuestionnaire , msg = CreateProjectMsg , dangerous = False diff --git a/engine-wizard/elm/Wizard/ProjectImporters/Index/Update.elm b/engine-wizard/elm/Wizard/ProjectImporters/Index/Update.elm index 5cd048385..4e6adedad 100644 --- a/engine-wizard/elm/Wizard/ProjectImporters/Index/Update.elm +++ b/engine-wizard/elm/Wizard/ProjectImporters/Index/Update.elm @@ -4,9 +4,9 @@ module Wizard.ProjectImporters.Index.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.QuestionnaireImporters as QuestionnaireImportersApi import Shared.Data.QuestionnaireImporter exposing (QuestionnaireImporter) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (applyResultTransformCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.Msgs as ListingMsgs @@ -41,10 +41,10 @@ update msg wrapMsg appState model = ToggleEnabledComplete result -> applyResultTransformCmd appState { setResult = \r m -> { m | togglingEnabled = r } - , defaultError = lg "apiError.questionnaireImporters.putError" appState + , defaultError = gettext "Unable to change project importer." appState.locale , model = model , result = result - , transform = always (lg "apiSuccess.questionnaireImporters.put" appState) + , transform = always (gettext "Project importer was changed successfully." appState.locale) , cmd = Cmd.map (wrapMsg << ListingMsg) Listing.fetchData } @@ -67,7 +67,7 @@ handleListingMsg wrapMsg appState listingMsg model = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Listing.UpdateConfig QuestionnaireImporter listingUpdateConfig wrapMsg appState = { getRequest = QuestionnaireImportersApi.getQuestionnaireImporters - , getError = lg "apiError.questionnaireImporters.getListError" appState + , getError = gettext "Unable to get project importers." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.ProjectImportersRoute << IndexRoute } diff --git a/engine-wizard/elm/Wizard/ProjectImporters/Index/View.elm b/engine-wizard/elm/Wizard/ProjectImporters/Index/View.elm index c5048f721..f3f1992db 100644 --- a/engine-wizard/elm/Wizard/ProjectImporters/Index/View.elm +++ b/engine-wizard/elm/Wizard/ProjectImporters/Index/View.elm @@ -1,11 +1,11 @@ module Wizard.ProjectImporters.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, span, text) import Html.Attributes exposing (class) import Shared.Components.Badge as Badge import Shared.Data.QuestionnaireImporter exposing (QuestionnaireImporter) import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lg, lx) import Shared.Utils exposing (listInsertIf) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.View as Listing exposing (ListingActionType(..), ListingDropdownItem, ViewConfig) @@ -19,20 +19,10 @@ import Wizard.ProjectImporters.Routes exposing (Route(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.ProjectImporters.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.ProjectImporters.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "ProjectImporters__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Project Importers" appState.locale) [] , FormResult.view appState model.togglingEnabled , Listing.view appState (listingConfig appState) model.questionnaireImporters ] @@ -45,13 +35,13 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "There are no project importers available." appState.locale , updated = Nothing , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search importers..." appState.locale) , sortOptions = - [ ( "name", lg "projectImporter.name" appState ) + [ ( "name", gettext "Name" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.ProjectImportersRoute << IndexRoute @@ -70,10 +60,10 @@ listingTitle appState questionnaireImporter = listingTitleBadge : AppState -> QuestionnaireImporter -> Html Msg listingTitleBadge appState questionnaireImporter = if questionnaireImporter.enabled then - Badge.success [] [ lx_ "badge.enabled" appState ] + Badge.success [] [ text (gettext "enabled" appState.locale) ] else - Badge.danger [] [ lx_ "badge.disabled" appState ] + Badge.danger [] [ text (gettext "disabled" appState.locale) ] listingDescription : QuestionnaireImporter -> Html Msg @@ -89,12 +79,12 @@ listingActions appState questionnaireImporter = ( actionIcon, actionLabel ) = if questionnaireImporter.enabled then ( faSet "questionnaireImporter.disable" appState - , l_ "action.disable" appState + , gettext "Disable" appState.locale ) else ( faSet "questionnaireImporter.enable" appState - , l_ "action.enable" appState + , gettext "Enable" appState.locale ) toggleEnabledAction = diff --git a/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/Update.elm b/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/Update.elm index 572a58030..69940bfc3 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/Update.elm @@ -1,10 +1,10 @@ module Wizard.Projects.Common.CloneProjectModal.Update exposing (UpdateConfig, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Projects.Common.CloneProjectModal.Models exposing (Model) @@ -65,13 +65,13 @@ handleDeleteQuestionnaireCompleted cfg appState model result = case result of Ok questionnaire -> ( { model - | cloningQuestionnaire = Success <| lg "apiSuccess.questionnaires.clone" appState + | cloningQuestionnaire = Success <| gettext "%s has been created." appState.locale , questionnaireToBeDeleted = Nothing } , cfg.cloneCompleteCmd questionnaire ) Err error -> - ( { model | cloningQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.cloneError" appState) error } + ( { model | cloningQuestionnaire = ApiError.toActionResult appState (gettext "Unable to clone Questionnaire." appState.locale) error } , Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/View.elm b/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/View.elm index 99ca16dad..614307514 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/CloneProjectModal/View.elm @@ -1,29 +1,15 @@ module Wizard.Projects.Common.CloneProjectModal.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, i, p, strong, text) import Html.Attributes exposing (class) -import Shared.Locale exposing (l, lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Modal as Modal import Wizard.Projects.Common.CloneProjectModal.Models exposing (Model) import Wizard.Projects.Common.CloneProjectModal.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Common.CloneProjectModal.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Common.CloneProjectModal.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Common.CloneProjectModal.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -37,17 +23,20 @@ view appState model = modalContent = [ p [] - (lh_ "cloneModal.message" [ strong [] [ text name ] ] appState) + (String.formatHtml + (gettext "Do you want to create a copy of %s?" appState.locale) + [ strong [] [ text name ] ] + ) , p [ class "text-muted" ] - [ i [] [ lx_ "cloneModal.info" appState ] ] + [ i [] [ text (gettext "The original Project will remain unchanged." appState.locale) ] ] ] modalConfig = - { modalTitle = l_ "cloneModal.title" appState + { modalTitle = gettext "Clone Project" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.cloningQuestionnaire - , actionName = l_ "cloneModal.action" appState + , actionName = gettext "Clone" appState.locale , actionMsg = CloneQuestionnaire , cancelMsg = Just <| ShowHideCloneQuestionnaire Nothing , dangerous = False diff --git a/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/Update.elm b/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/Update.elm index edb9925e3..c4611f605 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/Update.elm @@ -1,9 +1,9 @@ module Wizard.Projects.Common.DeleteProjectModal.Update exposing (UpdateConfig, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Projects.Common.DeleteProjectModal.Models exposing (Model) @@ -64,13 +64,13 @@ handleDeleteQuestionnaireCompleted cfg appState model result = case result of Ok _ -> ( { model - | deletingQuestionnaire = Success <| lg "apiSuccess.questionnaires.delete" appState + | deletingQuestionnaire = Success <| gettext "Questionnaire was successfully deleted." appState.locale , questionnaireToBeDeleted = Nothing } , cfg.deleteCompleteCmd ) Err error -> - ( { model | deletingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.deleteError" appState) error } + ( { model | deletingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be deleted." appState.locale) error } , Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/View.elm b/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/View.elm index be44218df..80d60d37c 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/DeleteProjectModal/View.elm @@ -1,23 +1,14 @@ module Wizard.Projects.Common.DeleteProjectModal.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, p, strong, text) -import Shared.Locale exposing (l, lh) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Modal as Modal import Wizard.Projects.Common.DeleteProjectModal.Models exposing (Model) import Wizard.Projects.Common.DeleteProjectModal.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Common.DeleteProjectModal.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Common.DeleteProjectModal.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -31,15 +22,18 @@ view appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text name ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s?" appState.locale) + [ strong [] [ text name ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete Project" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingQuestionnaire - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteQuestionnaire , cancelMsg = Just <| ShowHideDeleteQuestionnaire Nothing , dangerous = True diff --git a/engine-wizard/elm/Wizard/Projects/Common/QuestionnaireEditFormMemberPerms.elm b/engine-wizard/elm/Wizard/Projects/Common/QuestionnaireEditFormMemberPerms.elm index 7c18e58f2..2580c1b4f 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/QuestionnaireEditFormMemberPerms.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/QuestionnaireEditFormMemberPerms.elm @@ -10,10 +10,10 @@ module Wizard.Projects.Common.QuestionnaireEditFormMemberPerms exposing import Form.Error as Error exposing (ErrorValue(..)) import Form.Field as Field exposing (Field) import Form.Validate as V exposing (Validation) +import Gettext exposing (gettext) import Json.Encode as E import Shared.Data.QuestionnairePerm as QuestionnairePerm import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) @@ -58,10 +58,10 @@ toString perms = formOptions : AppState -> List ( String, String ) formOptions appState = - [ ( toString Viewer, lg "project.role.viewer" appState ) - , ( toString Commenter, lg "project.role.commenter" appState ) - , ( toString Editor, lg "project.role.editor" appState ) - , ( toString Owner, lg "project.role.owner" appState ) + [ ( toString Viewer, gettext "Viewer" appState.locale ) + , ( toString Commenter, gettext "Commenter" appState.locale ) + , ( toString Editor, gettext "Editor" appState.locale ) + , ( toString Owner, gettext "Owner" appState.locale ) ] diff --git a/engine-wizard/elm/Wizard/Projects/Common/View.elm b/engine-wizard/elm/Wizard/Projects/Common/View.elm index d85867e1f..0ad12089c 100644 --- a/engine-wizard/elm/Wizard/Projects/Common/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Common/View.elm @@ -1,20 +1,15 @@ module Wizard.Projects.Common.View exposing (visibilityIcons) +import Gettext exposing (gettext) import Html exposing (Html, i, span) import Html.Attributes exposing (class) import Shared.Data.Questionnaire.QuestionnaireSharing exposing (QuestionnaireSharing(..)) import Shared.Data.Questionnaire.QuestionnaireVisibility exposing (QuestionnaireVisibility(..)) -import Shared.Locale exposing (l) import Shared.Utils exposing (listInsertIf) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (tooltipRight) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Common.View" - - visibilityIcons : AppState -> { q | visibility : QuestionnaireVisibility, sharing : QuestionnaireSharing } -> List (Html msg) visibilityIcons appState questionnaire = let @@ -24,10 +19,10 @@ visibilityIcons appState questionnaire = visibleTitle = if questionnaire.visibility == VisibleEditQuestionnaire then - l_ "visibilityIcons.titleLoggedEdit" appState + gettext "Other logged-in users can edit the project." appState.locale else - l_ "visibilityIcons.titleLoggedView" appState + gettext "Other logged-in users can view the project." appState.locale linkIcon = span (tooltipRight linkTitle) @@ -35,10 +30,10 @@ visibilityIcons appState questionnaire = linkTitle = if questionnaire.sharing == AnyoneWithLinkEditQuestionnaire then - l_ "visibilityIcons.titleAnyoneEdit" appState + gettext "Anyone with the link can edit the project." appState.locale else - l_ "visibilityIcons.titleAnyoneView" appState + gettext "Anyone with the link can view the project." appState.locale in [] |> listInsertIf visibleIcon (questionnaire.visibility /= PrivateQuestionnaire) diff --git a/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/Update.elm b/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/Update.elm index 1b76dd611..05557d71b 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/Update.elm @@ -3,6 +3,7 @@ module Wizard.Projects.Create.CustomCreate.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) import Form import Form.Field as Field +import Gettext exposing (gettext) import Result exposing (Result) import Shared.Api.KnowledgeModels as KnowledgeModelsApi import Shared.Api.Packages as PackagesApi @@ -11,7 +12,6 @@ import Shared.Data.KnowledgeModel exposing (KnowledgeModel) import Shared.Data.PackageSuggestion exposing (PackageSuggestion) import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (withNoCmd) import String.Extra as String import Wizard.Common.Api exposing (getResultCmd) @@ -82,7 +82,7 @@ handleGetKnowledgeModelPreviewCompleted appState model result = { model | knowledgeModelPreview = Success knowledgeModel } Err error -> - { model | knowledgeModelPreview = ApiError.toActionResult appState (lg "apiError.knowledgeModels.tags.getError" appState) error } + { model | knowledgeModelPreview = ApiError.toActionResult appState (gettext "Unable to get question tags for the Knowledge Model." appState.locale) error } cmd = getResultCmd result @@ -137,7 +137,7 @@ handlePostQuestionnaireCompleted appState model result = ) Err error -> - ( { model | savingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.postError" appState) error } + ( { model | savingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be created." appState.locale) error } , getResultCmd result ) @@ -151,7 +151,7 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = cfg = { wrapMsg = wrapMsg << PackageTypeHintInputMsg , getTypeHints = PackagesApi.getPackagesSuggestions - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = formMsg << .id , clearReply = Just <| formMsg "" , filterResults = Nothing diff --git a/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/View.elm b/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/View.elm index 11052d8cb..e7613e3b7 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/CustomCreate/View.elm @@ -2,10 +2,10 @@ module Wizard.Projects.Create.CustomCreate.View exposing (view) import ActionResult import Form +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Attributes exposing (disabled) import Html.Events exposing (onSubmit) -import Shared.Locale exposing (l, lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput as TypeHintInput import Wizard.Common.Components.TypeHintInput.TypeHintItem as TypeHintItem @@ -20,16 +20,11 @@ import Wizard.Projects.Create.CustomCreate.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Create.CustomCreate.View" - - view : AppState -> Model -> Html Msg view appState model = let buttonConfig = - { label = l_ "form.save" appState + { label = gettext "Save" appState.locale , result = model.savingQuestionnaire , msg = FormMsg Form.Submit , dangerous = False @@ -72,8 +67,8 @@ formView appState model = FormGroup.formGroupCustom typeHintInput appState model.form "packageId" in div [] - [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| lg "questionnaire.name" appState - , parentInput <| lg "knowledgeModel" appState + [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Name" appState.locale + , parentInput <| gettext "Knowledge Model" appState.locale ] diff --git a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm index 130da1054..7a3fcf2ac 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm @@ -3,10 +3,10 @@ module Wizard.Projects.Create.TemplateCreate.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) import Form import Form.Field as Field +import Gettext exposing (gettext) import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Uuid import Wizard.Common.Api exposing (applyResultCmd, getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -44,7 +44,7 @@ update wrapMsg msg appState model = GetTemplateQuestionnaireComplete result -> applyResultCmd appState { setResult = \value record -> { record | templateQuestionnaire = value } - , defaultError = lg "apiError.questionnaires.getError" appState + , defaultError = gettext "Unable to get the project." appState.locale , model = model , result = result , cmd = Cmd.none @@ -80,7 +80,7 @@ handlePostQuestionnaireCompleted appState model result = ) Err error -> - ( { model | savingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.postError" appState) error } + ( { model | savingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be created." appState.locale) error } , getResultCmd result ) @@ -103,7 +103,7 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = , packageIds = Nothing , packageIdsOp = Nothing } - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = formMsg << Uuid.toString << .uuid , clearReply = Just <| formMsg "" , filterResults = Nothing diff --git a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/View.elm b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/View.elm index 10c78ee88..aac0c6596 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/View.elm @@ -2,10 +2,10 @@ module Wizard.Projects.Create.TemplateCreate.View exposing (view) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Html exposing (Html, div, text) import Html.Events exposing (onSubmit) import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) -import Shared.Locale exposing (l, lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput as TypeHintInput import Wizard.Common.Components.TypeHintInput.TypeHintItem as TypeHintItem @@ -19,11 +19,6 @@ import Wizard.Projects.Create.TemplateCreate.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Create.TemplateCreate.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -44,7 +39,7 @@ viewContent appState model mbQuestionnaire = , formView appState model mbQuestionnaire , FormActions.view appState (Routes.projectsIndex appState) - (ActionResult.ButtonConfig (l_ "form.save" appState) model.savingQuestionnaire (FormMsg Form.Submit) False) + (ActionResult.ButtonConfig (gettext "Save" appState.locale) model.savingQuestionnaire (FormMsg Form.Submit) False) ] @@ -58,7 +53,7 @@ formView appState model mbQuestionnaire = value = TypeHintItem.questionnaireSuggestion questionnaire in - FormGroup.plainGroup value (lg "questionnaire.template" appState) + FormGroup.plainGroup value (gettext "Project Template" appState.locale) Nothing -> let @@ -72,9 +67,9 @@ formView appState model mbQuestionnaire = typeHintInput = TypeHintInput.view appState cfg model.questionnaireTypeHintInputModel in - FormGroup.formGroupCustom typeHintInput appState model.form "questionnaireUuid" (lg "questionnaire.template" appState) + FormGroup.formGroupCustom typeHintInput appState model.form "questionnaireUuid" (gettext "Project Template" appState.locale) in div [] - [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| lg "questionnaire.name" appState + [ Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Name" appState.locale , parentInput ] diff --git a/engine-wizard/elm/Wizard/Projects/Create/View.elm b/engine-wizard/elm/Wizard/Projects/Create/View.elm index f32a192e4..3e8ff335b 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/View.elm @@ -1,9 +1,9 @@ module Wizard.Projects.Create.View exposing (view) -import Html exposing (Html, div, li, ul) +import Gettext exposing (gettext) +import Html exposing (Html, div, li, text, ul) import Html.Attributes exposing (class, classList) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Feature as Feature import Wizard.Common.Html exposing (linkTo) @@ -16,16 +16,6 @@ import Wizard.Projects.Create.TemplateCreate.View as TemplateCreateView import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Create.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Create.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -55,7 +45,7 @@ view appState model = emptyNode in div [ detailClass "Questionnaires__Create" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Create Project" appState.locale) [] , navbar , content ] @@ -71,7 +61,7 @@ viewNavbar appState templateActive = , classList [ ( "active", templateActive ) ] , dataCy "project_create_nav_template" ] - [ lx_ "navbar.fromTemplate" appState + [ text (gettext "From Project Template" appState.locale) ] ] , li [ class "nav-item" ] @@ -81,7 +71,7 @@ viewNavbar appState templateActive = , classList [ ( "active", not templateActive ) ] , dataCy "project_create_nav_custom" ] - [ lx_ "navbar.custom" appState + [ text (gettext "Custom" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/Projects/CreateMigration/Update.elm b/engine-wizard/elm/Wizard/Projects/CreateMigration/Update.elm index 2fcd58e77..b2286b34e 100644 --- a/engine-wizard/elm/Wizard/Projects/CreateMigration/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/CreateMigration/Update.elm @@ -3,6 +3,7 @@ module Wizard.Projects.CreateMigration.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) import Form import Form.Field as Field +import Gettext exposing (gettext) import Shared.Api.KnowledgeModels as KnowledgeModelsApi import Shared.Api.Packages as PackagesApi import Shared.Api.Questionnaires as QuestionnairesApi @@ -11,7 +12,6 @@ import Shared.Data.PackageSuggestion as PackageSuggestion exposing (PackageSugge import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Data.QuestionnaireMigration exposing (QuestionnaireMigration) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setQuestionnaire, setSelected) import Shared.Utils exposing (withNoCmd) import Uuid exposing (Uuid) @@ -80,7 +80,7 @@ handleGetQuestionnaireCompleted appState model result = preselectKnowledgeModel <| applyResult appState { setResult = setQuestionnaire - , defaultError = lg "apiError.questionnaires.getError" appState + , defaultError = gettext "Unable to get the project." appState.locale , model = model , result = result } @@ -147,7 +147,7 @@ handlePostMigrationCompleted appState model result = ( model, cmdNavigate appState <| Routes.projectsMigration migration.newQuestionnaire.uuid ) Err error -> - ( { model | savingMigration = ApiError.toActionResult appState (lg "apiError.questionnaires.migrations.postError" appState) error } + ( { model | savingMigration = ApiError.toActionResult appState (gettext "Questionnaire migration could not be created." appState.locale) error } , getResultCmd result ) @@ -161,7 +161,7 @@ handleGetKnowledgeModelPreviewCompleted appState model result = { model | knowledgeModelPreview = Success knowledgeModel } Err error -> - { model | knowledgeModelPreview = ApiError.toActionResult appState (lg "apiError.knowledgeModels.tags.getError" appState) error } + { model | knowledgeModelPreview = ApiError.toActionResult appState (gettext "Unable to get question tags for the Knowledge Model." appState.locale) error } cmd = getResultCmd result @@ -175,7 +175,7 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = cfg = { wrapMsg = wrapMsg << PackageTypeHintInputMsg , getTypeHints = PackagesApi.getPackagesSuggestions - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = wrapMsg << SelectPackage , clearReply = Nothing , filterResults = Nothing diff --git a/engine-wizard/elm/Wizard/Projects/CreateMigration/View.elm b/engine-wizard/elm/Wizard/Projects/CreateMigration/View.elm index dc7b19773..3eaf84cb8 100644 --- a/engine-wizard/elm/Wizard/Projects/CreateMigration/View.elm +++ b/engine-wizard/elm/Wizard/Projects/CreateMigration/View.elm @@ -1,13 +1,13 @@ module Wizard.Projects.CreateMigration.View exposing (view) import Form +import Gettext exposing (gettext) import Html exposing (Html, div, label, text) import Html.Attributes exposing (class) import Shared.Data.KnowledgeModel as KnowledgeModel import Shared.Data.PackageSuggestion as PackageSuggestion import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lg, lx) import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput as TypeHintInput @@ -25,16 +25,6 @@ import Wizard.Projects.CreateMigration.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.CreateMigration.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.CreateMigration.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (createMigrationView appState model) model.questionnaire @@ -63,7 +53,7 @@ createMigrationView appState model questionnaire = originalTagList = div [ class "form-group form-group-tags" ] - [ label [] [ lx_ "form.originalTags" appState ] + [ label [] [ text (gettext "Original question tags" appState.locale) ] , div [] [ Tag.readOnlyList appState questionnaire.selectedQuestionTagUuids tags ] ] @@ -83,34 +73,34 @@ createMigrationView appState model questionnaire = FormGroup.select appState (createOptions package) model.form "packageId" Nothing -> - FormGroup.textView "km" <| l_ "form.selectKMFirst" appState + FormGroup.textView "km" <| gettext "Select Knowledge Model first" appState.locale in div [ listClass "Questionnaires__CreateMigration" ] - [ Page.header (l_ "header.title" appState) [] - , Flash.info appState <| l_ "header.info" appState + [ Page.header (gettext "Create Migration" appState.locale) [] + , Flash.info appState <| gettext "A new Project is created for the migration. The original will remain unchanged until the migration is finished." appState.locale , FormResult.view appState model.savingMigration - , FormGroup.textView "project" questionnaire.name <| lg "project" appState + , FormGroup.textView "project" questionnaire.name <| gettext "Project" appState.locale , div [ class "form" ] [ div [] [ FormGroup.plainGroup (TypeHintItem.packageSuggestion False (PackageSuggestion.fromPackage questionnaire.package questionnaire.packageVersions)) - (l_ "form.originalKM" appState) - , FormGroup.codeView (Version.toString questionnaire.package.version) <| l_ "form.originalVersion" appState + (gettext "Original Knowledge Model" appState.locale) + , FormGroup.codeView (Version.toString questionnaire.package.version) <| gettext "Original version" appState.locale , originalTagList ] , faSet "_global.arrowRight" appState , div [] [ div [ class "form-group" ] - [ label [] [ lx_ "form.newKM" appState ] + [ label [] [ text (gettext "New Knowledge Model" appState.locale) ] , typeHintInput False ] - , Html.map FormMsg <| versionSelect <| l_ "form.newVersion" appState + , Html.map FormMsg <| versionSelect <| gettext "New version" appState.locale , tagsView appState model ] ] , FormActions.view appState (Routes.projectsIndex appState) - (ActionResult.ButtonConfig (l_ "form.create" appState) model.savingMigration (FormMsg Form.Submit) False) + (ActionResult.ButtonConfig (gettext "Create" appState.locale) model.savingMigration (FormMsg Form.Submit) False) ] diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/NewDocument.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/NewDocument.elm index efd503d4d..0b155d618 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/NewDocument.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/NewDocument.elm @@ -12,6 +12,7 @@ module Wizard.Projects.Detail.Components.NewDocument exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Field as Field +import Gettext exposing (gettext) import Html exposing (Html, br, div, p, strong, text) import Html.Attributes exposing (class) import Maybe.Extra as Maybe @@ -28,8 +29,8 @@ import Shared.Data.TemplateSuggestion exposing (TemplateSuggestion) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lh, lx) import Shared.Setters exposing (setSelected) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.SummaryReport exposing (viewIndications) @@ -48,21 +49,6 @@ import Wizard.Projects.Routes exposing (Route(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.NewDocument" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Detail.Components.NewDocument" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.Components.NewDocument" - - -- MODEL @@ -159,7 +145,7 @@ handleGetSummaryReportCompleted appState model result = Success summaryReport Err error -> - ApiError.toActionResult appState (lg "apiError.questionnaires.summaryReport.fetchError" appState) error + ApiError.toActionResult appState (gettext "Unable to get the summary report." appState.locale) error in ( { model | summaryReport = newSummaryReport }, Cmd.none ) @@ -173,7 +159,7 @@ handleGetQuestionnaireEventCompleted appState model result = Success event Err error -> - ApiError.toActionResult appState (lg "apiError.questionnaires.events.getError" appState) error + ApiError.toActionResult appState (gettext "Unable to get questionnaire event." appState.locale) error in ( { model | event = newEvent }, Cmd.none ) @@ -209,7 +195,7 @@ handleTemplateTypeHintInputMsg cfg typeHintInputMsg appState model = typeHintInputCfg = { wrapMsg = cfg.wrapMsg << TemplateTypeHintInputMsg , getTypeHints = TemplatesApi.getTemplatesFor cfg.packageId - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = formMsg << .id , clearReply = Just <| formMsg "" , filterResults = Nothing @@ -241,7 +227,7 @@ handlePostDocumentCompleted cfg appState model result = ( model, cfg.documentsNavigateCmd ) Err error -> - ( { model | savingDocument = ApiError.toActionResult appState (lg "apiError.documents.postError" appState) error }, Cmd.none ) + ( { model | savingDocument = ApiError.toActionResult appState (gettext "Document could not be created." appState.locale) error }, Cmd.none ) @@ -268,13 +254,13 @@ viewFormState : AppState -> QuestionnaireDetail -> Model -> ( SummaryReport, May viewFormState appState questionnaire model ( summaryReport, mbEvent ) = div [ class "Projects__Detail__Content Projects__Detail__Content--NewDocument" ] [ div [ detailClass "container" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "New Document" appState.locale) [] , div [] [ FormResult.view appState model.savingDocument , formView appState questionnaire mbEvent model summaryReport , FormActions.view appState (Routes.ProjectsRoute <| DetailRoute questionnaire.uuid <| ProjectDetailRoute.Documents PaginationQueryString.empty) - (ActionResult.ButtonConfig (l_ "form.create" appState) model.savingDocument (FormMsg Form.Submit) False) + (ActionResult.ButtonConfig (gettext "Create" appState.locale) model.savingDocument (FormMsg Form.Submit) False) ] ] ] @@ -291,7 +277,7 @@ formView appState questionnaire mbEvent model summaryReport = } nameInput = - FormGroup.input appState model.form "name" <| lg "document.name" appState + FormGroup.input appState model.form "name" <| gettext "Name" appState.locale templateInput = TypeHintInput.view appState cfg model.templateTypeHintInputModel @@ -299,7 +285,7 @@ formView appState questionnaire mbEvent model summaryReport = formatInput = case model.templateTypeHintInputModel.selected of Just selectedTemplate -> - FormGroup.formatRadioGroup appState selectedTemplate.formats model.form "formatUuid" <| lg "template.format" appState + FormGroup.formatRadioGroup appState selectedTemplate.formats model.form "formatUuid" <| gettext "Format" appState.locale _ -> emptyNode @@ -316,11 +302,14 @@ formView appState questionnaire mbEvent model summaryReport = linkTo appState (Routes.projectsDetailDocumentsNew questionnaire.uuid Nothing) [] - [ lx_ "oldVersionInfo.link" appState ] + [ text (gettext "Create for current version" appState.locale) ] in div [ class "alert alert-info" ] [ p [] - (lh_ "oldVersionInfo.text" [ strong [] [ br [] [], text datetime ] ] appState) + (String.formatHtml + (gettext "You are creating a document for a project version from %s" appState.locale) + [ strong [] [ br [] [], text datetime ] ] + ) , currentLink ] @@ -330,6 +319,6 @@ formView appState questionnaire mbEvent model summaryReport = div [] [ Html.map FormMsg <| nameInput , div [ class "form-group" ] [ extraInfo ] - , FormGroup.formGroupCustom templateInput appState model.form "templateId" <| lg "template" appState + , FormGroup.formGroupCustom templateInput appState model.form "templateId" <| gettext "Document Template" appState.locale , Html.map FormMsg <| formatInput ] diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/Preview.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/Preview.elm index a53f89d91..e68cd64d6 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/Preview.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/Preview.elm @@ -10,6 +10,7 @@ module Wizard.Projects.Detail.Components.Preview exposing import ActionResult exposing (ActionResult(..)) import Dict +import Gettext exposing (gettext) import Html exposing (Html, a, div, iframe, p, pre, text) import Html.Attributes exposing (class, href, src, target) import Http @@ -21,7 +22,6 @@ import Shared.Data.QuestionnaireDetail as QuestionnaireDetail exposing (Question import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Error.ServerError as ServerError import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lg, lx) import Shared.Undraw as Undraw import String.Format as String import Task @@ -33,16 +33,6 @@ import Wizard.Common.View.Page as Page import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.Preview" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.Components.Preview" - - -- MODEL @@ -109,6 +99,9 @@ handleHeadDocumentPreviewComplete appState model result = Err apiError -> let + previewError = + Preview (Error (gettext "Unable to get the document preview." appState.locale)) + previewState = case ApiError.toServerError apiError of Just (ServerError.SystemLogError data) -> @@ -119,10 +112,10 @@ handleHeadDocumentPreviewComplete appState model result = TemplateUnsupported else - Preview (Error (lg "apiError.questionnaires.headDocumentPreview" appState)) + previewError _ -> - Preview (Error (lg "apiError.questionnaires.headDocumentPreview" appState)) + previewError in ( { model | previewState = previewState }, Cmd.none ) @@ -169,13 +162,13 @@ viewNotSupported : AppState -> String -> Html msg viewNotSupported appState documentUrl = Page.illustratedMessageHtml { image = Undraw.downloadFiles - , heading = l_ "notSupported.title" appState + , heading = gettext "Download preview" appState.locale , content = - [ p [] [ lx_ "notSupported.text" appState ] + [ p [] [ text (gettext "The document format cannot be displayed in the web browser. You can still download and view it." appState.locale) ] , p [] [ a [ class "btn btn-primary btn-lg with-icon", href documentUrl, target "_blank" ] [ faSet "_global.download" appState - , lx_ "notSupported.download" appState + , text (gettext "Download" appState.locale) ] ] ] @@ -188,28 +181,28 @@ viewTemplateNotSet appState questionnaire = let content = if not (Session.exists appState.session) then - [ p [] [ lx_ "templateNotSet.textAnonymous" appState ] + [ p [] [ text (gettext "Log in to set a default document template and format." appState.locale) ] ] else if QuestionnaireDetail.isOwner appState questionnaire then - [ p [] [ lx_ "templateNotSet.textOwner" appState ] + [ p [] [ text (gettext "Before you can use preview you need to set a default document template and format." appState.locale) ] , p [] [ linkTo appState (Routes.projectsDetailSettings questionnaire.uuid) [ class "btn btn-primary btn-lg with-icon-after" ] - [ lx_ "templateNotSet.link" appState + [ text (gettext "Go to settings" appState.locale) , faSet "_global.arrowRight" appState ] ] ] else - [ p [] [ lx_ "templateNotSet.textNotOwner" appState ] + [ p [] [ text (gettext "Ask the Project owner to set a default document template and format." appState.locale) ] ] in Page.illustratedMessageHtml { image = Undraw.websiteBuilder - , heading = l_ "templateNotSet.heading" appState + , heading = gettext "Default document template is not set." appState.locale , content = content , cy = "template-not-set" } @@ -220,28 +213,28 @@ viewTemplateUnsupported appState questionnaire = let content = if not (Session.exists appState.session) then - [ p [] [ lx_ "templateUnsupported.textAnonymous" appState ] + [ p [] [ text (gettext "Log in to update the default document template." appState.locale) ] ] else if QuestionnaireDetail.isOwner appState questionnaire then - [ p [] [ lx_ "templateUnsupported.textOwner" appState ] + [ p [] [ text (gettext "Before you can use preview you need to update the default document template." appState.locale) ] , p [] [ linkTo appState (Routes.projectsDetailSettings questionnaire.uuid) [ class "btn btn-primary btn-lg with-icon-after" ] - [ lx_ "templateUnsupported.link" appState + [ text (gettext "Go to settings" appState.locale) , faSet "_global.arrowRight" appState ] ] ] else - [ p [] [ lx_ "templateUnsupported.textNotOwner" appState ] + [ p [] [ text (gettext "Ask the Project owner to update the default document template." appState.locale) ] ] in Page.illustratedMessageHtml { image = Undraw.warning - , heading = l_ "templateUnsupported.heading" appState + , heading = gettext "Default document template is no longer supported." appState.locale , content = content , cy = "template-not-set" } diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/ProjectSaving.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/ProjectSaving.elm index d79564a9e..76cca5177 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/ProjectSaving.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/ProjectSaving.elm @@ -10,20 +10,15 @@ module Wizard.Projects.Detail.Components.ProjectSaving exposing , view ) +import Gettext exposing (gettext) import Html exposing (Html, span, text) import Html.Attributes exposing (class) import Shared.Html exposing (fa, faKeyClass) -import Shared.Locale exposing (l) import Time import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (tooltipRight) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.ProjectSaving" - - -- MODEL @@ -115,17 +110,17 @@ view appState model = viewSaving : AppState -> Html Msg viewSaving appState = - viewHelper [] (faKeyClass "questionnaire.saving.saving" appState) (l_ "label.saving" appState) + viewHelper [] (faKeyClass "questionnaire.saving.saving" appState) (gettext "Saving..." appState.locale) viewSavedRecently : AppState -> Html Msg viewSavedRecently appState = - viewHelper [] (faKeyClass "questionnaire.saving.saved" appState) (l_ "label.saved" appState) + viewHelper [] (faKeyClass "questionnaire.saving.saved" appState) (gettext "Saved" appState.locale) viewSaved : AppState -> Html Msg viewSaved appState = - viewHelper (tooltipRight (l_ "popover.saved" appState)) (faKeyClass "questionnaire.saving.saved" appState) "" + viewHelper (tooltipRight (gettext "All changes have been saved" appState.locale)) (faKeyClass "questionnaire.saving.saved" appState) "" viewHelper : List (Html.Attribute Msg) -> String -> String -> Html Msg diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/RevertModal.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/RevertModal.elm index 405ce78de..4ee198888 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/RevertModal.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/RevertModal.elm @@ -9,13 +9,14 @@ module Wizard.Projects.Detail.Components.RevertModal exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, br, p, strong, text) import Maybe.Extra as Maybe import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Common.TimeUtils as TimeUtils import Shared.Data.QuestionnaireDetail.QuestionnaireEvent as QuestionnaireEvent exposing (QuestionnaireEvent) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lh) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Flash as Flash @@ -23,16 +24,6 @@ import Wizard.Common.View.Modal as Modal import Wizard.Ports as Ports -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.RevertModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Detail.Components.RevertModal" - - -- MODEL @@ -115,17 +106,20 @@ view appState model = Maybe.unwrap "" (QuestionnaireEvent.getCreatedAt >> TimeUtils.toReadableDateTime appState.timeZone) model.mbEvent content = - [ Flash.warning appState (l_ "warning" appState) + [ Flash.warning appState (gettext "Heads up! This action cannot be undone." appState.locale) , p [] - (lh_ "message" [ strong [] [ br [] [], text datetime ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to revert the projects to its state from %s?" appState.locale) + [ strong [] [ br [] [], text datetime ] ] + ) ] in Modal.confirm appState - { modalTitle = l_ "title" appState + { modalTitle = gettext "Revert questionnaire" appState.locale , modalContent = content , visible = Maybe.isJust model.mbEvent , actionResult = ActionResult.map (always "") model.revertResult - , actionName = l_ "action" appState + , actionName = gettext "Revert" appState.locale , actionMsg = Revert , cancelMsg = Just Close , dangerous = True diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings.elm index 8f9becbfd..27e012e13 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings.elm @@ -14,6 +14,7 @@ import Debouncer.Extra as Debouncer exposing (Debouncer) import Form exposing (Form) import Form.Field as Field import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, br, button, div, h2, hr, label, li, p, strong, text, ul) import Html.Attributes exposing (class, classList, disabled, id, name, style) import Html.Events exposing (onClick, onMouseDown) @@ -34,7 +35,6 @@ import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form as Form import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lgx, lx) import Shared.Setters exposing (setSelected) import Shared.Utils exposing (dispatch, listFilterJust) import Uuid exposing (Uuid) @@ -59,16 +59,6 @@ import Wizard.Projects.Detail.Components.Settings.DeleteModal as DeleteModal import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.Settings" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.Components.Settings" - - -- MODEL @@ -196,7 +186,7 @@ handlePutQuestionnaireComplete appState model result = ) Err error -> - ( { model | savingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.putError" appState) error } + ( { model | savingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be saved." appState.locale) error } , Cmd.none ) @@ -224,7 +214,7 @@ handleTemplateTypeHintInputMsg cfg typeHintInputMsg appState model = typeHintInputCfg = { wrapMsg = cfg.wrapMsg << TemplateTypeHintInputMsg , getTypeHints = TemplatesApi.getTemplatesFor cfg.packageId - , getError = lg "apiError.packages.getListError" appState + , getError = gettext "Unable to get Knowledge Models." appState.locale , setReply = formMsg << .id , clearReply = Just <| formMsg "" , filterResults = Nothing @@ -267,7 +257,7 @@ handleProjectTagsSearchComplete appState model result = ) Err error -> - ( { model | projectTagsSuggestions = ApiError.toActionResult appState (lg "apiError.questionnaires.getProjectTagsSuggestionsError" appState) error } + ( { model | projectTagsSuggestions = ApiError.toActionResult appState (gettext "Unable to get project tags." appState.locale) error } , Cmd.none ) @@ -339,7 +329,7 @@ formView appState cfg model = unsupportedError = case cfg.templateState of Just TemplateState.UnsupportedMetamodelVersion -> - Flash.error appState (l_ "unsupportedTemplate" appState) + Flash.error appState (gettext "This document template is no longer supported." appState.locale) _ -> emptyNode @@ -352,7 +342,7 @@ formView appState cfg model = formatInput = case model.templateTypeHintInputModel.selected of Just selectedTemplate -> - FormGroup.formatRadioGroup appState selectedTemplate.formats model.form "formatUuid" (lg "questionnaire.defaultFormat" appState) + FormGroup.formatRadioGroup appState selectedTemplate.formats model.form "formatUuid" (gettext "Default document format" appState.locale) _ -> emptyNode @@ -360,8 +350,8 @@ formView appState cfg model = isTemplateInput = if Feature.projectTemplatesCreate appState then [ hr [] [] - , Html.map FormMsg <| FormGroup.toggle model.form "isTemplate" <| lg "questionnaire.isTemplate" appState - , FormExtra.mdAfter (lg "questionnaire.isTemplate.desc" appState) + , Html.map FormMsg <| FormGroup.toggle model.form "isTemplate" <| gettext "Project Template" appState.locale + , FormExtra.mdAfter (gettext "Project templates can be used by other users so they don't have to start their new projects from scratch." appState.locale) ] else @@ -375,18 +365,18 @@ formView appState cfg model = emptyNode in div [] - ([ h2 [] [ lx_ "settings.title" appState ] + ([ h2 [] [ text (gettext "Settings" appState.locale) ] , FormResult.errorOnlyView appState model.savingQuestionnaire - , Html.map FormMsg <| FormGroup.input appState model.form "name" <| lg "questionnaire.name" appState - , Html.map FormMsg <| FormGroup.input appState model.form "description" <| lg "questionnaire.description" appState + , Html.map FormMsg <| FormGroup.input appState model.form "name" <| gettext "Name" appState.locale + , Html.map FormMsg <| FormGroup.input appState model.form "description" <| gettext "Description" appState.locale , Html.map FormMsg <| projectTagsInput , hr [] [] - , FormGroup.formGroupCustom typeHintInput appState model.form "templateId" <| lg "questionnaire.defaultTemplate" appState + , FormGroup.formGroupCustom typeHintInput appState model.form "templateId" <| gettext "Default document template" appState.locale , Html.map FormMsg <| formatInput ] ++ isTemplateInput ++ [ FormActions.viewActionOnly appState - (ActionButton.ButtonConfig (l_ "form.save" appState) model.savingQuestionnaire (FormMsg Form.Submit) False) + (ActionButton.ButtonConfig (gettext "Save" appState.locale) model.savingQuestionnaire (FormMsg Form.Submit) False) ] ) @@ -400,7 +390,7 @@ projectTagsFormGroup appState model = |> Maybe.unwrap [] Tuple.second in div [ class "form-group form-group-project-tags" ] - [ label [] [ lgx "projectTags" appState ] + [ label [] [ text (gettext "Project Tags" appState.locale) ] , div [] (List.map (projectTagView appState model.form) tags ++ projectTagInput appState model) ] @@ -474,7 +464,7 @@ projectTagInput appState model = , onClick (Form.Append "projectTags") , dataCy "project_settings_add-tag-button" ] - [ lx_ "form.addProjectTag" appState ] + [ text (gettext "Add" appState.locale) ] ] , errorView , typehintsView field.hasFocus @@ -492,7 +482,7 @@ knowledgeModel appState cfg = Tag.viewList cfg.tags in div [] - [ h2 [] [ lx_ "knowledgeModel.title" appState ] + [ h2 [] [ text (gettext "Knowledge Model" appState.locale) ] , linkTo appState (Routes.knowledgeModelsDetail cfg.package.id) [ class "package-link mb-2" ] @@ -502,7 +492,7 @@ knowledgeModel appState cfg = [ linkTo appState (Routes.projectsCreateMigration cfg.questionnaire.uuid) [ class "btn btn-outline-secondary migration-link" ] - [ lx_ "knowledgeModel.createMigration" appState ] + [ text (gettext "Create migration" appState.locale) ] ] ] @@ -510,19 +500,19 @@ knowledgeModel appState cfg = dangerZone : AppState -> ViewConfig -> Html Msg dangerZone appState cfg = div [] - [ h2 [] [ lx_ "dangerZone.title" appState ] + [ h2 [] [ text (gettext "Danger Zone" appState.locale) ] , div [ class "card border-danger" ] [ div [ class "card-body" ] [ p [ class "card-text" ] - [ strong [] [ lx_ "dangerZone.delete.title" appState ] + [ strong [] [ text (gettext "Delete this project" appState.locale) ] , br [] [] - , lx_ "dangerZone.delete.desc" appState + , text (gettext "Deleted projects cannot be recovered." appState.locale) ] , button [ class "btn btn-outline-danger" , onClick (DeleteModalMsg (DeleteModal.open cfg.questionnaire)) ] - [ lx_ "dangerZone.delete.title" appState ] + [ text (gettext "Delete this project" appState.locale) ] ] ] ] diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings/DeleteModal.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings/DeleteModal.elm index f3a3a2515..a5b8457a4 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings/DeleteModal.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/Settings/DeleteModal.elm @@ -1,25 +1,16 @@ module Wizard.Projects.Detail.Components.Settings.DeleteModal exposing (Model, Msg, UpdateConfig, initialModel, open, update, view) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, p, strong, text) import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (l, lg, lh) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Modal as Modal import Wizard.Projects.Common.QuestionnaireDescriptor exposing (QuestionnaireDescriptor) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.Settings.DeleteModal" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Detail.Components.Settings.DeleteModal" - - type alias Model = { questionnaireToBeDeleted : Maybe QuestionnaireDescriptor , deletingQuestionnaire : ActionResult String @@ -93,14 +84,14 @@ handleDeleteQuestionnaireCompleted cfg appState model result = case result of Ok _ -> ( { model - | deletingQuestionnaire = Success <| lg "apiSuccess.questionnaires.delete" appState + | deletingQuestionnaire = Success <| gettext "Questionnaire was successfully deleted." appState.locale , questionnaireToBeDeleted = Nothing } , cfg.deleteCompleteCmd ) Err error -> - ( { model | deletingQuestionnaire = ApiError.toActionResult appState (lg "apiError.questionnaires.deleteError" appState) error } + ( { model | deletingQuestionnaire = ApiError.toActionResult appState (gettext "Questionnaire could not be deleted." appState.locale) error } , Cmd.none ) @@ -118,15 +109,18 @@ view appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text name ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s?" appState.locale) + [ strong [] [ text name ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete Project" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingQuestionnaire - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteQuestionnaire , cancelMsg = Just <| ShowHideDeleteQuestionnaire Nothing , dangerous = True diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Components/ShareModal.elm b/engine-wizard/elm/Wizard/Projects/Detail/Components/ShareModal.elm index a8876089f..905539ee2 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Components/ShareModal.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Components/ShareModal.elm @@ -12,6 +12,7 @@ module Wizard.Projects.Detail.Components.ShareModal exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Field as Field +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, hr, input, span, strong, text) import Html.Attributes exposing (class, classList, id, readonly, title, value) import Html.Events exposing (onClick) @@ -29,8 +30,8 @@ import Shared.Data.UserSuggestion exposing (UserSuggestion) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lgh, lgx, lx) import Shared.Utils exposing (getUuid) +import String.Format as String import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.TypeHintInput as TypeHintInput @@ -48,16 +49,6 @@ import Wizard.Routes as Routes import Wizard.Routing as Routing -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Components.ShareModal" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.Components.ShareModal" - - -- MODEL @@ -159,7 +150,7 @@ handleUserTypeHintInputMsg cfg typeHintInputMsg appState model = typeHintInputCfg = { wrapMsg = cfg.wrapMsg << UserTypeHintInputMsg , getTypeHints = UsersApi.getUsersSuggestions - , getError = lg "apiError.users.getListError" appState + , getError = gettext "Unable to get users." appState.locale , setReply = cfg.wrapMsg << AddUser , clearReply = Nothing , filterResults = Just filterResults @@ -239,7 +230,7 @@ handlePutQuestionnaireComplete appState model result = ( { model | visible = False, savingSharing = Unset }, Ports.refresh () ) Err error -> - ( { model | savingSharing = ApiError.toActionResult appState (lg "apiError.questionnaires.putError" appState) error } + ( { model | savingSharing = ApiError.toActionResult appState (gettext "Questionnaire could not be saved." appState.locale) error } , Cmd.none ) @@ -267,11 +258,11 @@ view appState model = ] modalConfig = - { modalTitle = l_ "title" appState + { modalTitle = gettext "Share Project" appState.locale , modalContent = modalContent , visible = model.visible , actionResult = model.savingSharing - , actionName = l_ "action" appState + , actionName = gettext "Save" appState.locale , actionMsg = FormMsg Form.Submit , cancelMsg = Just Close , dangerous = False @@ -287,7 +278,7 @@ usersView appState model = cfg = { viewItem = TypeHintInput.memberSuggestion , wrapMsg = UserTypeHintInputMsg - , nothingSelectedItem = span [ class "text-muted" ] [ text <| l_ "addUsers" appState ] + , nothingSelectedItem = span [ class "text-muted" ] [ text <| gettext "Add users" appState.locale ] , clearEnabled = False } @@ -337,7 +328,7 @@ userView appState users form i = , a [ class "text-danger" , onClick (Form.RemoveItem "permissions" i) - , title (l_ "remove" appState) + , title (gettext "Remove" appState.locale) ] [ faSet "_global.remove" appState ] ] @@ -355,7 +346,7 @@ formView appState questionnaireUuid form = let visibilitySelect = if (Form.getFieldAsString "sharingPermission" form).value == Just "edit" then - strong [] [ lgx "questionnairePermission.edit" appState ] + strong [] [ text (gettext "edit" appState.locale) ] else FormExtra.inlineSelect (QuestionnairePermission.formOptions appState) form "visibilityPermission" @@ -368,10 +359,13 @@ formView appState questionnaireUuid form = [ class "form-group form-group-toggle-extra" , classList [ ( "visible", visibilityEnabled ) ] ] - (lgh "questionnaire.visibilityPermission" [ visibilitySelect ] appState) + (String.formatHtml + (gettext "Other logged-in users can %s the project." appState.locale) + [ visibilitySelect ] + ) visibilityEnabledInput = - FormGroup.toggle form "visibilityEnabled" (lg "questionnaire.visibility" appState) + FormGroup.toggle form "visibilityEnabled" (gettext "Visible by all other logged-in users" appState.locale) in [ Html.map FormMsg visibilityEnabledInput , Html.map FormMsg visibilityPermissionInput @@ -396,7 +390,7 @@ formView appState questionnaireUuid form = ] [ div [ class "d-flex" ] [ input [ readonly True, class "form-control", id "public-link", value publicLink ] [] - , button [ class "btn btn-link", onClick (CopyPublicLink publicLink) ] [ lx_ "copyLink" appState ] + , button [ class "btn btn-link", onClick (CopyPublicLink publicLink) ] [ text (gettext "Copy link" appState.locale) ] ] ] @@ -408,10 +402,13 @@ formView appState questionnaireUuid form = [ class "form-group form-group-toggle-extra" , classList [ ( "visible", sharingEnabled ) ] ] - (lgh "questionnaire.sharingPermission" [ sharingSelect ] appState) + (String.formatHtml + (gettext "Anyone with the link can %s the project." appState.locale) + [ sharingSelect ] + ) sharingEnabledInput = - FormGroup.toggle form "sharingEnabled" (lg "questionnaire.sharing" appState) + FormGroup.toggle form "sharingEnabled" (gettext "Public link" appState.locale) in [ Html.map FormMsg sharingEnabledInput , Html.map FormMsg sharingPermissionInput diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Documents/Update.elm b/engine-wizard/elm/Wizard/Projects/Detail/Documents/Update.elm index 43f9aa2a8..daa4fd68d 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Documents/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Documents/Update.elm @@ -4,13 +4,13 @@ module Wizard.Projects.Detail.Documents.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Documents as DocumentsApi import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.Document exposing (Document) import Shared.Data.Submission exposing (Submission) import Shared.Data.SubmissionService exposing (SubmissionService) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Uuid exposing (Uuid) import Wizard.Common.Api exposing (applyResult, getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -104,7 +104,7 @@ handleDeleteDocumentCompleted wrapMsg appState questionnaireUuid model result = Listing.update (listingUpdateConfig wrapMsg appState questionnaireUuid) appState ListingMsgs.Reload model.documents in ( { model - | deletingDocument = Success <| lg "apiSuccess.documents.delete" appState + | deletingDocument = Success <| gettext "Document was successfully deleted." appState.locale , documents = documents , documentToBeDeleted = Nothing } @@ -112,7 +112,7 @@ handleDeleteDocumentCompleted wrapMsg appState questionnaireUuid model result = ) Err error -> - ( { model | deletingDocument = ApiError.toActionResult appState (lg "apiError.documents.deleteError" appState) error } + ( { model | deletingDocument = ApiError.toActionResult appState (gettext "Document could not be deleted." appState.locale) error } , getResultCmd result ) @@ -167,7 +167,7 @@ handleGetSubmissionServicesCompleted appState model result = in applyResult appState { setResult = setResult - , defaultError = lg "apiError.documents.getSubmissionServicesError" appState + , defaultError = gettext "Unable to get submission services for the document." appState.locale , model = model , result = result } @@ -204,7 +204,7 @@ handleSubmitDocumentCompleted appState model result = in applyResult appState { setResult = \value record -> updateSubmissions { record | submittingDocument = value } - , defaultError = lg "apiError.submissions.postError" appState + , defaultError = gettext "Unable to submit the document." appState.locale , model = model , result = result } @@ -217,7 +217,7 @@ handleSubmitDocumentCompleted appState model result = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Uuid -> Listing.UpdateConfig Document listingUpdateConfig wrapMsg appState questionnaireUuid = { getRequest = QuestionnairesApi.getDocuments questionnaireUuid - , getError = lg "apiError.documents.getListError" appState + , getError = gettext "Unable to get documents." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.ProjectsRoute << DetailRoute questionnaireUuid << PlanDetailRoute.Documents } diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Documents/View.elm b/engine-wizard/elm/Wizard/Projects/Detail/Documents/View.elm index 159ddad18..fc8920168 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Documents/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Documents/View.elm @@ -1,6 +1,7 @@ module Wizard.Projects.Detail.Documents.View exposing (ViewConfig, view) import ActionResult +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, h5, input, label, p, span, strong, table, tbody, td, text, tr) import Html.Attributes exposing (checked, class, classList, disabled, for, href, id, target, type_) import Html.Events exposing (onCheck, onClick) @@ -16,9 +17,9 @@ import Shared.Data.Submission as Submission exposing (Submission) import Shared.Data.Submission.SubmissionState as SubmissionState import Shared.Data.User as User import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (l, lf, lg, lgx, lh, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (listInsertIf) +import String.Format as String import Time.Distance as TimeDistance import Uuid exposing (Uuid) import Wizard.Common.AppState exposing (AppState) @@ -41,26 +42,6 @@ import Wizard.Projects.Routes exposing (Route(..)) import Wizard.Routes as Routes exposing (Route(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Documents.View" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Projects.Detail.Documents.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.Documents.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Projects.Detail.Documents.View" - - type alias ViewConfig msg = { questionnaire : QuestionnaireDetail , questionnaireEditable : Bool @@ -92,7 +73,7 @@ listingConfig cfg appState = else Just <| - [ strong [] [ lx_ "submissions.title" appState ] + [ strong [] [ text (gettext "Submissions" appState.locale) ] , table [ class "table table-sm" ] [ tbody [] (List.map (viewSubmission cfg appState) (List.sortWith Submission.compare document.submissions)) @@ -106,10 +87,10 @@ listingConfig cfg appState = , textTitle = .name , emptyText = if Session.exists appState.session then - l_ "listing.empty" appState + gettext "Click \"New document\" button to add a new document." appState.locale else - l_ "listing.emptyAnonymous" appState + gettext "Log in to add a new document." appState.locale , updated = Just { getTime = .createdAt @@ -119,8 +100,8 @@ listingConfig cfg appState = , iconView = Nothing , searchPlaceholderText = Nothing , sortOptions = - [ ( "name", lg "document.name" appState ) - , ( "createdAt", lg "document.createdAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.ProjectsRoute << DetailRoute cfg.questionnaire.uuid << PlanDetailRoute.Documents @@ -130,7 +111,7 @@ listingConfig cfg appState = linkTo appState (Routes.projectsDetailDocumentsNew cfg.questionnaire.uuid Nothing) [ class "btn btn-primary" ] - [ lx_ "newDocument" appState ] + [ text (gettext "New document" appState.locale) ] else Nothing @@ -145,7 +126,7 @@ listingTitle cfg appState document = ( a [ onClick (cfg.wrapMsg <| DownloadDocument document) ] [ text document.name ] - , tooltipCustom "with-tooltip-right with-tooltip-align-left" (l_ "listing.name.title" appState) + , tooltipCustom "with-tooltip-right with-tooltip-align-left" (gettext "Click to download the document" appState.locale) ) else @@ -204,7 +185,7 @@ listingActions appState cfg document = Listing.dropdownAction { extraClass = Nothing , icon = faSet "documents.download" appState - , label = l_ "action.download" appState + , label = gettext "Download" appState.locale , msg = ListingActionMsg (cfg.wrapMsg <| DownloadDocument document) , dataCy = "download" } @@ -216,7 +197,7 @@ listingActions appState cfg document = Listing.dropdownAction { extraClass = Nothing , icon = faSet "documents.submit" appState - , label = l_ "action.submit" appState + , label = gettext "Submit" appState.locale , msg = ListingActionMsg (cfg.wrapMsg <| ShowHideSubmitDocument <| Just document) , dataCy = "submit" } @@ -227,7 +208,7 @@ listingActions appState cfg document = ( Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.questionnaire" appState - , label = l_ "action.viewQuestionnaire" appState + , label = gettext "View questionnaire" appState.locale , msg = ListingActionMsg (previewQuestionnaireEventMsg questionnaireEventUuid) , dataCy = "view-questionnaire" } @@ -256,7 +237,7 @@ listingActions appState cfg document = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg (cfg.wrapMsg <| ShowHideDeleteDocument <| Just document) , dataCy = "delete" } @@ -277,20 +258,20 @@ stateBadge appState state = QueuedDocumentState -> Badge.info [] [ faSet "_global.spinner" appState - , lx_ "badge.queued" appState + , text (gettext "Queued" appState.locale) ] InProgressDocumentState -> Badge.info [] [ faSet "_global.spinner" appState - , lx_ "badge.inProgress" appState + , text (gettext "In Progress" appState.locale) ] DoneDocumentState -> emptyNode ErrorDocumentState -> - Badge.danger [] [ lx_ "badge.error" appState ] + Badge.danger [] [ text (gettext "Error" appState.locale) ] viewSubmission : ViewConfig msg -> AppState -> Submission -> Html msg @@ -301,14 +282,14 @@ viewSubmission cfg appState submission = SubmissionState.InProgress -> Badge.info [] [ faSet "_global.spinner" appState - , lgx "submissionState.inProgress" appState + , text (gettext "Submitting" appState.locale) ] SubmissionState.Done -> - Badge.success [] [ lgx "submissionState.done" appState ] + Badge.success [] [ text (gettext "Submitted" appState.locale) ] SubmissionState.Error -> - Badge.danger [] [ lgx "submissionState.error" appState ] + Badge.danger [] [ text (gettext "Error" appState.locale) ] readableTime = TimeUtils.toReadableDateTime appState.timeZone submission.updatedAt @@ -320,13 +301,13 @@ viewSubmission cfg appState submission = case ( submission.state, submission.location, submission.returnedData ) of ( SubmissionState.Done, Just location, _ ) -> a [ href location, class "with-icon-after", target "_blank" ] - [ lx_ "submissions.viewLink" appState + [ text (gettext "View submission" appState.locale) , faSet "_global.externalLink" appState ] ( SubmissionState.Error, _, Just _ ) -> a [ onClick (cfg.wrapMsg <| SetSubmissionErrorModal (Just (Submission.getReturnedData submission))) ] - [ lx_ "submissions.errorLink" appState ] + [ text (gettext "View error" appState.locale) ] _ -> emptyNode @@ -358,15 +339,18 @@ deleteModal cfg appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text name ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s?" appState.locale) + [ strong [] [ text name ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete document" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingDocument - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = cfg.wrapMsg <| DeleteDocument , cancelMsg = Just <| cfg.wrapMsg <| ShowHideDeleteDocument Nothing , dangerous = True @@ -390,11 +374,11 @@ submitModal cfg appState model = submitButton = if ActionResult.isSuccess model.submittingDocument then button [ class "btn btn-primary", onClick <| cfg.wrapMsg <| ShowHideSubmitDocument Nothing ] - [ lx_ "submitModal.button.done" appState ] + [ text (gettext "Done" appState.locale) ] else if ActionResult.isSuccess model.submissionServices && Maybe.isJust model.selectedSubmissionServiceId then ActionButton.button appState - { label = l_ "submitModal.button.submit" appState + { label = gettext "Submit" appState.locale , result = model.submittingDocument , msg = cfg.wrapMsg <| SubmitDocument , dangerous = False @@ -402,11 +386,11 @@ submitModal cfg appState model = else button [ class "btn btn-primary", disabled True ] - [ lx_ "submitModal.button.submit" appState ] + [ text (gettext "Submit" appState.locale) ] cancelButton = button [ onClick <| cfg.wrapMsg <| ShowHideSubmitDocument Nothing, class "btn btn-secondary", disabled <| ActionResult.isLoading model.submittingDocument ] - [ lx_ "submitModal.button.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] viewOption submissionService = div [ class "form-check", classList [ ( "form-check-selected", model.selectedSubmissionServiceId == Just submissionService.id ) ] ] @@ -431,7 +415,7 @@ submitModal cfg appState model = (List.map viewOption submissionServices) else - Flash.info appState <| l_ "submitModal.noSubmission" appState + Flash.info appState <| gettext "There are no submission services configured for this type of document." appState.locale submissionBody submissionServices = div [] @@ -447,7 +431,7 @@ submitModal cfg appState model = case submission.location of Just location -> div [ class "mt-2" ] - [ lx_ "submitModal.success.link" appState + [ text (gettext "You can find it here: " appState.locale) , a [ href location, target "_blank" ] [ text location ] ] @@ -457,14 +441,14 @@ submitModal cfg appState model = in div [ class "alert alert-success" ] [ faSet "_global.success" appState - , lx_ "submitModal.success.message" appState + , text (gettext "The document was successfully submitted." appState.locale) , link ] SubmissionState.Error -> div [ class "alert alert-danger" ] [ faSet "_global.error" appState - , lx_ "submitModal.error.message" appState + , text (gettext "The document submission failed." appState.locale) ] _ -> @@ -479,7 +463,7 @@ submitModal cfg appState model = content = [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ text <| lf_ "submitModal.title" [ name ] appState ] + [ h5 [ class "modal-title" ] [ text <| String.format (gettext "Submit %s" appState.locale) [ name ] ] ] , div [ class "modal-body" ] [ body @@ -511,7 +495,7 @@ documentErrorModal cfg appState model = ( False, "" ) modalConfig = - { title = l_ "documentErrorModal.title" appState + { title = gettext "Document error" appState.locale , message = message , visible = visible , actionMsg = cfg.wrapMsg (SetDocumentErrorModal Nothing) @@ -533,7 +517,7 @@ submissionErrorModal cfg appState model = ( False, "" ) modalConfig = - { title = l_ "submissionErrorModal.title" appState + { title = gettext "Submission error" appState.locale , message = message , visible = visible , actionMsg = cfg.wrapMsg (SetSubmissionErrorModal Nothing) diff --git a/engine-wizard/elm/Wizard/Projects/Detail/Update.elm b/engine-wizard/elm/Wizard/Projects/Detail/Update.elm index a47a32477..be3f6f519 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/Update.elm @@ -2,6 +2,7 @@ module Wizard.Projects.Detail.Update exposing (fetchData, isGuarded, onUnload, u import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Maybe.Extra as Maybe import Random exposing (Seed) import Shared.Api.QuestionnaireImporters as QuestionnaireImportersApi @@ -17,7 +18,6 @@ import Shared.Data.WebSockets.ClientQuestionnaireAction as ClientQuestionnaireAc import Shared.Data.WebSockets.ServerQuestionnaireAction as ServerQuestionnaireAction import Shared.Data.WebSockets.WebSocketServerAction as WebSocketServerAction import Shared.Error.ApiError as ApiError exposing (ApiError(..)) -import Shared.Locale exposing (l, lg) import Shared.Utils exposing (dispatch, getUuid) import Shared.WebSocket as WebSocket import Triple @@ -44,11 +44,6 @@ import Wizard.Routes as Routes exposing (Route(..)) import Wizard.Routing as Routing exposing (cmdNavigate) -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.Update" - - fetchData : AppState -> Uuid -> Model -> Cmd Msg fetchData appState uuid model = if ActionResult.unwrap False (.uuid >> (==) uuid) model.questionnaireModel then @@ -111,7 +106,7 @@ isGuarded appState nextRoute model = Nothing else - Just (l_ "unloadMessage" appState) + Just (gettext "Some changes are still saving." appState.locale) onUnload : Routes.Route -> Model -> Cmd Msg @@ -190,7 +185,7 @@ update wrapMsg msg appState model = |> WebSocket.send model.websocket setUnloadMessageCmd = - Ports.setUnloadMessage (l_ "unloadMessage" appState) + Ports.setUnloadMessage (gettext "Some changes are still saving." appState.locale) in ( applyActionSeed, updatedModel, Cmd.batch [ wsCmd, setUnloadMessageCmd ] ) @@ -485,7 +480,7 @@ update wrapMsg msg appState model = _ -> withSeed <| - ( { model | questionnaireModel = ApiError.toActionResult appState (lg "apiError.questionnaires.getError" appState) error } + ( { model | questionnaireModel = ApiError.toActionResult appState (gettext "Unable to get the project." appState.locale) error } , Cmd.none ) @@ -654,7 +649,7 @@ update wrapMsg msg appState model = ( appState.seed, model, Ports.refresh () ) Err error -> - ( appState.seed, { model | addingToMyProjects = ApiError.toActionResult appState (lg "apiError.questionnaires.putError" appState) error }, Cmd.none ) + ( appState.seed, { model | addingToMyProjects = ApiError.toActionResult appState (gettext "Questionnaire could not be saved." appState.locale) error }, Cmd.none ) handleWebsocketMsg : WebSocket.RawMsg -> AppState -> Model -> ( Seed, Model, Cmd Wizard.Msgs.Msg ) diff --git a/engine-wizard/elm/Wizard/Projects/Detail/View.elm b/engine-wizard/elm/Wizard/Projects/Detail/View.elm index 801058298..ae354c206 100644 --- a/engine-wizard/elm/Wizard/Projects/Detail/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Detail/View.elm @@ -1,6 +1,7 @@ module Wizard.Projects.Detail.View exposing (view) import ActionResult +import Gettext exposing (gettext) import Html exposing (Html, button, div, p, text) import Html.Attributes exposing (class) import Html.Events exposing (onClick) @@ -10,7 +11,6 @@ import Shared.Data.KnowledgeModel as KnowledgeModel import Shared.Data.PaginationQueryString as PaginationQueryString import Shared.Data.QuestionnaireDetail as QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Html exposing (emptyNode, fa) -import Shared.Locale exposing (l, lgx, lx) import Shared.Undraw as Undraw import Wizard.Common.AppState as AppState exposing (AppState) import Wizard.Common.Components.ActionResultView as ActionResultView @@ -39,16 +39,6 @@ import Wizard.Projects.Routes as PlansRoutes import Wizard.Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Detail.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Detail.View" - - view : ProjectDetailRoute -> AppState -> Model -> Html Msg view route appState model = if model.error then @@ -69,10 +59,10 @@ viewOffline : AppState -> Html Msg viewOffline appState = Page.illustratedMessageHtml { image = Undraw.warning - , heading = l_ "offline.heading" appState + , heading = gettext "Disconnected" appState.locale , content = - [ p [] [ lx_ "offline.text" appState ] - , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ lx_ "offline.refresh" appState ] ] + [ p [] [ text (gettext "You have been disconnected, try to refresh the page." appState.locale) ] + , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ text (gettext "Refresh" appState.locale) ] ] ] , cy = "offline" } @@ -82,10 +72,10 @@ viewError : AppState -> Html Msg viewError appState = Page.illustratedMessageHtml { image = Undraw.warning - , heading = l_ "error.heading" appState + , heading = gettext "Oops!" appState.locale , content = - [ p [] [ lx_ "error.text" appState ] - , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ lx_ "error.refresh" appState ] ] + [ p [] [ text (gettext "Something went wrong, try to refresh the page." appState.locale) ] + , p [] [ button [ onClick Refresh, class "btn btn-lg btn-primary" ] [ text (gettext "Refresh" appState.locale) ] ] ] , cy = "error" } @@ -154,7 +144,7 @@ viewProjectNavigationTitleRow appState model questionnaire = templateBadge : AppState -> QuestionnaireDetail -> Html msg templateBadge appState questionnaire = if questionnaire.isTemplate then - Badge.info [] [ lgx "questionnaire.templateBadge" appState ] + Badge.info [] [ text (gettext "Template" appState.locale) ] else emptyNode @@ -174,7 +164,7 @@ viewProjectNavigationActions appState model questionnaire = , ActionButton.buttonCustom appState { content = [ fa "fas fa-plus" - , lx_ "actions.add" appState + , text (gettext "Add to my projects" appState.locale) ] , result = model.addingToMyProjects , msg = AddToMyProjects @@ -190,7 +180,7 @@ viewProjectNavigationActions appState model questionnaire = , dataCy "project_detail_share-button" ] [ fa "fas fa-user-friends" - , lx_ "actions.share" appState + , text (gettext "Share" appState.locale) ] ] @@ -224,7 +214,7 @@ viewProjectNavigationNav appState route model qm = questionnaireLink = { route = projectRoute ProjectDetailRoute.Questionnaire - , label = l_ "nav.questionnaire" appState + , label = gettext "Questionnaire" appState.locale , icon = fa "fa far fa-list-alt" , isActive = route == ProjectDetailRoute.Questionnaire , isVisible = True @@ -233,7 +223,7 @@ viewProjectNavigationNav appState route model qm = metricsLink = { route = projectRoute ProjectDetailRoute.Metrics - , label = l_ "nav.metrics" appState + , label = gettext "Metrics" appState.locale , icon = fa "fa far fa-chart-bar" , isActive = route == ProjectDetailRoute.Metrics , isVisible = Features.projectMetrics appState questionnaire @@ -242,7 +232,7 @@ viewProjectNavigationNav appState route model qm = previewLink = { route = projectRoute ProjectDetailRoute.Preview - , label = l_ "nav.preview" appState + , label = gettext "Preview" appState.locale , icon = fa "fa far fa-eye" , isActive = route == ProjectDetailRoute.Preview , isVisible = Features.projectPreview appState questionnaire @@ -251,7 +241,7 @@ viewProjectNavigationNav appState route model qm = documentsLink = { route = projectRoute (ProjectDetailRoute.Documents PaginationQueryString.empty) - , label = l_ "nav.documents" appState + , label = gettext "Documents" appState.locale , icon = fa "fa far fa-copy" , isActive = isDocumentRoute , isVisible = Features.projectDocumentsView appState questionnaire @@ -260,7 +250,7 @@ viewProjectNavigationNav appState route model qm = settingsLink = { route = projectRoute ProjectDetailRoute.Settings - , label = l_ "nav.settings" appState + , label = gettext "Settings" appState.locale , icon = fa "fa fas fa-cogs" , isActive = route == ProjectDetailRoute.Settings , isVisible = Features.projectSettings appState questionnaire @@ -292,7 +282,7 @@ viewProjectContent appState route model qm = Session.exists appState.session forbiddenPage = - Page.error appState (l_ "forbidden" appState) + Page.error appState (gettext "You are not allowed to view this page." appState.locale) in case route of ProjectDetailRoute.Questionnaire -> diff --git a/engine-wizard/elm/Wizard/Projects/Import/Update.elm b/engine-wizard/elm/Wizard/Projects/Import/Update.elm index 1ff943bf2..d2cf55e62 100644 --- a/engine-wizard/elm/Wizard/Projects/Import/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Import/Update.elm @@ -1,11 +1,11 @@ module Wizard.Projects.Import.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Random exposing (Seed) import Shared.Api.QuestionnaireImporters as QuestionnaireImportersApi import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Error.ApiError as ApiError -import Shared.Locale exposing (lg) import Shared.Setters exposing (setQuestionnaire, setQuestionnaireImporter) import Uuid exposing (Uuid) import Wizard.Common.Api exposing (applyResult, getResultCmd) @@ -38,7 +38,7 @@ update wrapMsg msg appState model = withSeed <| applyResult appState { setResult = setQuestionnaire - , defaultError = lg "apiError.questionnaires.getError" appState + , defaultError = gettext "Unable to get the project." appState.locale , model = model , result = result } @@ -53,7 +53,7 @@ update wrapMsg msg appState model = Err error -> withSeed <| - ( setQuestionnaireImporter (ApiError.toActionResult appState (lg "apiError.questionnaireImporters.getError" appState) error) model + ( setQuestionnaireImporter (ApiError.toActionResult appState (gettext "Unable to get importer." appState.locale) error) model , getResultCmd result ) @@ -93,6 +93,6 @@ update wrapMsg msg appState model = Err error -> withSeed - ( { model | importing = ApiError.toActionResult appState (lg "apiError.questionnaires.putContentError" appState) error } + ( { model | importing = ApiError.toActionResult appState (gettext "Questionnaire changes could not be saved." appState.locale) error } , Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Projects/Import/View.elm b/engine-wizard/elm/Wizard/Projects/Import/View.elm index ccd2504c4..f0f8223af 100644 --- a/engine-wizard/elm/Wizard/Projects/Import/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Import/View.elm @@ -1,12 +1,14 @@ module Wizard.Projects.Import.View exposing (view) import ActionResult +import Gettext exposing (gettext) import Html exposing (Html, div, form, hr, li, p, strong, text, ul) import Html.Attributes exposing (class) import Html.Events exposing (onSubmit) import Shared.Data.QuestionnaireDetail exposing (QuestionnaireDetail) import Shared.Data.QuestionnaireImporter exposing (QuestionnaireImporter) import Shared.Html exposing (emptyNode) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire.Importer exposing (ImporterResult) import Wizard.Common.Html.Attribute exposing (detailClass) @@ -38,10 +40,10 @@ viewContent appState model ( questionnaire, _ ) = viewImportResult appState model result Nothing -> - Flash.info appState "Follow the instructions in the importer window." + Flash.info appState (gettext "Follow the instructions in the importer window." appState.locale) in div [ detailClass "" ] - [ Page.header "Import answers" [] + [ Page.header (gettext "Import answers" appState.locale) [] , div [ class "" ] [ strong [] [ text questionnaire.name ] , p [] [ text (Maybe.withDefault "" questionnaire.description) ] @@ -56,11 +58,13 @@ viewImportResult appState model result = let importMessage = li [] - [ strong [] - [ text (String.fromInt (List.length result.questionnaireEvents)) + (String.formatHtml + (gettext "%s questionnaire changes will be imported." appState.locale) + [ strong [] + [ text (String.fromInt (List.length result.questionnaireEvents)) + ] ] - , text " questionnaire changes will be imported." - ] + ) errorMessages = if List.isEmpty result.errors then @@ -72,12 +76,14 @@ viewImportResult appState model result = li [ class "text-danger" ] [ text errorText ] in li [ class "text-danger" ] - [ strong [] - [ text (String.fromInt (List.length result.errors)) + (String.formatHtml + (gettext "%s errors encountered:" appState.locale) + [ strong [] + [ text (String.fromInt (List.length result.errors)) + ] ] - , text " errors encountered:" - , ul [] (List.map viewError result.errors) - ] + ++ [ ul [] (List.map viewError result.errors) ] + ) messages = ul [] [ importMessage, errorMessages ] @@ -85,10 +91,10 @@ viewImportResult appState model result = form [ onSubmit PutImportData ] [ FormResult.errorOnlyView appState model.importing , div [] - [ strong [] [ text "Import status" ] + [ strong [] [ text (gettext "Import status" appState.locale) ] , messages ] , FormActions.viewSubmit appState (Routes.projectsDetailQuestionnaire model.uuid) - (ActionButton.SubmitConfig "Import" model.importing) + (ActionButton.SubmitConfig (gettext "Import" appState.locale) model.importing) ] diff --git a/engine-wizard/elm/Wizard/Projects/Index/Update.elm b/engine-wizard/elm/Wizard/Projects/Index/Update.elm index ce6766fa5..a9de026a0 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/Update.elm @@ -6,6 +6,7 @@ module Wizard.Projects.Index.Update exposing import ActionResult exposing (ActionResult(..)) import Debouncer.Extra as Debouncer import Dict +import Gettext exposing (gettext) import Maybe.Extra as Maybe import Shared.Api.Packages as PackagesApi import Shared.Api.Questionnaires as QuestionnairesApi @@ -14,7 +15,6 @@ import Shared.Data.PaginationQueryFilters as PaginationQueryFilters import Shared.Data.PaginationQueryString as PaginationQueryString import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (dispatch, stringToBool) import Uuid exposing (Uuid) import Wizard.Common.Api exposing (applyResult, getResultCmd) @@ -158,14 +158,14 @@ update wrapMsg msg appState model = else model in - ( { model_ | projectTagsFilterTags = ApiError.toActionResult appState (lg "apiError.questionnaires.getProjectTagsSuggestionsError" appState) err } + ( { model_ | projectTagsFilterTags = ApiError.toActionResult appState (gettext "Unable to get project tags." appState.locale) err } , getResultCmd result ) UsersFilterGetValuesComplete result -> applyResult appState { setResult = \r m -> { m | userFilterSelectedUsers = r } - , defaultError = lg "apiError.users.getListError" appState + , defaultError = gettext "Unable to get users." appState.locale , model = model , result = result } @@ -195,7 +195,7 @@ update wrapMsg msg appState model = UsersFilterSearchComplete result -> applyResult appState { setResult = \r m -> { m | userFilterUsers = r } - , defaultError = lg "apiError.users.getListError" appState + , defaultError = gettext "Unable to get users." appState.locale , model = model , result = result } @@ -203,7 +203,7 @@ update wrapMsg msg appState model = PackagesFilterGetValuesComplete result -> applyResult appState { setResult = \r m -> { m | packagesFilterSelectedPackages = r } - , defaultError = lg "apiError.packages.getListError" appState + , defaultError = gettext "Unable to get Knowledge Models." appState.locale , model = model , result = result } @@ -233,7 +233,7 @@ update wrapMsg msg appState model = PackagesFilterSearchComplete result -> applyResult appState { setResult = \r m -> { m | packagesFilterPackages = r } - , defaultError = lg "apiError.packages.getListError" appState + , defaultError = gettext "Unable to get Knowledge Models." appState.locale , model = model , result = result } @@ -271,14 +271,14 @@ handleDeleteMigrationCompleted wrapMsg appState model result = Listing.update (listingUpdateConfig wrapMsg appState model) appState ListingMsgs.Reload model.questionnaires in ( { model - | deletingMigration = Success <| lg "apiSuccess.questionnaires.migration.delete" appState + | deletingMigration = Success <| gettext "Questionnaire migration was successfully canceled." appState.locale , questionnaires = questionnaires } , cmd ) Err error -> - ( { model | deletingMigration = ApiError.toActionResult appState (lg "apiError.questionnaires.migrations.deleteError" appState) error } + ( { model | deletingMigration = ApiError.toActionResult appState (gettext "Questionnaire migration could not be deleted." appState.locale) error } , getResultCmd result ) @@ -333,7 +333,7 @@ listingUpdateConfig wrapMsg appState model = , packageIds = packageIds , packageIdsOp = packageIdsOp } - , getError = lg "apiError.questionnaires.getListError" appState + , getError = gettext "Unable to get projects." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.projectsIndexWithFilters model.questionnaires.filters } diff --git a/engine-wizard/elm/Wizard/Projects/Index/View.elm b/engine-wizard/elm/Wizard/Projects/Index/View.elm index 682748e0a..5c5a9419b 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/View.elm @@ -2,6 +2,7 @@ module Wizard.Projects.Index.View exposing (view) import ActionResult import Bootstrap.Dropdown as Dropdown +import Gettext exposing (gettext) import Html exposing (Html, a, code, div, img, input, span, text) import Html.Attributes exposing (class, classList, href, placeholder, src, style, title, type_, value) import Html.Events exposing (onInput) @@ -18,7 +19,6 @@ import Shared.Data.Questionnaire exposing (Questionnaire) import Shared.Data.Questionnaire.QuestionnaireState exposing (QuestionnaireState(..)) import Shared.Data.User as User import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lgx, lx) import Shared.Utils exposing (listFilterJust, listInsertIf) import Uuid import Version @@ -45,16 +45,6 @@ import Wizard.Routes as Routes import Wizard.Routing as Routing -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Index.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -70,7 +60,7 @@ view appState model = content _ = div [ listClass "Questionnaires__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Projects" appState.locale) [] , FormResult.successOnlyView appState model.deleteModalModel.deletingQuestionnaire , FormResult.view appState model.deletingMigration , Listing.view appState (listingConfig appState model) model.questionnaires @@ -86,7 +76,7 @@ createButton appState = linkTo appState (Routes.projectsCreate appState) [ class "btn btn-primary", dataCy "projects_create-button" ] - [ lx_ "header.create" appState ] + [ text (gettext "Create" appState.locale) ] listingConfig : AppState -> Model -> ViewConfig Questionnaire Msg @@ -94,10 +84,10 @@ listingConfig appState model = let templateFilter = Listing.SimpleFilter indexRouteIsTemplateFilterId - { name = l_ "filter.template.name" appState + { name = gettext "Project Template" appState.locale , options = - [ ( "true", l_ "filter.template.templatesOnly" appState ) - , ( "false", l_ "filter.template.projectsOnly" appState ) + [ ( "true", gettext "Templates only" appState.locale ) + , ( "false", gettext "Projects only" appState.locale ) ] } @@ -126,7 +116,7 @@ listingConfig appState model = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Create\" button to add a new project." appState.locale , updated = Just { getTime = .updatedAt @@ -134,11 +124,11 @@ listingConfig appState model = } , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search projects..." appState.locale) , sortOptions = - [ ( "name", lg "questionnaire.name" appState ) - , ( "createdAt", lg "questionnaire.createdAt" appState ) - , ( "updatedAt", lg "questionnaire.updatedAt" appState ) + [ ( "name", gettext "Name" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) + , ( "updatedAt", gettext "Updated" appState.locale ) ] , filters = listingFilters , toRoute = Routes.projectsIndexWithFilters @@ -203,7 +193,7 @@ listingProjectTagsFilter appState model = [ input [ type_ "text" , class "form-control" - , placeholder (l_ "filter.projectTags.searchPlaceholder" appState) + , placeholder (gettext "Search project tags..." appState.locale) , alwaysStopPropagationOn "click" (D.succeed (ProjectTagsFilterInput model.projectTagsFilterSearchValue)) , onInput ProjectTagsFilterInput , value model.projectTagsFilterSearchValue @@ -219,14 +209,14 @@ listingProjectTagsFilter appState model = , dataCy "filter_projectTags_operator_OR" , alwaysStopPropagationOn "click" (D.succeed NoOp) ] - [ lgx "listingOp.or" appState ] + [ text (gettext "OR" appState.locale) ] , a [ href (linkWithOp FilterOperator.AND) , classList [ ( "active", filterOperator == FilterOperator.AND ) ] , dataCy "filter_projectTags_operator_AND" , alwaysStopPropagationOn "click" (D.succeed NoOp) ] - [ lgx "listingOp.and" appState ] + [ text (gettext "AND" appState.locale) ] ] , Dropdown.divider ] @@ -245,7 +235,7 @@ listingProjectTagsFilter appState model = else if not (String.isEmpty model.projectTagsFilterSearchValue) then [ Dropdown.customItem <| div [ class "dropdown-item-empty" ] - [ lx_ "filter.projectTags.empty" appState ] + [ text (gettext "No project tags found" appState.locale) ] ] else @@ -257,7 +247,7 @@ listingProjectTagsFilter appState model = selectedTag Nothing -> - l_ "filter.projectTags.title" appState + gettext "Project Tags" appState.locale in Listing.CustomFilter indexRouteProjectTagsFilterId { label = [ span [ class "filter-text-label" ] [ text label ], badge ] @@ -322,7 +312,7 @@ listingKMsFilter appState model = [ input [ type_ "text" , class "form-control" - , placeholder (l_ "filter.packages.searchPlaceholder" appState) + , placeholder (gettext "Search knowledge models..." appState.locale) , alwaysStopPropagationOn "click" (D.succeed (PackagesFilterInput model.packagesFilterSearchValue)) , onInput PackagesFilterInput , value model.packagesFilterSearchValue @@ -346,7 +336,7 @@ listingKMsFilter appState model = else if not (String.isEmpty model.packagesFilterSearchValue) then [ Dropdown.customItem <| div [ class "dropdown-item-empty" ] - [ lx_ "filter.packages.empty" appState ] + [ text (gettext "No knowledge models found" appState.locale) ] ] else @@ -358,7 +348,7 @@ listingKMsFilter appState model = selectedPackage.name Nothing -> - l_ "filter.packages.title" appState + gettext "Knowledge Models" appState.locale in Listing.CustomFilter indexRoutePackagesFilterId { label = [ span [ class "filter-text-label" ] [ text label ], badge ] @@ -433,7 +423,7 @@ listingUsersFilter appState model = [ input [ type_ "text" , class "form-control" - , placeholder (l_ "filter.users.searchPlaceholder" appState) + , placeholder (gettext "Search users..." appState.locale) , alwaysStopPropagationOn "click" (D.succeed (UsersFilterInput model.userFilterSearchValue)) , onInput UsersFilterInput , value model.userFilterSearchValue @@ -449,14 +439,14 @@ listingUsersFilter appState model = , dataCy "filter_users_operator_OR" , alwaysStopPropagationOn "click" (D.succeed NoOp) ] - [ lgx "listingOp.or" appState ] + [ text (gettext "OR" appState.locale) ] , a [ href (linkWithOp FilterOperator.AND) , classList [ ( "active", filterOperator == FilterOperator.AND ) ] , dataCy "filter_users_operator_AND" , alwaysStopPropagationOn "click" (D.succeed NoOp) ] - [ lgx "listingOp.and" appState ] + [ text (gettext "AND" appState.locale) ] ] , Dropdown.divider ] @@ -475,7 +465,7 @@ listingUsersFilter appState model = else if not (String.isEmpty model.userFilterSearchValue) then [ Dropdown.customItem <| div [ class "dropdown-item-empty" ] - [ lx_ "filter.users.empty" appState ] + [ text (gettext "No users found" appState.locale) ] ] else @@ -487,7 +477,7 @@ listingUsersFilter appState model = User.fullName selectedUser Nothing -> - l_ "filter.users.title" appState + gettext "Users" appState.locale in Listing.CustomFilter indexRouteUsersFilterId { label = [ span [ class "filter-text-label" ] [ text label ], badge ] @@ -573,7 +563,7 @@ listingDescription appState questionnaire = kmLink = linkTo appState kmRoute - [ title <| lg "knowledgeModel" appState, class "fragment" ] + [ title <| gettext "Knowledge Model" appState.locale, class "fragment" ] [ text questionnaire.package.name , text ", " , text <| Version.toString questionnaire.package.version @@ -607,7 +597,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Nothing , icon = faSet "project.open" appState - , label = l_ "action.open" appState + , label = gettext "Open project" appState.locale , msg = ListingActionLink (Routes.projectsDetailQuestionnaire questionnaire.uuid) , dataCy = "open" } @@ -619,7 +609,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Nothing , icon = faSet "questionnaireList.clone" appState - , label = l_ "action.clone" appState + , label = gettext "Clone" appState.locale , msg = QuestionnaireDescriptor.fromQuestionnaire questionnaire |> Just @@ -636,7 +626,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Nothing , icon = faSet "questionnaireList.createMigration" appState - , label = l_ "action.createMigration" appState + , label = gettext "Create migration" appState.locale , msg = ListingActionLink (Routes.ProjectsRoute <| CreateMigrationRoute questionnaire.uuid) , dataCy = "create-migration" } @@ -648,7 +638,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Nothing , icon = faSet "questionnaireList.createMigration" appState - , label = l_ "action.continueMigration" appState + , label = gettext "Continue migration" appState.locale , msg = ListingActionLink (Routes.ProjectsRoute <| MigrationRoute questionnaire.uuid) , dataCy = "continue-migration" } @@ -660,7 +650,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.cancel" appState - , label = l_ "action.cancelMigration" appState + , label = gettext "Cancel migration" appState.locale , msg = ListingActionMsg (DeleteQuestionnaireMigration questionnaire.uuid) , dataCy = "cancel-migration" } @@ -672,7 +662,7 @@ listingActions appState questionnaire = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = QuestionnaireDescriptor.fromQuestionnaire questionnaire |> Just @@ -700,13 +690,13 @@ stateBadge : AppState -> Questionnaire -> Html msg stateBadge appState questionnaire = case questionnaire.state of Migrating -> - Badge.info [] [ lx_ "badge.migrating" appState ] + Badge.info [] [ text (gettext "migrating" appState.locale) ] Outdated -> linkTo appState (Routes.projectsCreateMigration questionnaire.uuid) [ class Badge.warningClass ] - [ lx_ "badge.outdated" appState ] + [ text (gettext "update available" appState.locale) ] Default -> emptyNode @@ -715,7 +705,7 @@ stateBadge appState questionnaire = templateBadge : AppState -> Questionnaire -> Html msg templateBadge appState questionnaire = if questionnaire.isTemplate then - Badge.info [] [ lgx "questionnaire.templateBadge" appState ] + Badge.info [] [ text (gettext "Template" appState.locale) ] else emptyNode diff --git a/engine-wizard/elm/Wizard/Projects/Migration/Update.elm b/engine-wizard/elm/Wizard/Projects/Migration/Update.elm index 3c6ea7edc..589528476 100644 --- a/engine-wizard/elm/Wizard/Projects/Migration/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Migration/Update.elm @@ -4,6 +4,7 @@ module Wizard.Projects.Migration.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import List.Extra as List import Maybe.Extra as Maybe import Random exposing (Seed) @@ -11,7 +12,6 @@ import Shared.Api.Questionnaires as QuestionnairesApi import Shared.Data.QuestionnaireDetail.QuestionnaireEvent as QuestionnaireEvent import Shared.Data.QuestionnaireMigration as QuestionnaireMigration exposing (QuestionnaireMigration) import Shared.Error.ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (getUuid) import Time import Uuid exposing (Uuid) @@ -80,7 +80,7 @@ handleGetQuestionnaireMigrationCompleted appState model result = ( modelWithMigration, cmd ) = applyResult appState { setResult = setResult appState - , defaultError = lg "apiError.questionnaires.migrations.getError" appState + , defaultError = gettext "Unable to get the Questionnaire migration." appState.locale , result = result , model = model } @@ -95,7 +95,7 @@ handlePutQuestionnaireMigrationCompleted : AppState -> Model -> Result ApiError handlePutQuestionnaireMigrationCompleted appState model result = applyResult appState { setResult = \_ _ -> model - , defaultError = lg "apiError.questionnaires.migrations.putError" appState + , defaultError = gettext "Unable to save migration." appState.locale , result = result , model = model } diff --git a/engine-wizard/elm/Wizard/Projects/Migration/View.elm b/engine-wizard/elm/Wizard/Projects/Migration/View.elm index aca17dc5c..dd1a1c0e2 100644 --- a/engine-wizard/elm/Wizard/Projects/Migration/View.elm +++ b/engine-wizard/elm/Wizard/Projects/Migration/View.elm @@ -1,5 +1,6 @@ module Wizard.Projects.Migration.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, button, code, div, h5, p, small, strong, table, td, text, th, tr) import Html.Attributes exposing (class, classList, style, target) import Html.Events exposing (onClick) @@ -7,9 +8,9 @@ import Shared.Data.KnowledgeModel.Question as Question import Shared.Data.Package exposing (Package) import Shared.Data.QuestionnaireMigration as QuestionnaireMigration exposing (QuestionnaireMigration) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lf, lx) import Shared.Undraw as Undraw import Shared.Utils exposing (boolToInt, flip) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Questionnaire as Questionnaire import Wizard.Common.Components.Questionnaire.DiffQuestionnaireRenderer as DiffQuestionnaireRenderer @@ -21,21 +22,6 @@ import Wizard.Projects.Migration.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Projects.Migration.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Projects.Migration.View" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Projects.Migration.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (contentView appState model) model.questionnaireMigration @@ -47,7 +33,7 @@ contentView appState model migration = finalizeAction = if allResolved model migration then button [ class "btn btn-primary", onClick FinalizeMigration ] - [ lx_ "navbar.finalize" appState ] + [ text (gettext "Finalize migration" appState.locale) ] else emptyNode @@ -57,10 +43,10 @@ contentView appState model migration = div [ class "content" ] [ Page.illustratedMessage { image = Undraw.happyFeeling - , heading = l_ "noChanges.heading" appState + , heading = gettext "No changes to review" appState.locale , lines = - [ l_ "noChanges.line1" appState - , l_ "noChanges.line2" appState + [ gettext "There are no changes affecting your answers." appState.locale + , gettext "You can safely finalize the migration." appState.locale ] , cy = "no-changes" } @@ -97,11 +83,11 @@ migrationInfo appState migration = [ strong [] [ text migration.newQuestionnaire.name ] , table [] [ tr [] - [ th [] [ lx_ "navbar.sourceKM" appState ] + [ th [] [ text (gettext "Source KM" appState.locale) ] , td [] [ packageInfo appState migration.oldQuestionnaire.package ] ] , tr [] - [ th [] [ lx_ "navbar.targetKM" appState ] + [ th [] [ text (gettext "Target KM" appState.locale) ] , td [] [ packageInfo appState migration.newQuestionnaire.package ] ] ] @@ -133,14 +119,14 @@ changeView appState model migration = resolveAction = if isSelectedChangeResolved model then div [] - [ lx_ "changeView.resolved" appState + [ text (gettext "Change already resolved" appState.locale) , button [ class "btn btn-outline-secondary with-icon", onClick UndoResolveCurrentChange ] - [ faSet "questionnaireMigration.undo" appState, lx_ "changeView.undo" appState ] + [ faSet "questionnaireMigration.undo" appState, text (gettext "Undo" appState.locale) ] ] else button [ class "btn btn-outline-primary with-icon", onClick ResolveCurrentChange ] - [ faSet "questionnaireMigration.resolve" appState, lx_ "changeView.resolve" appState ] + [ faSet "questionnaireMigration.resolve" appState, text (gettext "Resolve" appState.locale) ] resolveAllAction = if allResolved model migration then @@ -148,11 +134,11 @@ changeView appState model migration = else button [ class "btn btn-outline-primary with-icon", onClick ResolveAllChanges ] - [ faSet "questionnaireMigration.resolveAll" appState, lx_ "changeView.resolveAll" appState ] + [ faSet "questionnaireMigration.resolveAll" appState, text (gettext "Resolve all" appState.locale) ] in div [ class "change-view" ] [ div [ class "progress-view" ] - [ text <| lf_ "changeView.resolvedChanges" [ String.fromInt resolvedCount, String.fromInt changesCount ] appState + [ text <| String.format (gettext "Resolved changes %s/%s" appState.locale) [ String.fromInt resolvedCount, String.fromInt changesCount ] , div [ class "progress" ] [ div [ class "progress-bar", classList [ ( "bg-success", resolvedCount == changesCount ) ], style "width" (progress ++ "%") ] [] ] ] @@ -198,17 +184,17 @@ viewChange appState model migration change = ( eventLabel, question ) = case change of QuestionAdd data -> - ( l_ "change.questionAdd" appState, data.question ) + ( gettext "New Question" appState.locale, data.question ) QuestionChange data -> - ( l_ "change.questionChange" appState, data.question ) + ( gettext "Question Changed" appState.locale, data.question ) QuestionMove data -> - ( l_ "change.questionMove" appState, data.question ) + ( gettext "Moved Question" appState.locale, data.question ) resolvedLabel = if isQuestionChangeResolved migration change then - small [] [ lx_ "change.resolved" appState ] + small [] [ text (gettext "Resolved" appState.locale) ] else emptyNode diff --git a/engine-wizard/elm/Wizard/Public/Auth/Update.elm b/engine-wizard/elm/Wizard/Public/Auth/Update.elm index 3859d53e0..6861f4fbb 100644 --- a/engine-wizard/elm/Wizard/Public/Auth/Update.elm +++ b/engine-wizard/elm/Wizard/Public/Auth/Update.elm @@ -1,8 +1,8 @@ module Wizard.Public.Auth.Update exposing (fetchData, update) +import Gettext exposing (gettext) import Shared.Api.Auth as AuthApi import Shared.Error.ApiError as ApiError -import Shared.Locale exposing (lg) import Shared.Utils exposing (dispatch) import Wizard.Auth.Msgs import Wizard.Common.AppState exposing (AppState) @@ -25,4 +25,4 @@ update msg appState model = ( model, dispatch (Wizard.Msgs.AuthMsg <| Wizard.Auth.Msgs.GotToken token Nothing) ) Err error -> - ( { model | authenticating = ApiError.toActionResult appState (lg "apiError.tokens.fetchTokenError" appState) error }, Cmd.none ) + ( { model | authenticating = ApiError.toActionResult appState (gettext "Login failed." appState.locale) error }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Public/BookReference/Update.elm b/engine-wizard/elm/Wizard/Public/BookReference/Update.elm index 9f12e9952..07874f84c 100644 --- a/engine-wizard/elm/Wizard/Public/BookReference/Update.elm +++ b/engine-wizard/elm/Wizard/Public/BookReference/Update.elm @@ -3,8 +3,8 @@ module Wizard.Public.BookReference.Update exposing , update ) +import Gettext exposing (gettext) import Shared.Api.BookReferences as BookReferencesApi -import Shared.Locale exposing (lg) import Shared.Setters exposing (setBookReference) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -24,7 +24,7 @@ update msg appState model = GetBookReferenceCompleted result -> applyResult appState { setResult = setBookReference - , defaultError = lg "apiError.bookReferences.getError" appState + , defaultError = gettext "Unable to get a book reference." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Public/BookReference/View.elm b/engine-wizard/elm/Wizard/Public/BookReference/View.elm index 509eb1fd3..f6d223d3d 100644 --- a/engine-wizard/elm/Wizard/Public/BookReference/View.elm +++ b/engine-wizard/elm/Wizard/Public/BookReference/View.elm @@ -1,26 +1,17 @@ module Wizard.Public.BookReference.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, a, div, img, text) import Html.Attributes exposing (alt, class, href, src, target) import Shared.Data.BookReference exposing (BookReference) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.Page as Page import Wizard.Public.BookReference.Models exposing (Model) import Wizard.Public.BookReference.Msgs exposing (Msg) -l_ : String -> AppState -> String -l_ = - l "Wizard.Public.BookReference.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Public.BookReference.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewBookReference appState) model.bookReference @@ -43,12 +34,12 @@ viewBookReference appState bookReference = [ div [ class "book-name" ] [ a [ href bookUrl, target "_blank" ] [ img [ src "/img/book-preview.png", alt "Data Stewardship for Open Science Book Cover" ] [] - , lx_ "bookName" appState + , text (gettext "Data Stewardship for Open Science" appState.locale) ] - , text <| ": " ++ l_ "bookChapter" appState ++ " " ++ bookReference.bookChapter + , text <| ": " ++ String.format (gettext "Chapter %s" appState.locale) [ bookReference.bookChapter ] ] , div [ class "book-crc" ] - [ div [] [ lx_ "permission" appState ] + [ div [] [ text (gettext "With kind permission of" appState.locale) ] , a [ href crcUrl, target "_blank" ] [ img [ src "/img/crc-logo.png", alt "CRC Press" ] [] ] diff --git a/engine-wizard/elm/Wizard/Public/ForgottenPassword/Update.elm b/engine-wizard/elm/Wizard/Public/ForgottenPassword/Update.elm index 5fc87954d..9bc350d34 100644 --- a/engine-wizard/elm/Wizard/Public/ForgottenPassword/Update.elm +++ b/engine-wizard/elm/Wizard/Public/ForgottenPassword/Update.elm @@ -2,10 +2,10 @@ module Wizard.Public.ForgottenPassword.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.ActionKeys as ActionKeysApi import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Public.Common.ForgottenPasswordForm as ForgottenPasswordForm @@ -57,6 +57,6 @@ handlePostPasswordActionKeyCompleted appState result model = setFormErrors appState error model.form errorMessage = - ApiError.toActionResult appState (lg "apiError.actionKey.passwordRecoveryError" appState) error + ApiError.toActionResult appState (gettext "Forgotten password recovery failed." appState.locale) error in ( { model | submitting = errorMessage, form = form }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Public/ForgottenPassword/View.elm b/engine-wizard/elm/Wizard/Public/ForgottenPassword/View.elm index 0b6b50b26..d70054e6d 100644 --- a/engine-wizard/elm/Wizard/Public/ForgottenPassword/View.elm +++ b/engine-wizard/elm/Wizard/Public/ForgottenPassword/View.elm @@ -2,10 +2,10 @@ module Wizard.Public.ForgottenPassword.View exposing (view) import ActionResult exposing (ActionResult(..)) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, div) import Html.Attributes exposing (class) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra import Wizard.Common.View.FormGroup as FormGroup @@ -16,18 +16,13 @@ import Wizard.Public.ForgottenPassword.Models exposing (Model) import Wizard.Public.ForgottenPassword.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Public.ForgottenPassword.View" - - view : AppState -> Model -> Html Msg view appState model = let content = case model.submitting of Success _ -> - Page.success appState <| l_ "recoveryLinkSent" appState + Page.success appState <| gettext "We've sent you a recover link. Follow the instructions in your email." appState.locale _ -> forgottenPasswordForm appState model @@ -40,10 +35,10 @@ forgottenPasswordForm : AppState -> Model -> Html Msg forgottenPasswordForm appState model = let formConfig = - { title = l_ "form.title" appState + { title = gettext "Forgotten Password" appState.locale , submitMsg = FormMsg Form.Submit , actionResult = model.submitting - , submitLabel = l_ "form.submit" appState + , submitLabel = gettext "Recover" appState.locale , formContent = formView appState model.form |> Html.map FormMsg , link = Nothing } @@ -54,6 +49,6 @@ forgottenPasswordForm appState model = formView : AppState -> Form FormError ForgottenPasswordForm -> Html Form.Msg formView appState form = div [] - [ FormGroup.input appState form "email" <| lg "user.email" appState - , FormExtra.textAfter <| l_ "form.email.description" appState + [ FormGroup.input appState form "email" <| gettext "Email" appState.locale + , FormExtra.textAfter <| gettext "Enter the email you use to log in and we will send you a recover link." appState.locale ] diff --git a/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/Update.elm b/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/Update.elm index 72e009e5a..fee4a9357 100644 --- a/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/Update.elm +++ b/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/Update.elm @@ -2,10 +2,10 @@ module Wizard.Public.ForgottenPasswordConfirmation.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.Users as UsersApi import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Public.Common.PasswordForm as PasswordForm @@ -57,6 +57,6 @@ handlePutUserPasswordCompleted appState result model = setFormErrors appState error model.form errorMessage = - ApiError.toActionResult appState (lg "apiError.actionKey.passwordRecoveryError" appState) error + ApiError.toActionResult appState (gettext "Forgotten password recovery failed." appState.locale) error in ( { model | submitting = errorMessage, form = form }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/View.elm b/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/View.elm index 6b2456c48..40219d8eb 100644 --- a/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/View.elm +++ b/engine-wizard/elm/Wizard/Public/ForgottenPasswordConfirmation/View.elm @@ -2,11 +2,12 @@ module Wizard.Public.ForgottenPasswordConfirmation.View exposing (view) import ActionResult exposing (ActionResult(..)) import Form exposing (Form) -import Html exposing (Html, div, h1, p) +import Gettext exposing (gettext) +import Html exposing (Html, div, h1, p, text) import Html.Attributes exposing (class) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -19,21 +20,6 @@ import Wizard.Public.ForgottenPasswordConfirmation.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Public.ForgottenPasswordConfirmation.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Public.ForgottenPasswordConfirmation.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Public.ForgottenPasswordConfirmation.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -53,10 +39,10 @@ signupForm : AppState -> Model -> Html Msg signupForm appState model = let formConfig = - { title = l_ "form.title" appState + { title = gettext "Password Recovery" appState.locale , submitMsg = FormMsg Form.Submit , actionResult = model.submitting - , submitLabel = l_ "form.submit" appState + , submitLabel = gettext "Save" appState.locale , formContent = formView appState model.form |> Html.map FormMsg , link = Nothing } @@ -67,9 +53,9 @@ signupForm appState model = formView : AppState -> Form FormError PasswordForm -> Html Form.Msg formView appState form = div [] - [ FormExtra.text <| l_ "form.text" appState - , FormGroup.passwordWithStrength appState form "password" <| l_ "form.password" appState - , FormGroup.password appState form "passwordConfirmation" <| l_ "form.passwordConfirmation" appState + [ FormExtra.text <| gettext "Enter a new password you want to use to log in." appState.locale + , FormGroup.passwordWithStrength appState form "password" <| gettext "New password" appState.locale + , FormGroup.password appState form "passwordConfirmation" <| gettext "New password again" appState.locale ] @@ -78,9 +64,12 @@ successView appState = div [ class "px-4 py-5 bg-light rounded-3", dataCy "message_success" ] [ h1 [ class "display-3" ] [ faSet "_global.success" appState ] , p [ class "lead" ] - (lh_ "success.message" - [ linkTo appState (Routes.publicLogin Nothing) [ dataCy "login-link", class "btn btn-primary ms-1" ] [ lx_ "success.logIn" appState ] + (String.formatHtml + (gettext "Your password has been changed. You can now %s." appState.locale) + [ linkTo appState + (Routes.publicLogin Nothing) + [ dataCy "login-link", class "btn btn-primary ms-1" ] + [ text (gettext "log in" appState.locale) ] ] - appState ) ] diff --git a/engine-wizard/elm/Wizard/Public/Login/Update.elm b/engine-wizard/elm/Wizard/Public/Login/Update.elm index 9607628da..967c2813b 100644 --- a/engine-wizard/elm/Wizard/Public/Login/Update.elm +++ b/engine-wizard/elm/Wizard/Public/Login/Update.elm @@ -1,11 +1,11 @@ module Wizard.Public.Login.Update exposing (update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Json.Encode as E import Shared.Api.Tokens as TokensApi import Shared.Data.Token exposing (Token) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (dispatch) import Wizard.Auth.Msgs import Wizard.Common.AppState exposing (AppState) @@ -49,4 +49,4 @@ loginCompleted appState model result = ( model, dispatch (Wizard.Msgs.AuthMsg <| Wizard.Auth.Msgs.GotToken token model.originalUrl) ) Err error -> - ( { model | loggingIn = ApiError.toActionResult appState (lg "apiError.tokens.fetchTokenError" appState) error }, Cmd.none ) + ( { model | loggingIn = ApiError.toActionResult appState (gettext "Login failed." appState.locale) error }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Public/Login/View.elm b/engine-wizard/elm/Wizard/Public/Login/View.elm index 34da82df7..19a5d380d 100644 --- a/engine-wizard/elm/Wizard/Public/Login/View.elm +++ b/engine-wizard/elm/Wizard/Public/Login/View.elm @@ -1,10 +1,10 @@ module Wizard.Public.Login.View exposing (view) -import Html exposing (Html, div, form, input, span) +import Gettext exposing (gettext) +import Html exposing (Html, div, form, input, span, text) import Html.Attributes exposing (class, id, placeholder, type_) import Html.Events exposing (onInput, onSubmit) import Shared.Html exposing (fa) -import Shared.Locale exposing (l, lg, lx) import Shared.Markdown as Markdown import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) @@ -17,16 +17,6 @@ import Wizard.Public.Login.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Public.Login.View" - - -lx_ : String -> AppState -> Html Msg -lx_ = - lx "Wizard.Public.Login.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -62,22 +52,22 @@ formView appState model = loginForm = [ div [ class "form-group" ] [ span [ class "input-icon" ] [ fa "fas fa-envelope" ] - , input [ onInput Email, id "email", type_ "text", class "form-control", placeholder <| lg "user.email" appState ] [] + , input [ onInput Email, id "email", type_ "text", class "form-control", placeholder <| gettext "Email" appState.locale ] [] ] , div [ class "form-group" ] [ span [ class "input-icon" ] [ fa "fas fa-key" ] - , input [ onInput Password, id "password", type_ "password", class "form-control", placeholder <| lg "user.password" appState ] [] + , input [ onInput Password, id "password", type_ "password", class "form-control", placeholder <| gettext "Password" appState.locale ] [] ] , div [ class "form-group d-flex align-items-baseline justify-content-between" ] - [ linkTo appState Routes.publicForgottenPassword [] [ lx_ "form.link" appState ] - , ActionButton.submit appState <| ActionButton.SubmitConfig (l_ "form.submit" appState) model.loggingIn + [ linkTo appState Routes.publicForgottenPassword [] [ text (gettext "Forgot your password?" appState.locale) ] + , ActionButton.submit appState <| ActionButton.SubmitConfig (gettext "Log In" appState.locale) model.loggingIn ] ] externalLogin = if List.length appState.config.authentication.external.services > 0 then div [ class "external-login-separator", dataCy "login_external_separator" ] - [ lx_ "connectWith" appState ] + [ text (gettext "Or connect with" appState.locale) ] :: List.map (ExternalLoginButton.view appState) appState.config.authentication.external.services else @@ -85,7 +75,7 @@ formView appState model = in div [ class "align-self-center col-xs-10 col-sm-8 col-md-6 col-lg-4" ] [ form [ onSubmit DoLogin, class "card bg-light" ] - [ div [ class "card-header" ] [ lx_ "form.title" appState ] + [ div [ class "card-header" ] [ text (gettext "Log In" appState.locale) ] , div [ class "card-body" ] (FormResult.view appState model.loggingIn :: loginForm diff --git a/engine-wizard/elm/Wizard/Public/Signup/Update.elm b/engine-wizard/elm/Wizard/Public/Signup/Update.elm index bca8c20d0..d1faaa71e 100644 --- a/engine-wizard/elm/Wizard/Public/Signup/Update.elm +++ b/engine-wizard/elm/Wizard/Public/Signup/Update.elm @@ -2,10 +2,10 @@ module Wizard.Public.Signup.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.Users as UsersApi import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Public.Common.SignupForm as SignupForm @@ -61,6 +61,6 @@ handlePostSignupCompleted appState result model = setFormErrors appState error model.form errorMessage = - ApiError.toActionResult appState (lg "apiError.users.public.postError" appState) error + ApiError.toActionResult appState (gettext "Sign up process failed." appState.locale) error in ( { model | signingUp = errorMessage, form = form }, Cmd.none ) diff --git a/engine-wizard/elm/Wizard/Public/Signup/View.elm b/engine-wizard/elm/Wizard/Public/Signup/View.elm index 262746ea3..a9007e17f 100644 --- a/engine-wizard/elm/Wizard/Public/Signup/View.elm +++ b/engine-wizard/elm/Wizard/Public/Signup/View.elm @@ -4,11 +4,12 @@ import ActionResult exposing (ActionResult(..)) import Bootstrap.Form exposing (label) import Form exposing (Form) import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, div, p, text) import Html.Attributes exposing (class, classList, for, href, id, name, target) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.FormGroup as FormGroup @@ -21,28 +22,13 @@ import Wizard.Public.Signup.Msgs exposing (Msg(..)) import Wizard.Routes as Routes -l_ : String -> AppState -> String -l_ = - l "Wizard.Public.Signup.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Public.Signup.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Public.Signup.View" - - view : AppState -> Model -> Html Msg view appState model = let content = case model.signingUp of Success _ -> - Page.success appState <| l_ "success" appState + Page.success appState <| gettext "Sign up was successful. Check your email for the activation link." appState.locale _ -> signupForm appState model @@ -55,12 +41,12 @@ signupForm : AppState -> Model -> Html Msg signupForm appState model = let formConfig = - { title = l_ "form.title" appState + { title = gettext "Sign Up" appState.locale , submitMsg = FormMsg Form.Submit , actionResult = model.signingUp - , submitLabel = l_ "form.submit" appState + , submitLabel = gettext "Sign Up" appState.locale , formContent = formView appState model.form |> Html.map FormMsg - , link = Just ( Routes.PublicRoute (LoginRoute Nothing), l_ "form.link" appState ) + , link = Just ( Routes.PublicRoute (LoginRoute Nothing), gettext "I already have an account" appState.locale ) } in publicForm appState formConfig @@ -94,33 +80,39 @@ formView appState form = privacyLink privacyUrl = a [ href privacyUrl, target "_blank", dataCy "signup_link_privacy" ] - [ lx_ "form.privacy" appState ] + [ text (gettext "Privacy" appState.locale) ] termsOfServiceLink termsOfServiceUrl = a [ href termsOfServiceUrl, target "_blank", dataCy "signup_link_tos" ] - [ lx_ "form.termsOfService" appState ] + [ text (gettext "Terms of Service" appState.locale) ] acceptGroup = case ( appState.config.privacyAndSupport.privacyUrl, appState.config.privacyAndSupport.termsOfServiceUrl ) of ( Just privacyUrl, Just termsOfServiceUrl ) -> viewAcceptGroup - (lh_ "form.privacyTextBoth" + (String.formatHtml + (gettext "I have read %s and %s." appState.locale) [ privacyLink privacyUrl , termsOfServiceLink termsOfServiceUrl ] - appState ) - (lx_ "form.privacyErrorBoth" appState) + (text (gettext "You have to read Privacy and Terms of Service first" appState.locale)) ( Just privacyUrl, Nothing ) -> viewAcceptGroup - (lh_ "form.privacyText" [ privacyLink privacyUrl ] appState) - (lx_ "form.privacyErrorPrivacy" appState) + (String.formatHtml + (gettext "I have read %s." appState.locale) + [ privacyLink privacyUrl ] + ) + (text (gettext "You have to read Privacy first" appState.locale)) ( Nothing, Just termsOfServiceUrl ) -> viewAcceptGroup - (lh_ "form.privacyText" [ termsOfServiceLink termsOfServiceUrl ] appState) - (lx_ "form.privacyErrorTerms" appState) + (String.formatHtml + (gettext "I have read %s." appState.locale) + [ termsOfServiceLink termsOfServiceUrl ] + ) + (text (gettext "You have to read Terms of Service first" appState.locale)) _ -> emptyNode @@ -134,14 +126,14 @@ formView appState form = ] in div [] - [ FormGroup.input appState form "email" <| lg "user.email" appState - , FormGroup.input appState form "firstName" <| lg "user.firstName" appState - , FormGroup.input appState form "lastName" <| lg "user.lastName" appState + [ FormGroup.input appState form "email" <| gettext "Email" appState.locale + , FormGroup.input appState form "firstName" <| gettext "First name" appState.locale + , FormGroup.input appState form "lastName" <| gettext "Last name" appState.locale , FormGroup.optionalWrapper appState <| FormGroup.inputWithTypehints appState.config.organization.affiliations appState form "affiliation" <| - lg "user.affiliation" appState - , FormGroup.passwordWithStrength appState form "password" <| lg "user.password" appState - , FormGroup.password appState form "passwordConfirmation" <| lg "user.passwordConfirmation" appState + gettext "Affiliation" appState.locale + , FormGroup.passwordWithStrength appState form "password" <| gettext "Password" appState.locale + , FormGroup.password appState form "passwordConfirmation" <| gettext "Password again" appState.locale , acceptGroup , acceptFakeGroup ] diff --git a/engine-wizard/elm/Wizard/Public/SignupConfirmation/Update.elm b/engine-wizard/elm/Wizard/Public/SignupConfirmation/Update.elm index 6412e1fec..6d17611eb 100644 --- a/engine-wizard/elm/Wizard/Public/SignupConfirmation/Update.elm +++ b/engine-wizard/elm/Wizard/Public/SignupConfirmation/Update.elm @@ -1,9 +1,9 @@ module Wizard.Public.SignupConfirmation.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Users as UsersApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Public.SignupConfirmation.Models exposing (Model) @@ -29,4 +29,4 @@ handleSendConfirmationCompleted appState result model = { model | confirmation = Success "" } Err error -> - { model | confirmation = ApiError.toActionResult appState (lg "apiError.users.activation.putError" appState) error } + { model | confirmation = ApiError.toActionResult appState (gettext "Sign up process failed." appState.locale) error } diff --git a/engine-wizard/elm/Wizard/Public/SignupConfirmation/View.elm b/engine-wizard/elm/Wizard/Public/SignupConfirmation/View.elm index 39ceb60c7..bf7936b3e 100644 --- a/engine-wizard/elm/Wizard/Public/SignupConfirmation/View.elm +++ b/engine-wizard/elm/Wizard/Public/SignupConfirmation/View.elm @@ -1,9 +1,10 @@ module Wizard.Public.SignupConfirmation.View exposing (view) -import Html exposing (Html, div, h1, p) +import Gettext exposing (gettext) +import Html exposing (Html, div, h1, p, text) import Html.Attributes exposing (class) import Shared.Html exposing (faSet) -import Shared.Locale exposing (lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -13,16 +14,6 @@ import Wizard.Public.SignupConfirmation.Msgs exposing (Msg) import Wizard.Routes as Routes -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Public.SignupConfirmation.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Public.SignupConfirmation.View" - - view : AppState -> Model -> Html Msg view appState model = div [ class "row justify-content-center Public__SignupConfirmation" ] @@ -34,9 +25,12 @@ successView appState _ = div [ class "px-4 py-5 bg-light rounded-3e", dataCy "message_success" ] [ h1 [ class "display-3" ] [ faSet "_global.success" appState ] , p [ class "lead" ] - (lh_ "confirmation" - [ linkTo appState (Routes.publicLogin Nothing) [ class "btn btn-primary ms-1" ] [ lx_ "logIn" appState ] + (String.formatHtml + (gettext "Your email was successfully confirmed. You can now %s." appState.locale) + [ linkTo appState + (Routes.publicLogin Nothing) + [ class "btn btn-primary ms-1" ] + [ text (gettext "log in" appState.locale) ] ] - appState ) ] diff --git a/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/Update.elm b/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/Update.elm index f5bf2bd9c..c588552b0 100644 --- a/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/Update.elm +++ b/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/Update.elm @@ -4,9 +4,9 @@ module Wizard.Registry.RegistrySignupConfirmation.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Registry as RegistryApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs import Wizard.Registry.RegistrySignupConfirmation.Models exposing (Model) @@ -32,4 +32,4 @@ handlePostConfirmationComplete appState model result = { model | confirmation = Success () } Err error -> - { model | confirmation = ApiError.toActionResult appState (lg "apiError.registry.confirmation" appState) error } + { model | confirmation = ApiError.toActionResult appState (gettext "Unable to confirm the registry account." appState.locale) error } diff --git a/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/View.elm b/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/View.elm index 2fac5bd1a..03ada4f9f 100644 --- a/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/View.elm +++ b/engine-wizard/elm/Wizard/Registry/RegistrySignupConfirmation/View.elm @@ -1,9 +1,10 @@ module Wizard.Registry.RegistrySignupConfirmation.View exposing (view) -import Html exposing (Html, div, h1, p) +import Gettext exposing (gettext) +import Html exposing (Html, div, h1, p, text) import Html.Attributes exposing (class) import Shared.Html exposing (faSet) -import Shared.Locale exposing (lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.View.Page as Page @@ -12,16 +13,6 @@ import Wizard.Registry.RegistrySignupConfirmation.Msgs exposing (Msg) import Wizard.Routes as Routes -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Registry.RegistrySignupConfirmation.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Registry.RegistrySignupConfirmation.View" - - view : AppState -> Model -> Html Msg view appState model = div [ class "row justify-content-center" ] @@ -33,9 +24,12 @@ successView appState _ = div [ class "px-4 py-5 bg-light rounded-3" ] [ h1 [ class "display-3" ] [ faSet "_global.success" appState ] , p [ class "lead" ] - (lh_ "confirmation" - [ linkTo appState Routes.settingsRegistry [] [ lx_ "settings" appState ] + (String.formatHtml + (gettext "Your email was successfuly confirmed, you can go back to %s." appState.locale) + [ linkTo appState + Routes.settingsRegistry + [] + [ text (gettext "Settings" appState.locale) ] ] - appState ) ] diff --git a/engine-wizard/elm/Wizard/Settings/Authentication/View.elm b/engine-wizard/elm/Wizard/Settings/Authentication/View.elm index 1645b4a7f..24e458649 100644 --- a/engine-wizard/elm/Wizard/Settings/Authentication/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Authentication/View.elm @@ -2,6 +2,7 @@ module Wizard.Settings.Authentication.View exposing (view) import Form exposing (Form) import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, div, h3, hr, label, strong, text) import Html.Attributes exposing (attribute, class, placeholder) import Html.Events exposing (onClick) @@ -9,7 +10,6 @@ import Shared.Auth.Role as Role import Shared.Data.EditableConfig.EditableAuthenticationConfig.EditableOpenIDServiceConfig exposing (EditableOpenIDServiceConfig) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import String.Extra as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -24,16 +24,6 @@ import Wizard.Settings.Generic.Msgs as GenericMsgs import Wizard.Settings.Generic.View as GenericView -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Authentication.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.Authentication.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewContent appState model) model.openIDPrefabs @@ -46,8 +36,8 @@ viewContent appState model openIDPrefabs = viewProps : List EditableOpenIDServiceConfig -> GenericView.ViewProps AuthenticationConfigForm Msg viewProps openIDPrefabs = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Authentication" + , locSave = gettext "Save" , formView = formView openIDPrefabs , wrapMsg = formMsg } @@ -56,13 +46,13 @@ viewProps openIDPrefabs = formView : List EditableOpenIDServiceConfig -> AppState -> Form FormError AuthenticationConfigForm -> Html Msg formView openIDPrefabs appState form = div [ class "Authentication" ] - [ mapFormMsg <| FormGroup.select appState (Role.options appState) form "defaultRole" (l_ "form.defaultRole" appState) - , FormExtra.mdAfter (l_ "form.defaultRole.desc" appState) - , h3 [] [ lx_ "section.internal" appState ] - , mapFormMsg <| FormGroup.toggle form "registrationEnabled" (l_ "form.registration" appState) - , FormExtra.mdAfter (l_ "form.registration.desc" appState) - , h3 [] [ lx_ "section.external" appState ] - , FormGroup.listWithCustomMsg appState formMsg (serviceFormView appState openIDPrefabs) form "services" (l_ "form.services" appState) + [ mapFormMsg <| FormGroup.select appState (Role.options appState) form "defaultRole" (gettext "Default role" appState.locale) + , FormExtra.mdAfter (gettext "Define the role that is assigned to new users." appState.locale) + , h3 [] [ text (gettext "Internal" appState.locale) ] + , mapFormMsg <| FormGroup.toggle form "registrationEnabled" (gettext "Registration" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users can create new internal accounts directly in the instance." appState.locale) + , h3 [] [ text (gettext "External" appState.locale) ] + , FormGroup.listWithCustomMsg appState formMsg (serviceFormView appState openIDPrefabs) form "services" (gettext "OpenID Services" appState.locale) ] @@ -140,7 +130,7 @@ serviceFormView appState openIDPrefabs form i = [ prefabsView , div [ class "row" ] [ div [ class "col" ] - [ mapFormMsg <| FormGroup.input appState form idField (l_ "form.service.id" appState) ] + [ mapFormMsg <| FormGroup.input appState form idField (gettext "ID" appState.locale) ] , div [ class "col text-end" ] [ mapFormMsg <| a @@ -149,18 +139,18 @@ serviceFormView appState openIDPrefabs form i = , dataCy "settings_authentication_service_remove-button" ] [ faSet "_global.delete" appState - , lx_ "form.service.remove" appState + , text (gettext "Remove" appState.locale) ] ] ] - , FormGroup.textView "callback-url" callbackUrl (l_ "form.service.callbackUrl" appState) + , FormGroup.textView "callback-url" callbackUrl (gettext "Callback URL" appState.locale) , div [ class "row" ] - [ div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientIdField (l_ "form.service.clientId" appState) ] - , div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientSecretField (l_ "form.service.clientSecret" appState) ] + [ div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientIdField (gettext "Client ID" appState.locale) ] + , div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientSecretField (gettext "Client Secret" appState.locale) ] ] - , mapFormMsg <| FormGroup.input appState form urlField (l_ "form.service.url" appState) + , mapFormMsg <| FormGroup.input appState form urlField (gettext "URL" appState.locale) , div [ class "input-table", dataCy "settings_authentication_service_parameters" ] - [ label [] [ lx_ "form.service.parameters" appState ] + [ label [] [ text (gettext "Parameters" appState.locale) ] , serviceParametersHeader appState parametersField form , mapFormMsg <| FormGroup.list appState (serviceParameterView appState parametersField) form parametersField "" ] @@ -169,24 +159,24 @@ serviceFormView appState openIDPrefabs form i = [ div [ class "col-7" ] [ div [ class "row" ] [ div [ class "col" ] - [ mapFormMsg <| FormGroup.inputAttrs [ placeholder <| ExternalLoginButton.defaultIcon appState ] appState form styleIconField (l_ "form.service.icon" appState) + [ mapFormMsg <| FormGroup.inputAttrs [ placeholder <| ExternalLoginButton.defaultIcon appState ] appState form styleIconField (gettext "Icon" appState.locale) ] , div [ class "col" ] - [ mapFormMsg <| FormGroup.input appState form nameField (l_ "form.service.name" appState) + [ mapFormMsg <| FormGroup.input appState form nameField (gettext "Name" appState.locale) ] ] , div [ class "row" ] [ div [ class "col" ] - [ mapFormMsg <| FormGroup.inputAttrs [ placeholder ExternalLoginButton.defaultBackground ] appState form styleBackgroundField (l_ "form.service.background" appState) + [ mapFormMsg <| FormGroup.inputAttrs [ placeholder ExternalLoginButton.defaultBackground ] appState form styleBackgroundField (gettext "Background" appState.locale) ] , div [ class "col" ] - [ mapFormMsg <| FormGroup.inputAttrs [ placeholder ExternalLoginButton.defaultColor ] appState form styleColorField (l_ "form.service.color" appState) + [ mapFormMsg <| FormGroup.inputAttrs [ placeholder ExternalLoginButton.defaultColor ] appState form styleColorField (gettext "Color" appState.locale) ] ] ] , div [ class "col-4 offset-1" ] [ div [ class "form-group" ] - [ label [] [ lx_ "form.service.buttonPreview" appState ] + [ label [] [ text (gettext "Button Preview" appState.locale) ] , div [ class "mt-4" ] [ ExternalLoginButton.render [] appState buttonName buttonIcon buttonColor buttonBackground ] @@ -208,8 +198,8 @@ serviceParametersHeader appState field form = else div [ class "row input-table-header" ] - [ div [ class "col-5" ] [ lx_ "form.service.parameter.name" appState ] - , div [ class "col-6" ] [ lx_ "form.service.parameter.value" appState ] + [ div [ class "col-5" ] [ text (gettext "Name" appState.locale) ] + , div [ class "col-6" ] [ text (gettext "Value" appState.locale) ] ] @@ -229,10 +219,10 @@ serviceParameterView appState prefix form i = Form.getFieldAsString value form ( nameError, nameErrorClass ) = - FormGroup.getErrors appState nameField (l_ "form.service.parameter.name" appState) + FormGroup.getErrors appState nameField (gettext "Name" appState.locale) ( valueError, valueErrorClass ) = - FormGroup.getErrors appState valueField (l_ "form.service.parameter.value" appState) + FormGroup.getErrors appState valueField (gettext "Value" appState.locale) in div [ class "row mb-2" ] [ div [ class "col-5" ] diff --git a/engine-wizard/elm/Wizard/Settings/Dashboard/View.elm b/engine-wizard/elm/Wizard/Settings/Dashboard/View.elm index c3d1bc875..8f98e6431 100644 --- a/engine-wizard/elm/Wizard/Settings/Dashboard/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Dashboard/View.elm @@ -1,10 +1,10 @@ module Wizard.Settings.Dashboard.View exposing (view) import Form exposing (Form) -import Html exposing (Html, div, img, label, p, strong) +import Gettext exposing (gettext) +import Html exposing (Html, div, img, label, p, strong, text) import Html.Attributes exposing (class, src) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lx) import Shared.Utils exposing (compose2) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra @@ -15,16 +15,6 @@ import Wizard.Settings.Generic.Msgs exposing (Msg(..)) import Wizard.Settings.Generic.View as GenericView -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Dashboard.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.Dashboard.View" - - view : AppState -> Model -> Html Msg view = GenericView.view viewProps @@ -32,8 +22,8 @@ view = viewProps : GenericView.ViewProps DashboardConfigForm Msg viewProps = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Dashboard" + , locSave = gettext "Save" , formView = compose2 (Html.map FormMsg) formView , wrapMsg = FormMsg } @@ -45,29 +35,29 @@ formView appState form = opts = [ ( DashboardConfigForm.dashboardWelcome , div [] - [ strong [] [ lx_ "dashboardOptions.welcome" appState ] - , p [ class "text-muted" ] [ lx_ "dashboardOptions.welcome.desc" appState ] + [ strong [] [ text (gettext "Welcome" appState.locale) ] + , p [ class "text-muted" ] [ text (gettext "Standard welcome screen." appState.locale) ] , img [ class "settings-img", src "/img/settings/dashboard-welcome.png" ] [] ] ) , ( DashboardConfigForm.dashboardRoleBased , div [] - [ strong [] [ lx_ "dashboardOptions.roleBased" appState ] - , p [ class "text-muted" ] [ lx_ "dashboardOptions.roleBased.desc" appState ] + [ strong [] [ text (gettext "Role-Based" appState.locale) ] + , p [ class "text-muted" ] [ text (gettext "Relevant content based on user's role." appState.locale) ] , img [ class "settings-img", src "/img/settings/dashboard-rolebased.png" ] [] ] ) ] in div [ class "Dashboard" ] - [ FormGroup.htmlRadioGroup appState opts form "dashboardType" (l_ "form.dashboardStyle" appState) + [ FormGroup.htmlRadioGroup appState opts form "dashboardType" (gettext "Dashboard Style" appState.locale) , div [ class "row mt-5" ] [ div [ class "col-12" ] - [ label [] [ lx_ "form.welcomeInfo" appState ] + [ label [] [ text (gettext "Welcome Info" appState.locale) ] ] , div [ class "col-8" ] [ FormGroup.markdownEditor appState form "welcomeInfo" "" - , FormExtra.mdAfter (l_ "form.welcomeInfo.desc" appState) + , FormExtra.mdAfter (gettext "Welcome info is visible at the dashboard after login as a blue box." appState.locale) ] , div [ class "col-4" ] [ img [ class "settings-img", src "/img/settings/welcome-info.png" ] [] @@ -75,11 +65,11 @@ formView appState form = ] , div [ class "row mt-5" ] [ div [ class "col-12" ] - [ label [] [ lx_ "form.welcomeWarning" appState ] + [ label [] [ text (gettext "Welcome Warning" appState.locale) ] ] , div [ class "col-8" ] [ FormGroup.markdownEditor appState form "welcomeWarning" "" - , FormExtra.mdAfter (l_ "form.welcomeWarning.desc" appState) + , FormExtra.mdAfter (gettext "Welcome warning is visible at the dashboard after login as a yellow box." appState.locale) ] , div [ class "col-4" ] [ img [ class "settings-img", src "/img/settings/welcome-warning.png" ] [] diff --git a/engine-wizard/elm/Wizard/Settings/Generic/Update.elm b/engine-wizard/elm/Wizard/Settings/Generic/Update.elm index 489d334ea..b0a9d638f 100644 --- a/engine-wizard/elm/Wizard/Settings/Generic/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Generic/Update.elm @@ -7,11 +7,11 @@ module Wizard.Settings.Generic.Update exposing import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Form.Validate exposing (Validation) +import Gettext exposing (gettext) import Shared.Api.Configs as ConfigsApi import Shared.Data.EditableConfig as EditableConfig exposing (EditableConfig) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs @@ -65,7 +65,7 @@ handleGetConfigCompleted props appState model result = { model | form = props.initForm config, config = Success config } Err error -> - { model | config = ApiError.toActionResult appState (lg "apiError.config.app.getError" appState) error } + { model | config = ApiError.toActionResult appState (gettext "Unable to load settings." appState.locale) error } cmd = getResultCmd result @@ -89,7 +89,7 @@ handlePutConfigCompleted _ appState model result = ) Err error -> - ( ApiError.toActionResult appState (lg "apiError.config.app.putError" appState) error + ( ApiError.toActionResult appState (gettext "Settings could not be saved." appState.locale) error , getResultCmd result ) in diff --git a/engine-wizard/elm/Wizard/Settings/Generic/View.elm b/engine-wizard/elm/Wizard/Settings/Generic/View.elm index 3bbdad33b..75a26cb8b 100644 --- a/engine-wizard/elm/Wizard/Settings/Generic/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Generic/View.elm @@ -4,6 +4,7 @@ module Wizard.Settings.Generic.View exposing ) import Form exposing (Form) +import Gettext import Html exposing (Html, div) import Html.Attributes exposing (class) import Shared.Form.FormError exposing (FormError) @@ -16,8 +17,8 @@ import Wizard.Settings.Generic.Model exposing (Model) type alias ViewProps form msg = - { locTitle : AppState -> String - , locSave : AppState -> String + { locTitle : Gettext.Locale -> String + , locSave : Gettext.Locale -> String , formView : AppState -> Form FormError form -> Html msg , wrapMsg : Form.Msg -> msg } @@ -31,13 +32,13 @@ view props appState model = viewForm : ViewProps form msg -> AppState -> Model form -> config -> Html msg viewForm props appState model _ = div [ wideDetailClass "" ] - [ Page.header (props.locTitle appState) [] + [ Page.header (props.locTitle appState.locale) [] , div [] [ FormResult.errorOnlyView appState model.savingConfig , props.formView appState model.form , div [ class "mt-5" ] [ ActionButton.buttonWithAttrs appState - (ActionButton.ButtonWithAttrsConfig (props.locSave appState) + (ActionButton.ButtonWithAttrsConfig (props.locSave appState.locale) model.savingConfig (props.wrapMsg Form.Submit) False diff --git a/engine-wizard/elm/Wizard/Settings/KnowledgeModels/View.elm b/engine-wizard/elm/Wizard/Settings/KnowledgeModels/View.elm index a529df4e1..9bac73d00 100644 --- a/engine-wizard/elm/Wizard/Settings/KnowledgeModels/View.elm +++ b/engine-wizard/elm/Wizard/Settings/KnowledgeModels/View.elm @@ -2,12 +2,12 @@ module Wizard.Settings.KnowledgeModels.View exposing (view) import Form exposing (Form) import Form.Input as Input -import Html exposing (Html, button, div, hr, span) +import Gettext exposing (gettext) +import Html exposing (Html, button, div, hr, span, text) import Html.Attributes exposing (class, id) import Html.Events exposing (onClick) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Shared.Utils exposing (compose2) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra @@ -18,16 +18,6 @@ import Wizard.Settings.Generic.View as GenericView import Wizard.Settings.KnowledgeModels.Models exposing (Model) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.KnowledgeModels.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.KnowledgeModels.View" - - view : AppState -> Model -> Html Msg view = GenericView.view viewProps @@ -35,8 +25,8 @@ view = viewProps : GenericView.ViewProps EditableKnowledgeModelConfigForm Msg viewProps = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Knowledge Models" + , locSave = gettext "Save" , formView = compose2 (Html.map FormMsg) formView , wrapMsg = FormMsg } @@ -53,25 +43,25 @@ formView appState form = let allowedInputHeader = div [ class "form-list-header mb-2" ] - [ span [] [ lx_ "form.allowedPackages.orgId" appState ] - , span [] [ lx_ "form.allowedPackages.kmId" appState ] - , span [] [ lx_ "form.allowedPackages.minVersion" appState ] - , span [] [ lx_ "form.allowedPackages.maxVersion" appState ] + [ span [] [ text (gettext "Organization ID" appState.locale) ] + , span [] [ text (gettext "Knowledge Model ID" appState.locale) ] + , span [] [ text (gettext "Min Version" appState.locale) ] + , span [] [ text (gettext "Max Version" appState.locale) ] ] in div [ class "nested-group" ] - [ FormGroup.listWithHeader appState allowedInputHeader (allowedPackageFormView appState) form "publicPackages" (l_ "form.allowedPackages" appState) + [ FormGroup.listWithHeader appState allowedInputHeader (allowedPackageFormView appState) form "publicPackages" (gettext "Allowed Packages" appState.locale) ] else emptyNode in div [] - [ FormGroup.toggle form "publicEnabled" (l_ "form.public" appState) - , FormExtra.mdAfter (l_ "form.public.desc" appState) + [ FormGroup.toggle form "publicEnabled" (gettext "Public Knowledge Models" appState.locale) + , FormExtra.mdAfter (gettext "If enabled you can define knowledge models that are publicly available for reading." appState.locale) , allowedInput , hr [] [] - , FormGroup.resizableTextarea appState form "integrationConfig" (l_ "form.integrationConfig" appState) + , FormGroup.resizableTextarea appState form "integrationConfig" (gettext "Integration Config" appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Settings/LookAndFeel/LogoUploadModal.elm b/engine-wizard/elm/Wizard/Settings/LookAndFeel/LogoUploadModal.elm index bd3911bfe..5d515ff15 100644 --- a/engine-wizard/elm/Wizard/Settings/LookAndFeel/LogoUploadModal.elm +++ b/engine-wizard/elm/Wizard/Settings/LookAndFeel/LogoUploadModal.elm @@ -9,6 +9,7 @@ module Wizard.Settings.LookAndFeel.LogoUploadModal exposing import ActionResult exposing (ActionResult(..)) import File exposing (File) import File.Select as Select +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, h5, hr, p, span, text) import Html.Attributes exposing (class, classList, disabled, style) import Html.Events exposing (onClick) @@ -18,7 +19,6 @@ import Shared.Api.Configs as ConfigsApi import Shared.Data.BootstrapConfig.LookAndFeelConfig as LookAndFeelConfig import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lg, lx) import Task import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Events exposing (alwaysPreventDefaultOn) @@ -27,16 +27,6 @@ import Wizard.Common.View.FormResult as FormResult import Wizard.Common.View.Modal as Modal -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.LookAndFeel.LogoUploadModal" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.LookAndFeel.LogoUploadModal" - - type alias Model = { hover : Bool , preview : Maybe String @@ -130,7 +120,7 @@ update wrapMsg reloadCmd msg appState model = ( model, reloadCmd ) Err error -> - ( { model | submitting = ApiError.toActionResult appState (lg "apiError.config.app.uploadLogoError" appState) error }, Cmd.none ) + ( { model | submitting = ApiError.toActionResult appState (gettext "Unable to upload logo." appState.locale) error }, Cmd.none ) view : AppState -> Model -> Html Msg @@ -148,7 +138,7 @@ view appState model = submitButton = ActionButton.buttonWithAttrs appState - { label = l_ "save" appState + { label = gettext "Save" appState.locale , result = model.submitting , msg = submitButtonMsg , dangerous = False @@ -157,7 +147,7 @@ view appState model = cancelButton = button [ class "btn btn-secondary", onClick (SetOpen False), disabled (ActionResult.isLoading model.submitting) ] - [ lx_ "cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] viewPreview url = div @@ -175,7 +165,7 @@ view appState model = content = [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ lx_ "title" appState ] ] + [ h5 [ class "modal-title" ] [ text (gettext "Change logo" appState.locale) ] ] , div [ class "modal-body logo-upload" ] [ FormResult.errorOnlyView appState model.submitting , div @@ -186,12 +176,12 @@ view appState model = , alwaysPreventDefaultOn "dragleave" (D.succeed DragLeave) , alwaysPreventDefaultOn "drop" dropDecoder ] - [ button [ onClick Pick, class "btn btn-secondary" ] [ lx_ "chooseLogo" appState ] - , p [] [ lx_ "dropHere" appState ] + [ button [ onClick Pick, class "btn btn-secondary" ] [ text (gettext "Choose logo" appState.locale) ] + , p [] [ text (gettext "Or just drop it here" appState.locale) ] ] , hr [] [] , p [ class "text-center" ] - [ a [ onClick UseDefault ] [ lx_ "useDefault" appState ] + [ a [ onClick UseDefault ] [ text (gettext "Use default logo" appState.locale) ] ] , preview ] diff --git a/engine-wizard/elm/Wizard/Settings/LookAndFeel/View.elm b/engine-wizard/elm/Wizard/Settings/LookAndFeel/View.elm index 785216ef3..3e6816998 100644 --- a/engine-wizard/elm/Wizard/Settings/LookAndFeel/View.elm +++ b/engine-wizard/elm/Wizard/Settings/LookAndFeel/View.elm @@ -3,6 +3,7 @@ module Wizard.Settings.LookAndFeel.View exposing (view) import Form exposing (Form) import Form.Field as Field import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, button, div, hr, img, label, span, text) import Html.Attributes exposing (attribute, class, placeholder, src, style) import Html.Events exposing (onClick) @@ -11,7 +12,6 @@ import Shared.Data.BootstrapConfig.LookAndFeelConfig as LookAndFeelConfig import Shared.Data.EditableConfig.EditableLookAndFeelConfig exposing (EditableLookAndFeelConfig) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet, faSetFw) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown import Shared.Undraw as Undraw import String.Extra as String @@ -28,16 +28,6 @@ import Wizard.Settings.LookAndFeel.Models exposing (Model) import Wizard.Settings.LookAndFeel.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.LookAndFeel.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.LookAndFeel.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewForm appState model) model.genericModel.config @@ -46,13 +36,13 @@ view appState model = viewForm : AppState -> Model -> config -> Html Msg viewForm appState model _ = div [ wideDetailClass "LookAndFeel" ] - [ Page.header (l_ "title" appState) [] + [ Page.header (gettext "Look & Feel" appState.locale) [] , div [] [ FormResult.errorOnlyView appState model.genericModel.savingConfig , formView appState model.genericModel.form , div [ class "mt-5" ] [ ActionButton.buttonWithAttrs appState - (ActionButton.ButtonWithAttrsConfig (l_ "save" appState) + (ActionButton.ButtonWithAttrsConfig (gettext "Save" appState.locale) model.genericModel.savingConfig (GenericMsg <| GenericMsgs.FormMsg Form.Submit) False @@ -159,8 +149,8 @@ formView appState form = div [] ([ div [ class "row" ] [ div [ class "col-8" ] - [ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitle ] appState form "appTitle" (l_ "form.appTitle" appState) - , FormExtra.mdAfter (l_ "form.appTitle.desc" appState) + [ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitle ] appState form "appTitle" (gettext "Application Title" appState.locale) + , FormExtra.mdAfter (gettext "Full name of the DSW instance (displayed, for example, in the browser tab title or before login)." appState.locale) ] , div [ class "col-4" ] @@ -169,8 +159,8 @@ formView appState form = ] , div [ class "row mt-5" ] [ div [ class "col-8" ] - [ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitleShort ] appState form "appTitleShort" (l_ "form.appTitleShort" appState) - , FormExtra.mdAfter (l_ "form.appTitleShort.desc" appState) + [ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitleShort ] appState form "appTitleShort" (gettext "Short Application Title" appState.locale) + , FormExtra.mdAfter (gettext "Short name of the DSW instance (displayed, for example, on top of the navigation bar). Short title can be the same as the application title if it is short enough." appState.locale) ] , div [ class "col-4" ] [ img [ class "settings-img", src "/img/settings/app-title-short.png" ] [] @@ -182,8 +172,8 @@ formView appState form = , div [ class "input-table mt-5" ] [ div [ class "row" ] [ div [ class "col-8" ] - [ label [] [ lx_ "form.customMenuLinks" appState ] - , Markdown.toHtml [ class "form-text text-muted" ] (l_ "form.customMenuLinks.desc" appState) + [ label [] [ text (gettext "Custom Menu Links" appState.locale) ] + , Markdown.toHtml [ class "form-text text-muted" ] (gettext "Configure additional links in the menu. Choose any free icon from the [Font Awesome](https://fontawesome.com/icons?d=gallery&m=free), e.g. *fas fa-magic*. Check *New window* if you want to open the link in a new window." appState.locale) ] , div [ class "col-4" ] [ img [ class "settings-img", src "/img/settings/custom-menu-links.png" ] [] ] @@ -198,10 +188,10 @@ formView appState form = , hr [] [] , div [ class "row mt-5" ] [ div [ class "col-12" ] - [ label [] [ lx_ "form.loginInfo" appState ] ] + [ label [] [ text (gettext "Login Info" appState.locale) ] ] , div [ class "col-8" ] [ formWrap <| FormGroup.markdownEditor appState form "loginInfo" "" - , FormExtra.mdAfter (l_ "form.loginInfo.desc" appState) + , FormExtra.mdAfter (gettext "Additional information displayed at the login screen." appState.locale) ] , div [ class "col-4" ] [ img [ class "settings-img", src "/img/settings/login-info-text.png" ] [] @@ -282,13 +272,13 @@ customMenuLinksHeader appState form = else div [ class "row input-table-header" ] [ div [ class "col-2" ] - [ lx_ "form.customMenuLinks.icon" appState ] + [ text (gettext "Icon" appState.locale) ] , div [ class "col-3" ] - [ lx_ "form.customMenuLinks.title" appState ] + [ text (gettext "Title" appState.locale) ] , div [ class "col-4" ] - [ lx_ "form.customMenuLinks.url" appState ] + [ text (gettext "URL" appState.locale) ] , div [ class "col-3" ] - [ lx_ "form.customMenuLinks.newWindow" appState ] + [ text (gettext "New window" appState.locale) ] ] diff --git a/engine-wizard/elm/Wizard/Settings/Organization/View.elm b/engine-wizard/elm/Wizard/Settings/Organization/View.elm index d50238979..debb385fc 100644 --- a/engine-wizard/elm/Wizard/Settings/Organization/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Organization/View.elm @@ -1,9 +1,9 @@ module Wizard.Settings.Organization.View exposing (view) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, div) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l) import Shared.Utils exposing (compose2) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra @@ -14,11 +14,6 @@ import Wizard.Settings.Generic.View as GenericView import Wizard.Settings.Organization.Models exposing (Model) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Organization.View" - - view : AppState -> Model -> Html Msg view = GenericView.view viewProps @@ -26,8 +21,8 @@ view = viewProps : GenericView.ViewProps OrganizationConfigForm Msg viewProps = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Organization" + , locSave = gettext "Save" , formView = compose2 (Html.map FormMsg) formView , wrapMsg = FormMsg } @@ -36,11 +31,11 @@ viewProps = formView : AppState -> Form FormError OrganizationConfigForm -> Html Form.Msg formView appState form = div [] - [ FormGroup.input appState form "name" (l_ "form.name" appState) - , FormExtra.textAfter (l_ "form.name.desc" appState) - , FormGroup.textarea appState form "description" (l_ "form.description" appState) - , FormGroup.input appState form "organizationId" (l_ "form.organizationId" appState) - , FormExtra.textAfter (l_ "form.organizationId.desc" appState) - , FormGroup.resizableTextarea appState form "affiliations" (l_ "form.affiliations" appState) - , FormExtra.mdAfter (l_ "form.affiliations.desc" appState) + [ FormGroup.input appState form "name" (gettext "Name" appState.locale) + , FormExtra.textAfter (gettext "Name of the organization running this instance." appState.locale) + , FormGroup.textarea appState form "description" (gettext "Description" appState.locale) + , FormGroup.input appState form "organizationId" (gettext "Organization ID" appState.locale) + , FormExtra.textAfter (gettext "Organization ID is used to identify Knowledge Models created in this instance. It can contain alphanumeric characters and dots but cannot start or end with a dot." appState.locale) + , FormGroup.resizableTextarea appState form "affiliations" (gettext "Affiliations" appState.locale) + , FormExtra.mdAfter (gettext "Affiliation options will be used to help users choose their affiliation while signing up or editing their profile. Write one affiliation option per line." appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Settings/Plans/Update.elm b/engine-wizard/elm/Wizard/Settings/Plans/Update.elm index 47bdb9013..05600d1f9 100644 --- a/engine-wizard/elm/Wizard/Settings/Plans/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Plans/Update.elm @@ -1,7 +1,7 @@ module Wizard.Settings.Plans.Update exposing (fetchData, update) +import Gettext exposing (gettext) import Shared.Api.Apps as AppsApi -import Shared.Locale exposing (lg) import Shared.Setters exposing (setPlans) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -21,7 +21,7 @@ update msg appState model = GetPlansComplete result -> applyResult appState { setResult = setPlans - , defaultError = lg "apiError.apps.getPlansError" appState + , defaultError = gettext "Unable to get plans." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Settings/Plans/View.elm b/engine-wizard/elm/Wizard/Settings/Plans/View.elm index ffb37daa0..7cff74044 100644 --- a/engine-wizard/elm/Wizard/Settings/Plans/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Plans/View.elm @@ -1,8 +1,8 @@ module Wizard.Settings.Plans.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div) import Shared.Data.Plan exposing (Plan) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.PlansList as PlansList import Wizard.Common.Html.Attribute exposing (wideDetailClass) @@ -11,11 +11,6 @@ import Wizard.Settings.Plans.Models exposing (Model) import Wizard.Settings.Plans.Msgs exposing (Msg) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Plans.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewContent appState) model.plans @@ -24,6 +19,6 @@ view appState model = viewContent : AppState -> List Plan -> Html Msg viewContent appState plans = div [ wideDetailClass "" ] - [ Page.header (l_ "title" appState) [] + [ Page.header (gettext "Plans" appState.locale) [] , PlansList.view appState { actions = Nothing } plans ] diff --git a/engine-wizard/elm/Wizard/Settings/PrivacyAndSupport/View.elm b/engine-wizard/elm/Wizard/Settings/PrivacyAndSupport/View.elm index 403ca49fb..c5a294926 100644 --- a/engine-wizard/elm/Wizard/Settings/PrivacyAndSupport/View.elm +++ b/engine-wizard/elm/Wizard/Settings/PrivacyAndSupport/View.elm @@ -1,11 +1,11 @@ module Wizard.Settings.PrivacyAndSupport.View exposing (view) import Form exposing (Form) -import Html exposing (Html, div, h3) +import Gettext exposing (gettext) +import Html exposing (Html, div, h3, text) import Html.Attributes exposing (placeholder) import Shared.Data.BootstrapConfig.PrivacyAndSupportConfig as PrivacyAndSupportConfig exposing (PrivacyAndSupportConfig) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lx) import Shared.Utils exposing (compose2) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra @@ -15,16 +15,6 @@ import Wizard.Settings.Generic.View as GenericView import Wizard.Settings.PrivacyAndSupport.Models exposing (Model) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.PrivacyAndSupport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.PrivacyAndSupport.View" - - view : AppState -> Model -> Html Msg view = GenericView.view viewProps @@ -32,8 +22,8 @@ view = viewProps : GenericView.ViewProps PrivacyAndSupportConfig Msg viewProps = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Privacy & Support" + , locSave = gettext "Save" , formView = compose2 (Html.map FormMsg) formView , wrapMsg = FormMsg } @@ -42,15 +32,15 @@ viewProps = formView : AppState -> Form FormError PrivacyAndSupportConfig -> Html Form.Msg formView appState form = div [] - [ FormGroup.inputAttrs [] appState form "privacyUrl" (l_ "form.privacyUrl" appState) - , FormExtra.mdAfter (l_ "form.privacyUrl.desc" appState) - , FormGroup.inputAttrs [] appState form "termsOfServiceUrl" (l_ "form.termsOfServiceUrl" appState) - , FormExtra.mdAfter (l_ "form.termsOfServiceUrl.desc" appState) - , h3 [] [ lx_ "section.support" appState ] - , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportEmail ] appState form "supportEmail" (l_ "form.supportEmail" appState) - , FormExtra.mdAfter (l_ "form.supportEmail.desc" appState) - , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportRepositoryName ] appState form "supportRepositoryName" (l_ "form.supportRepositoryName" appState) - , FormExtra.mdAfter (l_ "form.supportRepositoryName.desc" appState) - , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportRepositoryUrl ] appState form "supportRepositoryUrl" (l_ "form.supportRepositoryUrl" appState) - , FormExtra.mdAfter (l_ "form.supportRepositoryUrl.desc" appState) + [ FormGroup.inputAttrs [] appState form "privacyUrl" (gettext "Privacy URL" appState.locale) + , FormExtra.mdAfter (gettext "URL to page with the privacy policy of the service." appState.locale) + , FormGroup.inputAttrs [] appState form "termsOfServiceUrl" (gettext "Terms of Service URL" appState.locale) + , FormExtra.mdAfter (gettext "URL to page with the terms of the service." appState.locale) + , h3 [] [ text (gettext "Support" appState.locale) ] + , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportEmail ] appState form "supportEmail" (gettext "Support Email" appState.locale) + , FormExtra.mdAfter (gettext "Support email displayed in the help modal." appState.locale) + , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportRepositoryName ] appState form "supportRepositoryName" (gettext "Support Repository Name" appState.locale) + , FormExtra.mdAfter (gettext "Name of the repository where users can report issues related to the service." appState.locale) + , FormGroup.inputAttrs [ placeholder PrivacyAndSupportConfig.defaultSupportRepositoryUrl ] appState form "supportRepositoryUrl" (gettext "Support Repository URL" appState.locale) + , FormExtra.mdAfter (gettext "URL of the repository where users can report issues related to the service." appState.locale) ] diff --git a/engine-wizard/elm/Wizard/Settings/Projects/View.elm b/engine-wizard/elm/Wizard/Settings/Projects/View.elm index afffb5d10..9f7a4f451 100644 --- a/engine-wizard/elm/Wizard/Settings/Projects/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Projects/View.elm @@ -1,6 +1,7 @@ module Wizard.Settings.Projects.View exposing (view) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, div, hr) import Html.Attributes exposing (class) import Shared.Data.Questionnaire.QuestionnaireCreation as QuestionnaireCreation @@ -8,7 +9,6 @@ import Shared.Data.Questionnaire.QuestionnaireSharing as QuestionnaireSharing import Shared.Data.Questionnaire.QuestionnaireVisibility as QuestionnaireVisibility import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l) import Shared.Utils exposing (compose2) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.View.FormExtra as FormExtra @@ -19,11 +19,6 @@ import Wizard.Settings.Generic.View as GenericView import Wizard.Settings.Projects.Models exposing (Model) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Projects.View" - - view : AppState -> Model -> Html Msg view = GenericView.view viewProps @@ -31,8 +26,8 @@ view = viewProps : GenericView.ViewProps EditableQuestionnairesConfigForm Msg viewProps = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Projects" + , locSave = gettext "Save" , formView = compose2 (Html.map FormMsg) formView , wrapMsg = FormMsg } @@ -46,8 +41,8 @@ formView appState form = anonymousProjectEnabledInput = if sharingEnabled then - [ FormGroup.toggle form "questionnaireSharingAnonymousEnabled" (l_ "form.questionnaireSharingAnonymous" appState) - , FormExtra.mdAfter (l_ "form.questionnaireSharingAnonymous.desc" appState) + [ FormGroup.toggle form "questionnaireSharingAnonymousEnabled" (gettext "Anonymous Projects" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users that are not logged in are allowed to create projects from public knowledge models." appState.locale) ] else @@ -59,12 +54,12 @@ formView appState form = feedbackInput = if feedbackEnabled then div [ class "nested-group" ] - [ FormGroup.input appState form "feedbackOwner" (l_ "form.feedbackOwner" appState) - , FormExtra.mdAfter (l_ "form.feedbackOwner.desc" appState) - , FormGroup.input appState form "feedbackRepo" (l_ "form.feedbackRepo" appState) - , FormExtra.mdAfter (l_ "form.feedbackRepo.desc" appState) - , FormGroup.textarea appState form "feedbackToken" (l_ "form.feedbackToken" appState) - , FormExtra.mdAfter (l_ "form.feedbackToken.desc" appState) + [ FormGroup.input appState form "feedbackOwner" (gettext "GitHub Repository Owner" appState.locale) + , FormExtra.mdAfter (gettext "ht​tps://github.com/**exampleOwner**/exampleRepository" appState.locale) + , FormGroup.input appState form "feedbackRepo" (gettext "GitHub Repository Name" appState.locale) + , FormExtra.mdAfter (gettext "ht​tps://github.com/exampleOwner/**exampleRepository**" appState.locale) + , FormGroup.textarea appState form "feedbackToken" (gettext "Access Token" appState.locale) + , FormExtra.mdAfter (gettext "[Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) for GitHub account creating the issues. Make sure to select **public_repo** scope if the repository is public or **repo** if it is private. We recommend creating a bot account with the access to the feedback repository instead of using your own GitHub account." appState.locale) ] else @@ -76,35 +71,35 @@ formView appState form = projectTaggingInput = if projectTaggingEnabled then div [ class "nested-group" ] - [ FormGroup.resizableTextarea appState form "projectTaggingTags" (l_ "form.projectTaggingTags" appState) - , FormExtra.mdAfter (l_ "form.projectTaggingTags.desc" appState) + [ FormGroup.resizableTextarea appState form "projectTaggingTags" (gettext "Default Project Tags" appState.locale) + , FormExtra.mdAfter (gettext "Default projects tags can be provided to users so they don't have to come up with them on their own. Write one tag per line." appState.locale) ] else emptyNode in div [] - ([ FormGroup.toggle form "questionnaireVisibilityEnabled" (l_ "form.questionnaireVisibility" appState) - , FormExtra.mdAfter (l_ "form.questionnaireVisibility.desc" appState) - , FormGroup.richRadioGroup appState (QuestionnaireVisibility.richFormOptions appState) form "questionnaireVisibilityDefaultValue" (l_ "form.questionnaireVisibilityDefaultValue" appState) - , FormExtra.mdAfter (l_ "form.questionnaireVisibilityDefaultValue.desc" appState) + ([ FormGroup.toggle form "questionnaireVisibilityEnabled" (gettext "Project Visibility" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, project visibility can be set for each project. Otherwise, all projects use the *Default Project Visibility*." appState.locale) + , FormGroup.richRadioGroup appState (QuestionnaireVisibility.richFormOptions appState) form "questionnaireVisibilityDefaultValue" (gettext "Default Project Visibility" appState.locale) + , FormExtra.mdAfter (gettext "If *Project Visibility* is enabled, this value is pre-selected when creating a new project. If *Project Visibility* is disabled, this value is used implicitly for new projects." appState.locale) , hr [] [] - , FormGroup.toggle form "questionnaireSharingEnabled" (l_ "form.questionnaireSharing" appState) - , FormExtra.mdAfter (l_ "form.questionnaireSharing.desc" appState) - , FormGroup.richRadioGroup appState (QuestionnaireSharing.richFormOptions appState) form "questionnaireSharingDefaultValue" (l_ "form.questionnaireSharingDefaultValue" appState) - , FormExtra.mdAfter (l_ "form.questionnaireSharingDefaultValue.desc" appState) + , FormGroup.toggle form "questionnaireSharingEnabled" (gettext "Project Sharing" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users can choose if project can be shared with people outside of DSW or not. Otherwise, all projects use the *Default Project Sharing*." appState.locale) + , FormGroup.richRadioGroup appState (QuestionnaireSharing.richFormOptions appState) form "questionnaireSharingDefaultValue" (gettext "Default Project Sharing" appState.locale) + , FormExtra.mdAfter (gettext "If *Project Sharing* is enabled, this value is pre-selected when creating a new project. If *Project Sharing* is disabled, this value is used implicitly for new projects." appState.locale) ] ++ anonymousProjectEnabledInput ++ [ hr [] [] - , FormGroup.richRadioGroup appState (QuestionnaireCreation.richFormOptions appState) form "questionnaireCreation" (l_ "form.questionnaireCreation" appState) + , FormGroup.richRadioGroup appState (QuestionnaireCreation.richFormOptions appState) form "questionnaireCreation" (gettext "Project Creation" appState.locale) , hr [] [] - , FormGroup.toggle form "summaryReport" (l_ "form.summaryReport" appState) - , FormExtra.mdAfter (l_ "form.summaryReport.desc" appState) - , FormGroup.toggle form "feedbackEnabled" (l_ "form.feedback" appState) - , FormExtra.mdAfter (l_ "form.feedback.desc" appState) + , FormGroup.toggle form "summaryReport" (gettext "Summary Report" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users can view a summary report showing various metrics for the questionnaire." appState.locale) + , FormGroup.toggle form "feedbackEnabled" (gettext "Feedback" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users can submit a feedback to questions to the specified GitHub repository." appState.locale) , feedbackInput - , FormGroup.toggle form "projectTaggingEnabled" (l_ "form.projectTaggingEnabled" appState) - , FormExtra.mdAfter (l_ "form.projectTaggingEnabled.desc" appState) + , FormGroup.toggle form "projectTaggingEnabled" (gettext "Project Tagging" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, users can tag their projects and use these tags to filter them." appState.locale) , projectTaggingInput ] ) diff --git a/engine-wizard/elm/Wizard/Settings/Registry/Update.elm b/engine-wizard/elm/Wizard/Settings/Registry/Update.elm index 6b313f8e6..3f7ab9e04 100644 --- a/engine-wizard/elm/Wizard/Settings/Registry/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Registry/Update.elm @@ -5,12 +5,12 @@ module Wizard.Settings.Registry.Update exposing import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Shared.Api.Registry as RegistryApi import Shared.Data.EditableConfig as EditableConfig import Shared.Data.EditableConfig.EditableRegistryConfig as EditableRegistryConfig import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs @@ -100,13 +100,13 @@ handlePostSignupComplete : AppState -> Model -> Result ApiError () -> ( Model, C handlePostSignupComplete appState model result = case result of Ok _ -> - ( { model | registrySigningUp = Success (lg "apiSuccess.registry.signup" appState) } + ( { model | registrySigningUp = Success (gettext "You have signed up for the Registry, you should receive a confirmation email soon." appState.locale) } , Cmd.none ) Err error -> ( { model - | registrySigningUp = ApiError.toActionResult appState (lg "apiError.registry.signup.postError" appState) error + | registrySigningUp = ApiError.toActionResult appState (gettext "Sign up request failed." appState.locale) error , registrySignupForm = setFormErrors appState error model.registrySignupForm } , getResultCmd result diff --git a/engine-wizard/elm/Wizard/Settings/Registry/View.elm b/engine-wizard/elm/Wizard/Settings/Registry/View.elm index 926d6f3ed..4c71dca43 100644 --- a/engine-wizard/elm/Wizard/Settings/Registry/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Registry/View.elm @@ -2,13 +2,13 @@ module Wizard.Settings.Registry.View exposing (view) import ActionResult import Form exposing (Form) -import Html exposing (Html, button, div, h5) +import Gettext exposing (gettext) +import Html exposing (Html, button, div, h5, text) import Html.Attributes exposing (class, disabled, readonly) import Html.Events exposing (onClick) import Shared.Data.EditableConfig.EditableRegistryConfig exposing (EditableRegistryConfig) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy, wideDetailClass) import Wizard.Common.View.ActionButton as ActionButton @@ -24,16 +24,6 @@ import Wizard.Settings.Registry.Models exposing (Model) import Wizard.Settings.Registry.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Registry.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.Registry.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewForm appState model) model.genericModel.config @@ -42,13 +32,13 @@ view appState model = viewForm : AppState -> Model -> config -> Html Msg viewForm appState model _ = div [ wideDetailClass "" ] - [ Page.header (l_ "title" appState) [] + [ Page.header (gettext "DSW Registry" appState.locale) [] , div [] [ FormResult.errorOnlyView appState model.genericModel.savingConfig , formView appState model.genericModel.form , div [ class "mt-5" ] [ ActionButton.buttonWithAttrs appState - (ActionButton.ButtonWithAttrsConfig (l_ "save" appState) + (ActionButton.ButtonWithAttrsConfig (gettext "Save" appState.locale) model.genericModel.savingConfig (GenericMsg <| GenericMsgs.FormMsg Form.Submit) False @@ -83,11 +73,11 @@ formView appState form = else button [ class "btn btn-outline-primary", onClick <| ToggleRegistrySignup True ] - [ lx_ "form.signUp" appState ] + [ text (gettext "Sign Up" appState.locale) ] in div [ class "nested-group" ] - [ formWrap <| FormGroup.textarea appState form "token" (l_ "form.token" appState) - , FormExtra.mdAfter (l_ "form.token.desc" appState) + [ formWrap <| FormGroup.textarea appState form "token" (gettext "Token" appState.locale) + , FormExtra.mdAfter (gettext "Fill in your DSW Registry token. If you don't have one, you need sign up first." appState.locale) , signupButton ] @@ -95,8 +85,8 @@ formView appState form = emptyNode in div [] - [ formWrap <| FormGroup.toggle form "enabled" (l_ "form.enabled" appState) - , FormExtra.mdAfter (l_ "form.enabled.desc" appState) + [ formWrap <| FormGroup.toggle form "enabled" (gettext "Enabled" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, you can import Knowledge Models and Document Templates directly from [DSW Registry](https://registry.ds-wizard.org)." appState.locale) , tokenInput ] @@ -107,15 +97,15 @@ registrySignupModal appState model = submitButton = if ActionResult.isSuccess model.registrySigningUp then button [ class "btn btn-primary", onClick <| ToggleRegistrySignup False ] - [ lx_ "registryModal.button.done" appState ] + [ text (gettext "Done" appState.locale) ] else if List.length (Form.getErrors model.registrySignupForm) > 0 then button [ class "btn btn-primary", disabled True ] - [ lx_ "registryModal.button.signUp" appState ] + [ text (gettext "Sign Up" appState.locale) ] else ActionButton.button appState - { label = l_ "registryModal.button.signUp" appState + { label = gettext "Sign Up" appState.locale , result = model.registrySigningUp , msg = FormMsg Form.Submit , dangerous = False @@ -127,7 +117,7 @@ registrySignupModal appState model = , class "btn btn-secondary" , disabled <| ActionResult.isLoading model.registrySigningUp ] - [ lx_ "registryModal.button.cancel" appState ] + [ text (gettext "Cancel" appState.locale) ] resultBody resultText = Flash.success appState resultText @@ -144,16 +134,16 @@ registrySignupModal appState model = Html.map FormMsg <| div [] [ FormResult.errorOnlyView appState model.registrySigningUp - , FormGroup.inputAttrs [ readonly True ] appState form "organizationId" (l_ "registryModal.form.organizationId" appState) - , FormGroup.inputAttrs [ readonly True ] appState form "name" (l_ "registryModal.form.organizationName" appState) - , FormGroup.textareaAttrs [ readonly True ] appState form "description" (l_ "registryModal.form.organizationDescription" appState) - , FormGroup.input appState form "email" (l_ "registryModal.form.email" appState) - , FormExtra.textAfter (l_ "registryModal.form.email.desc" appState) + , FormGroup.inputAttrs [ readonly True ] appState form "organizationId" (gettext "Organization ID" appState.locale) + , FormGroup.inputAttrs [ readonly True ] appState form "name" (gettext "Organization Name" appState.locale) + , FormGroup.textareaAttrs [ readonly True ] appState form "description" (gettext "Organization Description" appState.locale) + , FormGroup.input appState form "email" (gettext "Email" appState.locale) + , FormExtra.textAfter (gettext "The email will be used for a confirmation link and an eventual token recovery." appState.locale) ] content = [ div [ class "modal-header" ] - [ h5 [ class "modal-title" ] [ lx_ "registryModal.title" appState ] + [ h5 [ class "modal-title" ] [ text (gettext "Registry Sign Up" appState.locale) ] ] , div [ class "modal-body" ] [ body diff --git a/engine-wizard/elm/Wizard/Settings/Submission/Update.elm b/engine-wizard/elm/Wizard/Settings/Submission/Update.elm index 62e21ff1b..90d4f64ea 100644 --- a/engine-wizard/elm/Wizard/Settings/Submission/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Submission/Update.elm @@ -3,10 +3,10 @@ module Wizard.Settings.Submission.Update exposing , update ) +import Gettext exposing (gettext) import Shared.Api.Templates as TemplatesApi import Shared.Data.EditableConfig as EditableConfig import Shared.Data.EditableConfig.EditableSubmissionConfig as EditableSubmissionConfig exposing (EditableSubmissionConfig) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setTemplates) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -37,7 +37,7 @@ update wrapMsg msg appState model = GetTemplatesCompleted result -> applyResult appState { setResult = setTemplates - , defaultError = lg "apiError.templates.getListError" appState + , defaultError = gettext "Unable to get document templates." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Settings/Submission/View.elm b/engine-wizard/elm/Wizard/Settings/Submission/View.elm index 7cda46b84..507184cf8 100644 --- a/engine-wizard/elm/Wizard/Settings/Submission/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Submission/View.elm @@ -2,7 +2,8 @@ module Wizard.Settings.Submission.View exposing (view) import Form exposing (Form) import Form.Input as Input -import Html exposing (Html, a, button, div, label, p, strong) +import Gettext exposing (gettext) +import Html exposing (Html, a, button, div, label, p, strong, text) import Html.Attributes exposing (class, placeholder) import Html.Events exposing (onClick) import List.Extra as List @@ -10,7 +11,6 @@ import Shared.Data.EditableConfig.EditableSubmissionConfig exposing (EditableSub import Shared.Data.TemplateSuggestion as TemplateSuggestion exposing (TemplateSuggestion) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (getOrganizationAndItemId, httpMethodOptions) import Uuid @@ -25,16 +25,6 @@ import Wizard.Settings.Submission.Models exposing (Model) import Wizard.Settings.Submission.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Submission.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.Submission.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewConfig appState model) model.templates @@ -47,8 +37,8 @@ viewConfig appState model templates = viewProps : List TemplateSuggestion -> GenericView.ViewProps EditableSubmissionConfig Msg viewProps templates = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Document Submission" + , locSave = gettext "Save" , formView = formView templates , wrapMsg = GenericMsg << GenericMsgs.FormMsg } @@ -62,15 +52,15 @@ formView templates appState form = servicesInput = if enabled then - FormGroup.list appState (serviceFormView appState templates) form "services" (l_ "form.services" appState) + FormGroup.list appState (serviceFormView appState templates) form "services" (gettext "Services" appState.locale) else emptyNode in Html.map (GenericMsg << GenericMsgs.FormMsg) <| div [] - [ FormGroup.toggle form "enabled" (l_ "form.enabled" appState) - , FormExtra.mdAfter (l_ "form.enabled.desc" appState) + [ FormGroup.toggle form "enabled" (gettext "Enabled" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, you can configure external services for uploading documents from the instance." appState.locale) , servicesInput ] @@ -103,24 +93,24 @@ serviceFormView appState templates form i = [ div [ class "card-body" ] [ div [ class "row" ] [ div [ class "col" ] - [ FormGroup.input appState form idField (l_ "form.id" appState) ] + [ FormGroup.input appState form idField (gettext "ID" appState.locale) ] , div [ class "col text-end" ] [ a [ class "btn btn-danger with-icon", onClick (Form.RemoveItem "services" i) ] [ faSet "_global.delete" appState - , lx_ "form.service.remove" appState + , text (gettext "Remove" appState.locale) ] ] ] - , FormGroup.input appState form nameField (l_ "form.name" appState) - , FormGroup.markdownEditor appState form descriptionField (l_ "form.description" appState) + , FormGroup.input appState form nameField (gettext "Name" appState.locale) + , FormGroup.markdownEditor appState form descriptionField (gettext "Description" appState.locale) , div [ class "input-table" ] - [ label [] [ lx_ "form.supportedFormats" appState ] - , p [ class "text-muted" ] [ lx_ "form.supportedFormats.desc" appState ] + [ label [] [ text (gettext "Supported Formats" appState.locale) ] + , p [ class "text-muted" ] [ text (gettext "Select document templates and formats that can be submitted using this submission service." appState.locale) ] , FormGroup.list appState (supportedFormatFormView appState templates supportedFormatsField) form supportedFormatsField "" ] , div [ class "input-table" ] - [ label [] [ lx_ "form.props" appState ] - , Markdown.toHtml [ class "text-muted text-justify" ] (l_ "form.props.desc" appState) + [ label [] [ text (gettext "User Properties" appState.locale) ] + , Markdown.toHtml [ class "text-muted text-justify" ] (gettext "You can create properties that can be set by each user in their profile. Then, you can use these properties in the request settings. For example, if you want each user to use their own authorization token, you can create a property called `Token` and use it in request headers as `${Token}`. Users will be able to set the token in their profile settings." appState.locale) , FormGroup.list appState (propFormView appState propsField) form propsField "" ] , requestFormView appState form requestField @@ -144,10 +134,10 @@ supportedFormatFormView appState templates prefix form index = Form.getFieldAsString (field "formatUuid") form ( templateIdError, templateIdErrorClass ) = - FormGroup.getErrors appState templateIdField (l_ "form.template" appState) + FormGroup.getErrors appState templateIdField (gettext "Document Template" appState.locale) ( formatUuidError, formatUuidErrorClass ) = - FormGroup.getErrors appState formatUuidField (l_ "form.format" appState) + FormGroup.getErrors appState formatUuidField (gettext "Format" appState.locale) defaultOption = ( "", "--" ) @@ -225,20 +215,20 @@ requestFormView appState form prefix = field "multipart.fileName" in div [ class "nested-group" ] - [ FormGroup.input appState form multipartFileName (l_ "form.multipartFileName" appState) + [ FormGroup.input appState form multipartFileName (gettext "Multipart File Name" appState.locale) ] else emptyNode in div [] - [ strong [] [ lx_ "form.request" appState ] + [ strong [] [ text (gettext "Request" appState.locale) ] , div [ class "nested-group mt-2" ] - [ FormGroup.select appState httpMethodOptions form methodField (l_ "form.method" appState) - , FormGroup.input appState form urlField (l_ "form.url" appState) - , FormGroup.list appState (headerFormView appState headersField) form headersField (l_ "form.headers" appState) - , FormGroup.toggle form multipartEnabledField (l_ "form.multipart" appState) - , FormExtra.mdAfter (l_ "form.multipart.desc" appState) + [ FormGroup.select appState httpMethodOptions form methodField (gettext "Method" appState.locale) + , FormGroup.input appState form urlField (gettext "URL" appState.locale) + , FormGroup.list appState (headerFormView appState headersField) form headersField (gettext "Headers" appState.locale) + , FormGroup.toggle form multipartEnabledField (gettext "Multipart" appState.locale) + , FormExtra.mdAfter (gettext "If enabled, file will be sent using multipart request. Otherwise, it will be directly in the request body." appState.locale) , multipartFileNameInput ] ] @@ -257,14 +247,14 @@ headerFormView appState prefix form index = Form.getFieldAsString (field "value") form ( headerError, headerErrorClass ) = - FormGroup.getErrors appState headerField (l_ "form.header" appState) + FormGroup.getErrors appState headerField (gettext "Header" appState.locale) ( valueError, valueErrorClass ) = - FormGroup.getErrors appState valueField (l_ "form.value" appState) + FormGroup.getErrors appState valueField (gettext "Value" appState.locale) in div [ class "input-group mb-2" ] - [ Input.textInput headerField [ placeholder (l_ "form.header" appState), class "form-control", class headerErrorClass ] - , Input.textInput valueField [ placeholder (l_ "form.value" appState), class "form-control", class valueErrorClass ] + [ Input.textInput headerField [ placeholder (gettext "Header" appState.locale), class "form-control", class headerErrorClass ] + , Input.textInput valueField [ placeholder (gettext "Value" appState.locale), class "form-control", class valueErrorClass ] , button [ class "btn btn-link text-danger", onClick (Form.RemoveItem prefix index) ] [ faSet "_global.delete" appState ] , headerError diff --git a/engine-wizard/elm/Wizard/Settings/Template/Update.elm b/engine-wizard/elm/Wizard/Settings/Template/Update.elm index 2c8431b19..43a7575e9 100644 --- a/engine-wizard/elm/Wizard/Settings/Template/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Template/Update.elm @@ -3,10 +3,10 @@ module Wizard.Settings.Template.Update exposing , update ) +import Gettext exposing (gettext) import Shared.Api.Templates as TemplatesApi import Shared.Data.BootstrapConfig.TemplateConfig as TemplateConfig import Shared.Data.EditableConfig as EditableConfig -import Shared.Locale exposing (lg) import Shared.Setters exposing (setTemplates) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -43,7 +43,7 @@ update wrapMsg msg appState model = GetTemplatesComplete result -> applyResult appState { setResult = setTemplates - , defaultError = lg "apiError.templates.getListError" appState + , defaultError = gettext "Unable to get document templates." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Settings/Template/View.elm b/engine-wizard/elm/Wizard/Settings/Template/View.elm index 5f008fab9..6524de9a0 100644 --- a/engine-wizard/elm/Wizard/Settings/Template/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Template/View.elm @@ -2,12 +2,12 @@ module Wizard.Settings.Template.View exposing (view) import Form exposing (Form) import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, div, label, text) import Html.Attributes exposing (class) import Shared.Data.BootstrapConfig.TemplateConfig exposing (TemplateConfig) import Shared.Data.TemplateSuggestion as TemplateSuggestion exposing (TemplateSuggestion) import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l) import Shared.Utils exposing (getOrganizationAndItemId) import Version import Wizard.Common.AppState exposing (AppState) @@ -18,11 +18,6 @@ import Wizard.Settings.Template.Models exposing (Model) import Wizard.Settings.Template.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Template.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewContent appState model) model.templates @@ -35,8 +30,8 @@ viewContent appState model templates = viewProps : List TemplateSuggestion -> GenericView.ViewProps TemplateConfig Msg viewProps templates = - { locTitle = l_ "title" - , locSave = l_ "save" + { locTitle = gettext "Document Templates" + , locSave = gettext "Save" , formView = formView templates , wrapMsg = GenericMsg << GenericMsgs.FormMsg } @@ -68,7 +63,7 @@ formView templates appState form = in Html.map (GenericMsg << GenericMsgs.FormMsg) <| div [ class "form-group" ] - [ label [] [ text (l_ "form.recommendedTemplateId" appState) ] + [ label [] [ text (gettext "Recommended Template" appState.locale) ] , div [ class "input-group" ] [ Input.selectInput templateOptions recommendedTemplateField [ class "form-control" ] , Input.selectInput templateVersionOptions recommendedTemplateIdField [ class "form-control" ] diff --git a/engine-wizard/elm/Wizard/Settings/Usage/Update.elm b/engine-wizard/elm/Wizard/Settings/Usage/Update.elm index c307e2408..672b59cee 100644 --- a/engine-wizard/elm/Wizard/Settings/Usage/Update.elm +++ b/engine-wizard/elm/Wizard/Settings/Usage/Update.elm @@ -1,7 +1,7 @@ module Wizard.Settings.Usage.Update exposing (fetchData, update) +import Gettext exposing (gettext) import Shared.Api.Usage as UsageApi -import Shared.Locale exposing (lg) import Shared.Setters exposing (setUsage) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -21,7 +21,7 @@ update msg appState model = GetUsageComplete result -> applyResult appState { setResult = setUsage - , defaultError = lg "apiError.usage.getError" appState + , defaultError = gettext "Unable to get usage." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Settings/Usage/View.elm b/engine-wizard/elm/Wizard/Settings/Usage/View.elm index 0eb1ef07a..36b729abe 100644 --- a/engine-wizard/elm/Wizard/Settings/Usage/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Usage/View.elm @@ -1,8 +1,8 @@ module Wizard.Settings.Usage.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div) import Shared.Data.Usage exposing (Usage) -import Shared.Locale exposing (l) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.UsageTable as UsageTable import Wizard.Common.Html.Attribute exposing (wideDetailClass) @@ -11,11 +11,6 @@ import Wizard.Settings.Usage.Models exposing (Model) import Wizard.Settings.Usage.Msgs exposing (Msg) -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.Usage.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewContent appState) model.usage @@ -24,6 +19,6 @@ view appState model = viewContent : AppState -> Usage -> Html Msg viewContent appState usage = div [ wideDetailClass "Usage" ] - [ Page.header (l_ "title" appState) [] + [ Page.header (gettext "Usage" appState.locale) [] , UsageTable.view appState usage ] diff --git a/engine-wizard/elm/Wizard/Settings/View.elm b/engine-wizard/elm/Wizard/Settings/View.elm index b20e1f422..bbad0ffdc 100644 --- a/engine-wizard/elm/Wizard/Settings/View.elm +++ b/engine-wizard/elm/Wizard/Settings/View.elm @@ -1,8 +1,8 @@ module Wizard.Settings.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, div, strong, text) import Html.Attributes exposing (class, classList) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Routes as Routes @@ -23,16 +23,6 @@ import Wizard.Settings.Template.View import Wizard.Settings.Usage.View -l_ : String -> AppState -> String -l_ = - l "Wizard.Settings.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Settings.View" - - view : Route -> AppState -> Model -> Html Msg view route appState model = let @@ -96,16 +86,16 @@ navigation : AppState -> Route -> Html Msg navigation appState currentRoute = let systemTitle = - [ strong [] [ lx_ "navigation.title.system" appState ] ] + [ strong [] [ text (gettext "System Settings" appState.locale) ] ] userInterfaceTitle = - [ strong [] [ lx_ "navigation.title.userInterface" appState ] ] + [ strong [] [ text (gettext "User Interface Settings" appState.locale) ] ] contentTitle = - [ strong [] [ lx_ "navigation.title.content" appState ] ] + [ strong [] [ text (gettext "Content Settings" appState.locale) ] ] statisticsTitle = - [ strong [] [ lx_ "navigation.title.info" appState ] ] + [ strong [] [ text (gettext "Info" appState.locale) ] ] in div [ class "nav nav-pills flex-column" ] (systemTitle @@ -121,26 +111,26 @@ navigation appState currentRoute = navigationSystemLinks : AppState -> List ( Route, String ) navigationSystemLinks appState = - [ ( OrganizationRoute, l_ "navigation.organization" appState ) - , ( AuthenticationRoute, l_ "navigation.authentication" appState ) - , ( PrivacyAndSupportRoute, l_ "navigation.privacyAndSupport" appState ) + [ ( OrganizationRoute, gettext "Organization" appState.locale ) + , ( AuthenticationRoute, gettext "Authentication" appState.locale ) + , ( PrivacyAndSupportRoute, gettext "Privacy & Support" appState.locale ) ] navigationUserInterfaceLinks : AppState -> List ( Route, String ) navigationUserInterfaceLinks appState = - [ ( DashboardRoute, l_ "navigation.dashboard" appState ) - , ( LookAndFeelRoute, l_ "navigation.lookAndFeel" appState ) + [ ( DashboardRoute, gettext "Dashboard" appState.locale ) + , ( LookAndFeelRoute, gettext "Look & Feel" appState.locale ) ] navigationContentLinks : AppState -> List ( Route, String ) navigationContentLinks appState = - [ ( RegistryRoute, l_ "navigation.registry" appState ) - , ( KnowledgeModelsRoute, l_ "navigation.knowledgeModels" appState ) - , ( ProjectsRoute, l_ "navigation.projects" appState ) - , ( SubmissionRoute, l_ "navigation.submission" appState ) - , ( TemplateRoute, l_ "navigation.template" appState ) + [ ( RegistryRoute, gettext "DSW Registry" appState.locale ) + , ( KnowledgeModelsRoute, gettext "Knowledge Models" appState.locale ) + , ( ProjectsRoute, gettext "Projects" appState.locale ) + , ( SubmissionRoute, gettext "Document Submission" appState.locale ) + , ( TemplateRoute, gettext "Document Templates" appState.locale ) ] @@ -148,11 +138,11 @@ navigationStatisticsLinks : AppState -> List ( Route, String ) navigationStatisticsLinks appState = let items = - [ ( UsageRoute, l_ "navigation.usage" appState ) + [ ( UsageRoute, gettext "Usage" appState.locale ) ] in if appState.config.cloud.enabled then - ( PlansRoute, l_ "navigation.plans" appState ) :: items + ( PlansRoute, gettext "Plans" appState.locale ) :: items else items diff --git a/engine-wizard/elm/Wizard/Templates/Detail/Update.elm b/engine-wizard/elm/Wizard/Templates/Detail/Update.elm index ea926dbec..129d0b35e 100644 --- a/engine-wizard/elm/Wizard/Templates/Detail/Update.elm +++ b/engine-wizard/elm/Wizard/Templates/Detail/Update.elm @@ -4,9 +4,9 @@ module Wizard.Templates.Detail.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Templates as TemplatesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Setters exposing (setTemplate) import Wizard.Common.Api exposing (applyResult, getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -29,7 +29,7 @@ update msg wrapMsg appState model = GetTemplateCompleted result -> applyResult appState { setResult = setTemplate - , defaultError = lg "apiError.templates.getError" appState + , defaultError = gettext "Unable to get the document template." appState.locale , model = model , result = result } @@ -66,6 +66,6 @@ deleteVersionCompleted appState model result = ( model, cmdNavigate appState Routes.templatesIndex ) Err error -> - ( { model | deletingVersion = ApiError.toActionResult appState (lg "apiError.templates.deleteError" appState) error } + ( { model | deletingVersion = ApiError.toActionResult appState (gettext "Document template could not be deleted." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/Templates/Detail/View.elm b/engine-wizard/elm/Wizard/Templates/Detail/View.elm index 1c36c7019..4fcf74c95 100644 --- a/engine-wizard/elm/Wizard/Templates/Detail/View.elm +++ b/engine-wizard/elm/Wizard/Templates/Detail/View.elm @@ -1,5 +1,6 @@ module Wizard.Templates.Detail.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, a, div, li, p, strong, text, ul) import Html.Attributes exposing (class, href, target) import Html.Events exposing (onClick) @@ -9,9 +10,9 @@ import Shared.Data.Template.TemplatePackage as TemplatePackage import Shared.Data.Template.TemplateState as TemplateState import Shared.Data.TemplateDetail as TemplateDetail exposing (TemplateDetail) import Shared.Html exposing (emptyNode, fa, faSet) -import Shared.Locale exposing (l, lg, lh, lx) import Shared.Markdown as Markdown import Shared.Utils exposing (listFilterJust, listInsertIf) +import String.Format as String import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.DetailPage as DetailPage @@ -26,21 +27,6 @@ import Wizard.Templates.Detail.Models exposing (Model) import Wizard.Templates.Detail.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Templates.Detail.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Templates.Detail.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Templates.Detail.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (viewPackage appState model) model.template @@ -62,7 +48,7 @@ header appState template = exportAction = a [ onClick (ExportTemplate template) ] [ faSet "_global.export" appState - , lx_ "header.export" appState + , text (gettext "Export" appState.locale) ] exportActionVisible = @@ -71,7 +57,7 @@ header appState template = deleteAction = a [ onClick <| ShowDeleteDialog True, class "text-danger with-icon" ] [ faSet "_global.delete" appState - , lx_ "header.delete" appState + , text (gettext "Delete" appState.locale) ] deleteActionVisible = @@ -95,7 +81,7 @@ readme appState template = if containsNewerVersions then div [ class "alert alert-warning" ] [ faSet "_global.warning" appState - , lx_ "readme.versionWarning" appState + , text (gettext "This is not the latest available version of this document template." appState.locale) ] else @@ -122,7 +108,7 @@ newVersionInRegistryWarning appState template = [ linkTo appState (Routes.templatesImport (Just latestPackageId)) [ class "btn btn-primary btn-sm with-icon ms-2" ] - [ faSet "kmImport.fromRegistry" appState, lx_ "registryVersion.warning.import" appState ] + [ faSet "kmImport.fromRegistry" appState, text (gettext "Import" appState.locale) ] ] else @@ -130,9 +116,9 @@ newVersionInRegistryWarning appState template = in div [ class "alert alert-warning" ] (faSet "_global.warning" appState - :: lh_ "registryVersion.warning" + :: String.formatHtml + (gettext "There is a newer version (%s) available." appState.locale) [ strong [] [ text (Version.toString remoteLatestVersion) ] ] - appState ++ link ) @@ -153,13 +139,13 @@ unsupportedMetamodelVersionWarning appState template = template.organizationId ++ ":" ++ template.templateId ++ ":" ++ Version.toString remoteLatestVersion in text " " - :: lh_ "registryVersion.warning" + :: String.formatHtml + (gettext "There is a newer version (%s) available." appState.locale) [ strong [] [ text (Version.toString remoteLatestVersion) ] ] - appState ++ [ linkTo appState (Routes.templatesImport (Just latestPackageId)) [ class "btn btn-primary btn-sm with-icon ms-2" ] - [ faSet "kmImport.fromRegistry" appState, lx_ "registryVersion.warning.import" appState ] + [ faSet "kmImport.fromRegistry" appState, text (gettext "Import" appState.locale) ] ] else @@ -170,7 +156,7 @@ unsupportedMetamodelVersionWarning appState template = in div [ class "alert alert-danger" ] ([ faSet "_global.warning" appState - , lx_ "readme.unsupportedMetamodelVersion" appState + , text (gettext "This document template is not supported in this version of DSW." appState.locale) ] ++ link ) @@ -199,13 +185,13 @@ sidePanelKmInfo : AppState -> TemplateDetail -> Maybe ( String, String, Html msg sidePanelKmInfo appState template = let templateInfoList = - [ ( lg "template.id" appState, "id", text template.id ) - , ( lg "template.version" appState, "version", text <| Version.toString template.version ) - , ( lg "template.metamodel" appState, "metamodel", text <| String.fromInt template.metamodelVersion ) - , ( lg "template.license" appState, "license", text template.license ) + [ ( gettext "ID" appState.locale, "id", text template.id ) + , ( gettext "Version" appState.locale, "version", text <| Version.toString template.version ) + , ( gettext "Metamodel" appState.locale, "metamodel", text <| String.fromInt template.metamodelVersion ) + , ( gettext "License" appState.locale, "license", text template.license ) ] in - Just ( lg "template" appState, "template", DetailPage.sidePanelList 4 8 templateInfoList ) + Just ( gettext "Document Template" appState.locale, "template", DetailPage.sidePanelList 4 8 templateInfoList ) sidePanelFormats : AppState -> TemplateDetail -> Maybe ( String, String, Html msg ) @@ -220,7 +206,7 @@ sidePanelFormats appState template = |> List.map formatView in if List.length formats > 0 then - Just ( lg "template.formats" appState, "formats", ul [ class "format-list" ] formats ) + Just ( gettext "Formats" appState.locale, "formats", ul [ class "format-list" ] formats ) else Nothing @@ -245,7 +231,7 @@ sidePanelOtherVersions appState template = |> List.map versionLink in if List.length versionLinks > 0 then - Just ( lg "template.otherVersions" appState, "other-versions", ul [] versionLinks ) + Just ( gettext "Other versions" appState.locale, "other-versions", ul [] versionLinks ) else Nothing @@ -253,18 +239,18 @@ sidePanelOtherVersions appState template = sidePanelOrganizationInfo : AppState -> TemplateDetail -> Maybe ( String, String, Html msg ) sidePanelOrganizationInfo appState template = - Maybe.map (\organization -> ( lg "template.publishedBy" appState, "published-by", viewOrganization organization )) template.organization + Maybe.map (\organization -> ( gettext "Published by" appState.locale, "published-by", viewOrganization organization )) template.organization sidePanelRegistryLink : AppState -> TemplateDetail -> Maybe ( String, String, Html msg ) sidePanelRegistryLink appState template = let toRegistryLink registryLink = - ( lg "template.registryLink" appState + ( gettext "Registry link" appState.locale , "registry-link" , a [ href registryLink, target "_blank", class "with-icon" ] [ faSet "kmDetail.registryLink" appState - , lx_ "registryLinkLabel" appState + , text (gettext "View in registry" appState.locale) ] ) in @@ -288,7 +274,7 @@ sidePanelUsableWith appState template = |> List.map packageLink in if List.length packageLinks > 0 then - Just ( lg "template.usableWith" appState, "usable-with", ul [] packageLinks ) + Just ( gettext "Usable with" appState.locale, "usable-with", ul [] packageLinks ) else Nothing @@ -306,15 +292,18 @@ deleteVersionModal appState model template = let modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text template.id ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s?" appState.locale) + [ strong [] [ text template.id ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete version" appState.locale , modalContent = modalContent , visible = model.showDeleteDialog , actionResult = model.deletingVersion - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteVersion , cancelMsg = Just <| ShowDeleteDialog False , dangerous = True diff --git a/engine-wizard/elm/Wizard/Templates/Import/FileImport/Update.elm b/engine-wizard/elm/Wizard/Templates/Import/FileImport/Update.elm index 25b9e6a35..dc6c8dcd0 100644 --- a/engine-wizard/elm/Wizard/Templates/Import/FileImport/Update.elm +++ b/engine-wizard/elm/Wizard/Templates/Import/FileImport/Update.elm @@ -2,10 +2,10 @@ module Wizard.Templates.Import.FileImport.Update exposing (update) import ActionResult exposing (ActionResult(..)) import File +import Gettext exposing (gettext) import Json.Decode exposing (decodeValue) import Shared.Api.Templates as TemplatesApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs @@ -68,6 +68,6 @@ importTemplateCompleted appState model result = ( model, cmdNavigate appState Routes.templatesIndex ) Err error -> - ( { model | importing = ApiError.toActionResult appState (lg "apiError.templates.importError" appState) error } + ( { model | importing = ApiError.toActionResult appState (gettext "Importing the document template failed." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/Templates/Import/FileImport/View.elm b/engine-wizard/elm/Wizard/Templates/Import/FileImport/View.elm index aab6d69bf..e392b902b 100644 --- a/engine-wizard/elm/Wizard/Templates/Import/FileImport/View.elm +++ b/engine-wizard/elm/Wizard/Templates/Import/FileImport/View.elm @@ -2,12 +2,12 @@ module Wizard.Templates.Import.FileImport.View exposing (view) import ActionResult exposing (ActionResult(..)) import File +import Gettext exposing (gettext) import Html exposing (Attribute, Html, button, div, input, label, p, text) import Html.Attributes exposing (class, disabled, id, type_) import Html.Events exposing (custom, on, onClick) import Json.Decode as Decode import Shared.Html exposing (faSet) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy) import Wizard.Common.View.ActionButton as ActionButton @@ -16,16 +16,6 @@ import Wizard.Templates.Import.FileImport.Models exposing (Model, dropzoneId, fi import Wizard.Templates.Import.FileImport.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Templates.Import.FileImport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Templates.Import.FileImport.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -62,8 +52,8 @@ fileView appState model fileName = ] , div [ class "actions" ] [ button [ disabled cancelDisabled, onClick Cancel, class "btn btn-secondary" ] - [ lx_ "fileView.cancel" appState ] - , ActionButton.button appState <| ActionButton.ButtonConfig (l_ "fileView.upload" appState) model.importing Submit False + [ text (gettext "Cancel" appState.locale) ] + , ActionButton.button appState <| ActionButton.ButtonConfig (gettext "Upload" appState.locale) model.importing Submit False ] ] @@ -72,10 +62,10 @@ dropzone : AppState -> Model -> Html Msg dropzone appState model = div (dropzoneAttributes model) [ label [ class "btn btn-secondary btn-file" ] - [ lx_ "dropzone.choose" appState + [ text (gettext "Choose a file" appState.locale) , input [ id fileInputId, type_ "file", on "change" (Decode.succeed FileSelected) ] [] ] - , p [] [ lx_ "dropzone.drop" appState ] + , p [] [ text (gettext "Or just drop it here" appState.locale) ] ] diff --git a/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/Update.elm b/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/Update.elm index 2061b8b35..808d690d8 100644 --- a/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/Update.elm +++ b/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/Update.elm @@ -1,8 +1,8 @@ module Wizard.Templates.Import.RegistryImport.Update exposing (update) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Templates as TemplatesApi -import Shared.Locale exposing (lg) import Shared.Setters exposing (setPulling) import Wizard.Common.Api exposing (applyResult) import Wizard.Common.AppState exposing (AppState) @@ -29,7 +29,7 @@ update msg wrapMsg appState model = PullTemplateCompleted result -> applyResult appState { setResult = setPulling - , defaultError = lg "apiError.templates.pullError" appState + , defaultError = gettext "Unable to import the document template." appState.locale , model = model , result = result } diff --git a/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/View.elm b/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/View.elm index b548351f1..7fd3ddc47 100644 --- a/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/View.elm +++ b/engine-wizard/elm/Wizard/Templates/Import/RegistryImport/View.elm @@ -1,12 +1,13 @@ module Wizard.Templates.Import.RegistryImport.View exposing (view) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Html exposing (Html, a, code, div, h1, hr, input, p, text) import Html.Attributes exposing (class, href, placeholder, target, type_, value) import Html.Events exposing (onInput, onSubmit) import Shared.Data.BootstrapConfig.RegistryConfig exposing (RegistryConfig(..)) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lh, lx) +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html exposing (linkTo) import Wizard.Common.Html.Attribute exposing (dataCy) @@ -17,21 +18,6 @@ import Wizard.Templates.Import.RegistryImport.Models exposing (Model) import Wizard.Templates.Import.RegistryImport.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Templates.Import.RegistryImport.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Templates.Import.RegistryImport.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Templates.Import.RegistryImport.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -58,11 +44,11 @@ viewForm appState model = , type_ "text" , value model.templateId , class "form-control" - , placeholder <| lg "template.templateId" appState + , placeholder <| gettext "Document Template ID" appState.locale ] [] , ActionButton.submit appState - { label = l_ "form.import" appState + { label = gettext "Import" appState.locale , result = model.pulling } ] @@ -77,10 +63,10 @@ viewRegistryText appState = case appState.config.registry of RegistryEnabled url -> p [] - (lh_ "registryLink" - [ a [ href url, target "_blank" ] [ lx_ "registry" appState ] + (String.formatHtml + (gettext "You can find document templates in %s." appState.locale) + [ a [ href url, target "_blank" ] [ text (gettext "DSW Registry" appState.locale) ] ] - appState ) _ -> @@ -92,11 +78,14 @@ viewImported appState packageId = div [ class "px-4 py-5 bg-light rounded-3" ] [ h1 [] [ faSet "_global.success" appState ] , p [ class "lead" ] - (lh_ "imported.message" [ code [] [ text packageId ] ] appState) + (String.formatHtml + (gettext "Document template %s has been imported!" appState.locale) + [ code [] [ text packageId ] ] + ) , p [ class "lead" ] [ linkTo appState (Routes.templatesDetail packageId) [ class "btn btn-primary" ] - [ lx_ "imported.action" appState ] + [ text (gettext "View detail" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/Templates/Import/View.elm b/engine-wizard/elm/Wizard/Templates/Import/View.elm index 620971d2b..60fabb1a2 100644 --- a/engine-wizard/elm/Wizard/Templates/Import/View.elm +++ b/engine-wizard/elm/Wizard/Templates/Import/View.elm @@ -1,11 +1,11 @@ module Wizard.Templates.Import.View exposing (view) -import Html exposing (Html, a, div, li, ul) +import Gettext exposing (gettext) +import Html exposing (Html, a, div, li, text, ul) import Html.Attributes exposing (class, classList) import Html.Events exposing (onClick) import Shared.Data.BootstrapConfig.RegistryConfig exposing (RegistryConfig(..)) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lx) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy, detailClass) import Wizard.Common.View.Page as Page @@ -15,16 +15,6 @@ import Wizard.Templates.Import.Msgs exposing (Msg(..)) import Wizard.Templates.Import.RegistryImport.View as RegistryImportView -l_ : String -> AppState -> String -l_ = - l "Wizard.Templates.Import.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Templates.Import.View" - - view : AppState -> Model -> Html Msg view appState model = let @@ -51,7 +41,7 @@ view appState model = emptyNode in div [ detailClass "KnowledgeModels__Import" ] - [ Page.header (l_ "header" appState) [] + [ Page.header (gettext "Import Document Template" appState.locale) [] , navbar , content ] @@ -68,7 +58,7 @@ viewNavbar appState registryActive = , dataCy "template_import_nav_registry" ] [ faSet "kmImport.fromRegistry" appState - , lx_ "navbar.fromRegistry" appState + , text (gettext "From DSW Registry" appState.locale) ] ] , li [ class "nav-item" ] @@ -79,7 +69,7 @@ viewNavbar appState registryActive = , dataCy "template_import_nav_file" ] [ faSet "kmImport.fromFile" appState - , lx_ "navbar.fromFile" appState + , text (gettext "From file" appState.locale) ] ] ] diff --git a/engine-wizard/elm/Wizard/Templates/Index/Update.elm b/engine-wizard/elm/Wizard/Templates/Index/Update.elm index f71ae6a6a..4e64820c9 100644 --- a/engine-wizard/elm/Wizard/Templates/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Templates/Index/Update.elm @@ -4,10 +4,10 @@ module Wizard.Templates.Index.Update exposing ) import ActionResult exposing (ActionResult(..)) +import Gettext exposing (gettext) import Shared.Api.Templates as TemplatesApi import Shared.Data.Template exposing (Template) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.Models as Listing @@ -68,7 +68,7 @@ deletePackageCompleted appState model result = ) Err error -> - ( { model | deletingTemplate = ApiError.toActionResult appState (lg "apiError.templates.deleteError" appState) error } + ( { model | deletingTemplate = ApiError.toActionResult appState (gettext "Document template could not be deleted." appState.locale) error } , getResultCmd result ) @@ -91,7 +91,7 @@ handleListingMsg wrapMsg appState listingMsg model = listingUpdateConfig : (Msg -> Wizard.Msgs.Msg) -> AppState -> Listing.UpdateConfig Template listingUpdateConfig wrapMsg appState = { getRequest = TemplatesApi.getTemplates - , getError = lg "apiError.templates.getListError" appState + , getError = gettext "Unable to get document templates." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.TemplatesRoute << IndexRoute } diff --git a/engine-wizard/elm/Wizard/Templates/Index/View.elm b/engine-wizard/elm/Wizard/Templates/Index/View.elm index 307effeb7..6c03a80d6 100644 --- a/engine-wizard/elm/Wizard/Templates/Index/View.elm +++ b/engine-wizard/elm/Wizard/Templates/Index/View.elm @@ -1,13 +1,14 @@ module Wizard.Templates.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, code, div, img, p, span, strong, text) import Html.Attributes exposing (class, src, title) import Shared.Components.Badge as Badge import Shared.Data.Template exposing (Template) import Shared.Data.Template.TemplateState as TemplateState import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lh, lx) import Shared.Utils exposing (listInsertIf) +import String.Format as String import Version import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.View as Listing exposing (ListingActionType(..), ListingDropdownItem, ViewConfig) @@ -23,25 +24,10 @@ import Wizard.Templates.Index.Msgs exposing (Msg(..)) import Wizard.Templates.Routes exposing (Route(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Templates.Index.View" - - -lh_ : String -> List (Html msg) -> AppState -> List (Html msg) -lh_ = - lh "Wizard.Templates.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Templates.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "KnowledgeModels__Index" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Document Templates" appState.locale) [] , FormResult.successOnlyView appState model.deletingTemplate , Listing.view appState (listingConfig appState) model.templates , deleteModal appState model @@ -55,7 +41,7 @@ importButton appState = (Routes.templatesImport Nothing) [ class "btn btn-primary with-icon" ] [ faSet "kms.upload" appState - , lx_ "header.import" appState + , text (gettext "Import" appState.locale) ] else @@ -69,7 +55,7 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = .name - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Import\" button to import a new document template." appState.locale , updated = Just { getTime = .createdAt @@ -77,9 +63,9 @@ listingConfig appState = } , wrapMsg = ListingMsg , iconView = Nothing - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search..." appState.locale) , sortOptions = - [ ( "name", lg "template.name" appState ) + [ ( "name", gettext "Name" appState.locale ) ] , filters = [] , toRoute = \_ -> Routes.TemplatesRoute << IndexRoute @@ -92,7 +78,7 @@ listingTitle appState template = span [] [ linkTo appState (Routes.templatesDetail template.id) [] [ text template.name ] , Badge.light - (tooltip (lg "package.latestVersion" appState)) + (tooltip (gettext "Latest version" appState.locale)) [ text <| Version.toString template.version ] , listingTitleOutdatedBadge appState template , listingTitleUnsupportedBadge appState template @@ -109,7 +95,7 @@ listingTitleOutdatedBadge appState template = linkTo appState (Routes.templatesImport templateId) [ class Badge.warningClass ] - [ lx_ "badge.outdated" appState ] + [ text (gettext "update available" appState.locale) ] else emptyNode @@ -118,7 +104,7 @@ listingTitleOutdatedBadge appState template = listingTitleUnsupportedBadge : AppState -> Template -> Html Msg listingTitleUnsupportedBadge appState template = if template.state == TemplateState.UnsupportedMetamodelVersion then - Badge.danger [] [ lx_ "badge.unsupported" appState ] + Badge.danger [] [ text (gettext "unsupported metamodel" appState.locale) ] else emptyNode @@ -139,7 +125,7 @@ listingDescription appState template = Nothing -> emptyNode in - span [ class "fragment", title <| lg "package.publishedBy" appState ] + span [ class "fragment", title <| gettext "Published by" appState.locale ] [ logo , text organization.name ] @@ -161,7 +147,7 @@ listingActions appState template = Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.view" appState - , label = l_ "action.viewDetail" appState + , label = gettext "View detail" appState.locale , msg = ListingActionLink (Routes.templatesDetail template.id) , dataCy = "view" } @@ -173,7 +159,7 @@ listingActions appState template = Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.export" appState - , label = l_ "action.export" appState + , label = gettext "Export" appState.locale , msg = ListingActionMsg (ExportTemplate template) , dataCy = "export" } @@ -185,7 +171,7 @@ listingActions appState template = Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg <| ShowHideDeleteTemplate <| Just template , dataCy = "delete" } @@ -213,15 +199,18 @@ deleteModal appState model = modalContent = [ p [] - (lh_ "deleteModal.message" [ strong [] [ text templateName ] ] appState) + (String.formatHtml + (gettext "Are you sure you want to permanently delete %s and all its versions?" appState.locale) + [ strong [] [ text templateName ] ] + ) ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete document template" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingTemplate - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteTemplate , cancelMsg = Just <| ShowHideDeleteTemplate Nothing , dangerous = True diff --git a/engine-wizard/elm/Wizard/Users/Create/Update.elm b/engine-wizard/elm/Wizard/Users/Create/Update.elm index 9d37081fa..2b6d64789 100644 --- a/engine-wizard/elm/Wizard/Users/Create/Update.elm +++ b/engine-wizard/elm/Wizard/Users/Create/Update.elm @@ -2,10 +2,10 @@ module Wizard.Users.Create.Update exposing (update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Random exposing (Seed, step) import Shared.Api.Users as UsersApi import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Shared.Utils exposing (tuplePrepend) import Uuid import Wizard.Common.Api exposing (getResultCmd) @@ -60,6 +60,6 @@ postUserCompleted appState model result = ( model, cmdNavigate appState Routes.usersIndex ) Err error -> - ( { model | savingUser = ApiError.toActionResult appState (lg "apiError.users.postError" appState) error } + ( { model | savingUser = ApiError.toActionResult appState (gettext "User could not be created." appState.locale) error } , getResultCmd result ) diff --git a/engine-wizard/elm/Wizard/Users/Create/View.elm b/engine-wizard/elm/Wizard/Users/Create/View.elm index beadd2c30..f67146fde 100644 --- a/engine-wizard/elm/Wizard/Users/Create/View.elm +++ b/engine-wizard/elm/Wizard/Users/Create/View.elm @@ -1,11 +1,11 @@ module Wizard.Users.Create.View exposing (view) import Form exposing (Form) +import Gettext exposing (gettext) import Html exposing (Html, div) import Html.Events exposing (onSubmit) import Shared.Auth.Role as Role import Shared.Form.FormError exposing (FormError) -import Shared.Locale exposing (l, lg) import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (detailClass) import Wizard.Common.View.ActionButton as ActionButton @@ -19,30 +19,25 @@ import Wizard.Users.Create.Models exposing (Model) import Wizard.Users.Create.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Users.Create.View" - - view : AppState -> Model -> Html Msg view appState model = Html.form [ onSubmit (FormMsg Form.Submit), detailClass "Users__Create" ] - [ Page.header (l_ "header.title" appState) [] + [ Page.header (gettext "Create user" appState.locale) [] , FormResult.view appState model.savingUser , formView appState model.form |> Html.map FormMsg , FormActions.viewSubmit appState Routes.usersIndex - (ActionButton.SubmitConfig (l_ "header.save" appState) model.savingUser) + (ActionButton.SubmitConfig (gettext "Save" appState.locale) model.savingUser) ] formView : AppState -> Form FormError UserCreateForm -> Html Form.Msg formView appState form = div [] - [ FormGroup.input appState form "email" <| lg "user.email" appState - , FormGroup.input appState form "firstName" <| lg "user.firstName" appState - , FormGroup.input appState form "lastName" <| lg "user.lastName" appState - , FormGroup.inputWithTypehints appState.config.organization.affiliations appState form "affiliation" <| lg "user.affiliation" appState - , FormGroup.select appState (Role.options appState) form "role" <| lg "user.role" appState - , FormGroup.passwordWithStrength appState form "password" <| lg "user.password" appState + [ FormGroup.input appState form "email" <| gettext "Email" appState.locale + , FormGroup.input appState form "firstName" <| gettext "First name" appState.locale + , FormGroup.input appState form "lastName" <| gettext "Last name" appState.locale + , FormGroup.inputWithTypehints appState.config.organization.affiliations appState form "affiliation" <| gettext "Affiliation" appState.locale + , FormGroup.select appState (Role.options appState) form "role" <| gettext "Role" appState.locale + , FormGroup.passwordWithStrength appState form "password" <| gettext "Password" appState.locale ] diff --git a/engine-wizard/elm/Wizard/Users/Edit/Update.elm b/engine-wizard/elm/Wizard/Users/Edit/Update.elm index 4ddc1ee5b..403fa5cdb 100644 --- a/engine-wizard/elm/Wizard/Users/Edit/Update.elm +++ b/engine-wizard/elm/Wizard/Users/Edit/Update.elm @@ -2,12 +2,12 @@ module Wizard.Users.Edit.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) import Form +import Gettext exposing (gettext) import Result exposing (Result) import Shared.Api.Users as UsersApi import Shared.Data.User exposing (User) import Shared.Error.ApiError as ApiError exposing (ApiError) import Shared.Form exposing (setFormErrors) -import Shared.Locale exposing (lg) import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) import Wizard.Msgs @@ -80,7 +80,7 @@ getUserCompleted appState model result = { model | userForm = userForm, user = Success user } Err _ -> - { model | user = Error <| lg "apiError.users.getError" appState } + { model | user = Error <| gettext "Unable to get the user." appState.locale } cmd = getResultCmd result @@ -114,13 +114,13 @@ putUserCompleted : AppState -> Model -> Result ApiError () -> ( Model, Cmd Wizar putUserCompleted appState model result = case result of Ok _ -> - ( { model | savingUser = Success <| lg "apiSuccess.users.put" appState } + ( { model | savingUser = Success <| gettext "Profile was successfully updated." appState.locale } , Ports.scrollToTop ".Users__Edit__content" ) Err err -> ( { model - | savingUser = ApiError.toActionResult appState (lg "apiError.users.putError" appState) err + | savingUser = ApiError.toActionResult appState (gettext "Profile could not be saved." appState.locale) err , userForm = setFormErrors appState err model.userForm } , Cmd.batch @@ -136,10 +136,10 @@ putUserPasswordCompleted appState model result = passwordResult = case result of Ok _ -> - Success <| lg "apiSuccess.users.password.put" appState + Success <| gettext "Password was successfully changed." appState.locale Err error -> - ApiError.toActionResult appState (lg "apiError.users.password.putError" appState) error + ApiError.toActionResult appState (gettext "Password could not be changed." appState.locale) error cmd = getResultCmd result diff --git a/engine-wizard/elm/Wizard/Users/Edit/View.elm b/engine-wizard/elm/Wizard/Users/Edit/View.elm index 688c76c5f..d73f36a5d 100644 --- a/engine-wizard/elm/Wizard/Users/Edit/View.elm +++ b/engine-wizard/elm/Wizard/Users/Edit/View.elm @@ -2,6 +2,7 @@ module Wizard.Users.Edit.View exposing (view) import Form exposing (Form) import Form.Input as Input +import Gettext exposing (gettext) import Html exposing (Html, a, div, h4, img, p, strong, text) import Html.Attributes exposing (class, classList, src) import Html.Events exposing (onClick, onSubmit) @@ -9,8 +10,8 @@ import Shared.Auth.Role as Role import Shared.Data.User as User exposing (User) import Shared.Form.FormError exposing (FormError) import Shared.Html exposing (emptyNode) -import Shared.Locale exposing (l, lf, lg, lx) import Shared.Markdown as Markdown +import String.Format as String import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Html.Attribute exposing (dataCy, detailClass, wideDetailClass) import Wizard.Common.View.ActionButton as ActionButton @@ -25,21 +26,6 @@ import Wizard.Users.Edit.Models exposing (Model, View(..)) import Wizard.Users.Edit.Msgs exposing (Msg(..)) -l_ : String -> AppState -> String -l_ = - l "Wizard.Users.Edit.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Users.Edit.View" - - -lf_ : String -> List String -> AppState -> String -lf_ = - lf "Wizard.Users.Edit.View" - - view : AppState -> Model -> Html Msg view appState model = Page.actionResultView appState (profileView appState model) model.user @@ -66,7 +52,7 @@ navigation appState model = , onClick <| ChangeView Profile , dataCy "user_nav_profile" ] - [ lx_ "navbar.profile" appState + [ text (gettext "Profile" appState.locale) ] , a [ class "nav-link" @@ -74,7 +60,7 @@ navigation appState model = , onClick <| ChangeView Password , dataCy "user_nav_password" ] - [ lx_ "navbar.password" appState + [ text (gettext "Password" appState.locale) ] ] @@ -86,21 +72,21 @@ userView appState model user = else div [ wideDetailClass "" ] - [ Page.header (l_ "navbar.profile" appState) [] + [ Page.header (gettext "Profile" appState.locale) [] , div [ class "row" ] [ Html.form [ onSubmit (EditFormMsg Form.Submit), class "col-8" ] [ FormResult.view appState model.savingUser , userFormView appState user model.userForm (model.uuid == "current") |> Html.map EditFormMsg , div [ class "mt-5" ] - [ ActionButton.submit appState (ActionButton.SubmitConfig (l_ "userView.save" appState) model.savingUser) ] + [ ActionButton.submit appState (ActionButton.SubmitConfig (gettext "Save" appState.locale) model.savingUser) ] ] , div [ class "col-4" ] [ div [ class "col-user-image" ] - [ strong [] [ lx_ "userView.userImage" appState ] + [ strong [] [ text (gettext "User Image" appState.locale) ] , div [] [ img [ src (User.imageUrl user), class "user-icon user-icon-large" ] [] ] - , Markdown.toHtml [ class "text-muted" ] (l_ "userView.userImage.desc" appState) + , Markdown.toHtml [ class "text-muted" ] (gettext "Image is taken from OpenID profile or [Gravatar](https://gravatar.com)." appState.locale) ] ] ] @@ -115,14 +101,14 @@ userFormView appState user form current = emptyNode else - FormGroup.select appState (Role.options appState) form "role" <| lg "user.role" appState + FormGroup.select appState (Role.options appState) form "role" <| gettext "Role" appState.locale activeToggle = if current then emptyNode else - FormGroup.toggle form "active" <| lg "user.active" appState + FormGroup.toggle form "active" <| gettext "Active" appState.locale submissionPropsIndexes = Form.getListIndexes "submissionProps" form @@ -130,7 +116,7 @@ userFormView appState user form current = submissionSettings = if current && appState.config.submission.enabled && List.length submissionPropsIndexes > 0 then div [ class "mt-5" ] - (h4 [] [ lx_ "submissionSettings.title" appState ] + (h4 [] [ text (gettext "Submission Settings" appState.locale) ] :: List.map submissionSettingsSection submissionPropsIndexes ) @@ -154,7 +140,7 @@ userFormView appState user form current = (List.map (submissionSettingsSectionProp (field "values")) valueIndexes) else - p [ class "text-muted" ] [ text <| lf_ "submissionSettings.empty" [ sectionName ] appState ] + p [ class "text-muted" ] [ text <| String.format (gettext "There is no settings for %s." appState.locale) [ sectionName ] ] in div [ class "mb-4" ] [ strong [] [ text sectionName ] @@ -178,11 +164,11 @@ userFormView appState user form current = ] in div [] - [ FormGroup.input appState form "email" <| lg "user.email" appState + [ FormGroup.input appState form "email" <| gettext "Email" appState.locale , FormExtra.blockAfter (List.map (ExternalLoginButton.badgeWrapper appState) user.sources) - , FormGroup.input appState form "firstName" <| lg "user.firstName" appState - , FormGroup.input appState form "lastName" <| lg "user.lastName" appState - , FormGroup.inputWithTypehints appState.config.organization.affiliations appState form "affiliation" <| lg "user.affiliation" appState + , FormGroup.input appState form "firstName" <| gettext "First name" appState.locale + , FormGroup.input appState form "lastName" <| gettext "Last name" appState.locale + , FormGroup.inputWithTypehints appState.config.organization.affiliations appState form "affiliation" <| gettext "Affiliation" appState.locale , roleSelect , activeToggle , submissionSettings @@ -196,17 +182,17 @@ passwordView appState model = else Html.form [ onSubmit (PasswordFormMsg Form.Submit), detailClass "" ] - [ Page.header (l_ "navbar.password" appState) [] + [ Page.header (gettext "Password" appState.locale) [] , FormResult.view appState model.savingPassword , passwordFormView appState model.passwordForm |> Html.map PasswordFormMsg , div [ class "mt-5" ] - [ ActionButton.submit appState (ActionButton.SubmitConfig (l_ "passwordView.save" appState) model.savingPassword) ] + [ ActionButton.submit appState (ActionButton.SubmitConfig (gettext "Save" appState.locale) model.savingPassword) ] ] passwordFormView : AppState -> Form FormError UserPasswordForm -> Html Form.Msg passwordFormView appState form = div [] - [ FormGroup.passwordWithStrength appState form "password" <| l_ "passwordForm.password" appState - , FormGroup.password appState form "passwordConfirmation" <| l_ "passwordForm.passwordConfirmation" appState + [ FormGroup.passwordWithStrength appState form "password" <| gettext "New password" appState.locale + , FormGroup.password appState form "passwordConfirmation" <| gettext "New password again" appState.locale ] diff --git a/engine-wizard/elm/Wizard/Users/Index/Update.elm b/engine-wizard/elm/Wizard/Users/Index/Update.elm index f6e261ab3..87da0bcf1 100644 --- a/engine-wizard/elm/Wizard/Users/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Users/Index/Update.elm @@ -2,10 +2,10 @@ module Wizard.Users.Index.Update exposing (fetchData, update) import ActionResult exposing (ActionResult(..)) import Dict +import Gettext exposing (gettext) import Shared.Api.Users as UsersApi import Shared.Data.User exposing (User) import Shared.Error.ApiError as ApiError exposing (ApiError) -import Shared.Locale exposing (lg) import Uuid import Wizard.Common.Api exposing (getResultCmd) import Wizard.Common.AppState exposing (AppState) @@ -63,7 +63,7 @@ deleteUserCompleted appState model result = ) Err error -> - ( { model | deletingUser = ApiError.toActionResult appState (lg "apiError.users.deleteError" appState) error } + ( { model | deletingUser = ApiError.toActionResult appState (gettext "User could not be deleted." appState.locale) error } , getResultCmd result ) @@ -86,7 +86,7 @@ listingUpdateConfig wrapMsg appState model = Dict.get indexRouteRoleFilterId model.users.filters.values in { getRequest = UsersApi.getUsers { role = role } - , getError = lg "apiError.users.getListError" appState + , getError = gettext "Unable to get users." appState.locale , wrapMsg = wrapMsg << ListingMsg , toRoute = Routes.usersIndexWithFilters model.users.filters } diff --git a/engine-wizard/elm/Wizard/Users/Index/View.elm b/engine-wizard/elm/Wizard/Users/Index/View.elm index eb751bc0f..149047ef2 100644 --- a/engine-wizard/elm/Wizard/Users/Index/View.elm +++ b/engine-wizard/elm/Wizard/Users/Index/View.elm @@ -1,12 +1,12 @@ module Wizard.Users.Index.View exposing (view) +import Gettext exposing (gettext) import Html exposing (Html, a, div, img, p, span, strong, text) import Html.Attributes exposing (class, href, src) import Shared.Auth.Role as Role import Shared.Components.Badge as Badge import Shared.Data.User as User exposing (User) import Shared.Html exposing (emptyNode, faSet) -import Shared.Locale exposing (l, lg, lx) import Uuid import Wizard.Common.AppState exposing (AppState) import Wizard.Common.Components.Listing.View as Listing exposing (ListingActionType(..), ListingDropdownItem, ViewConfig) @@ -23,20 +23,10 @@ import Wizard.Users.Index.Msgs exposing (Msg(..)) import Wizard.Users.Routes exposing (indexRouteRoleFilterId) -l_ : String -> AppState -> String -l_ = - l "Wizard.Users.Index.View" - - -lx_ : String -> AppState -> Html msg -lx_ = - lx "Wizard.Users.Index.View" - - view : AppState -> Model -> Html Msg view appState model = div [ listClass "Users__Index" ] - [ Page.header (lg "users" appState) [] + [ Page.header (gettext "Users" appState.locale) [] , FormResult.successOnlyView appState model.deletingUser , Listing.view appState (listingConfig appState) model.users , deleteModal appState model @@ -50,7 +40,7 @@ createButton appState = [ class "btn btn-primary" , dataCy "users_create-button" ] - [ lx_ "header.create" appState ] + [ text (gettext "Create" appState.locale) ] listingConfig : AppState -> ViewConfig User Msg @@ -60,17 +50,17 @@ listingConfig appState = , itemAdditionalData = always Nothing , dropdownItems = listingActions appState , textTitle = User.fullName - , emptyText = l_ "listing.empty" appState + , emptyText = gettext "Click \"Create\" button to add a new User." appState.locale , updated = Nothing , wrapMsg = ListingMsg , iconView = Just UserIcon.viewUser - , searchPlaceholderText = Just (l_ "listing.searchPlaceholderText" appState) + , searchPlaceholderText = Just (gettext "Search users..." appState.locale) , sortOptions = - [ ( "firstName", lg "user.firstName" appState ) - , ( "lastName", lg "user.lastName" appState ) - , ( "email", lg "user.email" appState ) - , ( "createdAt", lg "user.createdAt" appState ) - , ( "lastVisitedAt", lg "user.lastVisitedAt" appState ) + [ ( "firstName", gettext "First name" appState.locale ) + , ( "lastName", gettext "Last name" appState.locale ) + , ( "email", gettext "Email" appState.locale ) + , ( "createdAt", gettext "Created" appState.locale ) + , ( "lastVisitedAt", gettext "Last online" appState.locale ) ] , filters = [ Listing.SimpleFilter indexRouteRoleFilterId @@ -99,7 +89,7 @@ listingTitleBadge appState user = emptyNode else - Badge.danger [] [ lx_ "badge.inactive" appState ] + Badge.danger [] [ text (gettext "inactive" appState.locale) ] in span [] [ roleBadge appState user @@ -153,7 +143,7 @@ listingActions appState user = [ Listing.dropdownAction { extraClass = Nothing , icon = faSet "_global.edit" appState - , label = l_ "action.edit" appState + , label = gettext "Edit" appState.locale , msg = ListingActionLink (Routes.usersEdit (Uuid.toString user.uuid)) , dataCy = "edit" } @@ -161,7 +151,7 @@ listingActions appState user = , Listing.dropdownAction { extraClass = Just "text-danger" , icon = faSet "_global.delete" appState - , label = l_ "action.delete" appState + , label = gettext "Delete" appState.locale , msg = ListingActionMsg (ShowHideDeleteUser <| Just user) , dataCy = "delete" } @@ -181,16 +171,16 @@ deleteModal appState model = modalContent = [ p [] - [ lx_ "deleteModal.message" appState ] + [ text (gettext "Are you sure you want to permanently delete the following user?" appState.locale) ] , userHtml ] modalConfig = - { modalTitle = l_ "deleteModal.title" appState + { modalTitle = gettext "Delete user" appState.locale , modalContent = modalContent , visible = visible , actionResult = model.deletingUser - , actionName = l_ "deleteModal.action" appState + , actionName = gettext "Delete" appState.locale , actionMsg = DeleteUser , cancelMsg = Just <| ShowHideDeleteUser Nothing , dangerous = True diff --git a/engine-wizard/elm/Wizard/View.elm b/engine-wizard/elm/Wizard/View.elm index 6aa550dac..7c7631dea 100644 --- a/engine-wizard/elm/Wizard/View.elm +++ b/engine-wizard/elm/Wizard/View.elm @@ -1,8 +1,8 @@ module Wizard.View exposing (view) import Browser exposing (Document) +import Gettext exposing (gettext) import Html exposing (Html) -import Shared.Locale exposing (l) import Shared.Undraw as Undraw import Wizard.Apps.View import Wizard.Common.AppState exposing (AppState) @@ -25,11 +25,6 @@ import Wizard.Templates.View import Wizard.Users.View -l_ : String -> AppState -> String -l_ = - l "Wizard.View" - - view : Model -> Document Msg view model = if not model.appState.valid then @@ -124,8 +119,8 @@ notFoundView : AppState -> Html msg notFoundView appState = Page.illustratedMessage { image = Undraw.pageNotFound - , heading = l_ "notFound.title" appState - , lines = [ l_ "notFound.message" appState ] + , heading = gettext "Not Found" appState.locale + , lines = [ gettext "The page you are looking for was not found." appState.locale ] , cy = "not-found" } @@ -134,7 +129,7 @@ notAllowedView : AppState -> Html msg notAllowedView appState = Page.illustratedMessage { image = Undraw.security - , heading = l_ "notAllowed.title" appState - , lines = [ l_ "notAllowed.message" appState ] + , heading = gettext "Not Allowed" appState.locale + , lines = [ gettext "You don't have a permission to view this page." appState.locale ] , cy = "not-allowed" } diff --git a/engine-wizard/index.js b/engine-wizard/index.js index 6bd873f2d..2f694b505 100644 --- a/engine-wizard/index.js +++ b/engine-wizard/index.js @@ -99,25 +99,30 @@ function getApiUrl(config) { return apiUrl() } -function loadApp(config, provisioning) { +function loadApp(config, locale, provisioning) { setStyles(config, function () { + const flags = { + seed: Math.floor(Math.random() * 0xFFFFFFFF), + session: JSON.parse(localStorage.session || null), + apiUrl: getApiUrl(config), + clientUrl: clientUrl(), + config: config, + provisioning: provisioning, + localProvisioning: localProvisioning(), + navigator: { + pdf: getPdfSupport() + }, + gaEnabled: cookies.getGaEnabled(), + cookieConsent: cookies.getCookieConsent(), + } + + if (Object.keys(locale).length > 0) { + flags.locale = locale + } const app = program.Elm.Wizard.init({ node: document.body, - flags: { - seed: Math.floor(Math.random() * 0xFFFFFFFF), - session: JSON.parse(localStorage.session || null), - apiUrl: getApiUrl(config), - clientUrl: clientUrl(), - config: config, - provisioning: provisioning, - localProvisioning: localProvisioning(), - navigator: { - pdf: getPdfSupport() - }, - gaEnabled: cookies.getGaEnabled(), - cookieConsent: cookies.getCookieConsent() - } + flags: flags, }) registerConsolePorts(app) @@ -143,7 +148,10 @@ window.onload = function () { defaultStyleUrl = style.getAttribute('href') style.remove() - const promises = [axios.get(configUrl())] + const promises = [ + axios.get(configUrl()), + axios.get(apiUrl() + '/configs/locales/' + navigator.language) + ] const hasProvisioning = !!provisioningUrl() if (hasProvisioning) { promises.push(axios.get(provisioningUrl())) @@ -152,8 +160,9 @@ window.onload = function () { axios.all(promises) .then(function (results) { const config = results[0].data - const provisioning = hasProvisioning ? results[1].data : null - loadApp(config, provisioning) + const locale = results[1].data + const provisioning = hasProvisioning ? results[2].data : null + loadApp(config, locale, provisioning) }) .catch(function (err) { const errorCode = err.response ? err.response.status : null diff --git a/package-lock.json b/package-lock.json index 14fc8e5c2..a849712da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "engine-frontend", - "version": "3.15.2", + "version": "3.16.0", "license": "Apache-2.0", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", @@ -14,7 +14,8 @@ "axios-retry": "^3.3.1", "bootstrap": "^5.2.1", "chart.js": "^3.9.1", - "flatpickr": "^4.6.13" + "flatpickr": "^4.6.13", + "po2json": "^1.0.0-beta-3" }, "devDependencies": { "copy-webpack-plugin": "^11.0.0", @@ -2988,9 +2989,6 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, - "optional": true, - "peer": true, "dependencies": { "iconv-lite": "^0.6.2" } @@ -2999,9 +2997,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "optional": true, - "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -3803,6 +3798,35 @@ "assert-plus": "^1.0.0" } }, + "node_modules/gettext-parser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-2.0.0.tgz", + "integrity": "sha512-FDs/7XjNw58ToQwJFO7avZZbPecSYgw8PBYhd0An+4JtZSrSzKhEvTsVV2uqdO7VziWTOGSgLGD5YRPdsCjF7Q==", + "dependencies": { + "encoding": "^0.1.12", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/gettext-to-messageformat": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/gettext-to-messageformat/-/gettext-to-messageformat-0.3.1.tgz", + "integrity": "sha512-UyqIL3Ul4NryU95Wome/qtlcuVIqgEWVIFw0zi7Lv14ACLXfaVDCbrjZ7o+3BZ7u+4NS1mP/2O1eXZoHCoas8g==", + "dependencies": { + "gettext-parser": "^1.4.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/gettext-to-messageformat/node_modules/gettext-parser": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz", + "integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==", + "dependencies": { + "encoding": "^0.1.12", + "safe-buffer": "^5.1.1" + } + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -5260,9 +5284,9 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -6113,6 +6137,35 @@ "node": ">=8" } }, + "node_modules/po2json": { + "version": "1.0.0-beta-3", + "resolved": "https://registry.npmjs.org/po2json/-/po2json-1.0.0-beta-3.tgz", + "integrity": "sha512-taS8y6ZEGzPAs0rygW9CuUPY8C3Zgx6cBy31QXxG2JlWS3fLxj/kuD3cbIfXBg30PuYN7J5oyBa/TIRjyqFFtg==", + "dependencies": { + "commander": "^6.0.0", + "gettext-parser": "2.0.0", + "gettext-to-messageformat": "0.3.1" + }, + "bin": { + "po2json": "bin/po2json" + }, + "engines": { + "node": ">=10.0" + }, + "peerDependencies": { + "commander": "^6.0.0", + "gettext-parser": "2.0.0", + "gettext-to-messageformat": "0.3.1" + } + }, + "node_modules/po2json/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "engines": { + "node": ">= 6" + } + }, "node_modules/postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -7142,7 +7195,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -7161,8 +7213,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sass": { "version": "1.55.0", @@ -11287,9 +11338,6 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, - "optional": true, - "peer": true, "requires": { "iconv-lite": "^0.6.2" }, @@ -11298,9 +11346,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "optional": true, - "peer": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } @@ -11921,6 +11966,34 @@ "assert-plus": "^1.0.0" } }, + "gettext-parser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-2.0.0.tgz", + "integrity": "sha512-FDs/7XjNw58ToQwJFO7avZZbPecSYgw8PBYhd0An+4JtZSrSzKhEvTsVV2uqdO7VziWTOGSgLGD5YRPdsCjF7Q==", + "requires": { + "encoding": "^0.1.12", + "safe-buffer": "^5.1.2" + } + }, + "gettext-to-messageformat": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/gettext-to-messageformat/-/gettext-to-messageformat-0.3.1.tgz", + "integrity": "sha512-UyqIL3Ul4NryU95Wome/qtlcuVIqgEWVIFw0zi7Lv14ACLXfaVDCbrjZ7o+3BZ7u+4NS1mP/2O1eXZoHCoas8g==", + "requires": { + "gettext-parser": "^1.4.0" + }, + "dependencies": { + "gettext-parser": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz", + "integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==", + "requires": { + "encoding": "^0.1.12", + "safe-buffer": "^5.1.1" + } + } + } + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -13028,9 +13101,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -13683,6 +13756,23 @@ "find-up": "^4.0.0" } }, + "po2json": { + "version": "1.0.0-beta-3", + "resolved": "https://registry.npmjs.org/po2json/-/po2json-1.0.0-beta-3.tgz", + "integrity": "sha512-taS8y6ZEGzPAs0rygW9CuUPY8C3Zgx6cBy31QXxG2JlWS3fLxj/kuD3cbIfXBg30PuYN7J5oyBa/TIRjyqFFtg==", + "requires": { + "commander": "^6.0.0", + "gettext-parser": "2.0.0", + "gettext-to-messageformat": "0.3.1" + }, + "dependencies": { + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" + } + } + }, "postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -14410,14 +14500,12 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sass": { "version": "1.55.0", diff --git a/package.json b/package.json index 054176f44..567529518 100644 --- a/package.json +++ b/package.json @@ -11,25 +11,18 @@ "start": "npm run start:wizard", "start:registry": "COMPONENT=registry webpack serve", "start:wizard": "COMPONENT=wizard webpack serve", - "test": "npm run test:elm && npm run test:registry:icon-set && npm run test:registry:locale && npm run test:shared:icon-set && npm run test:shared:locale && npm run test:wizard:icon-set && npm run test:wizard:locale", + "test": "npm run test:elm && npm run test:registry:icon-set && npm run test:registry:locale && npm run test:wizard:icon-set && npm run test:wizard:locale", "test:elm": "elm-test && elm-review", "test:registry": "npm run test:elm && npm run test:registry:icon-set && npm run test:registry:locale", "test:registry:icon-set": "COMPONENT=registry node scripts/test-icon-set.js", "test:registry:locale": "COMPONENT=registry node scripts/test-locale.js", - "test:shared:icon-set": "COMPONENT=shared node scripts/test-locale.js", - "test:shared:locale": "COMPONENT=shared node scripts/test-locale.js", "test:wizard": "npm run test:elm && npm run test:wizard:icon-set && npm run test:wizard:locale", "test:wizard:icon-set": "COMPONENT=wizard node scripts/test-icon-set.js", "test:wizard:locale": "COMPONENT=wizard node scripts/test-locale.js", "review": "elm-review", - "extract-locale": "npm run extract-locale:registry && npm run extract-locale:shared && npm run extract-locale:wizard", - "extract-locale:registry": "mkdir -p locale && COMPONENT=registry node scripts/extract-locale.js", - "extract-locale:shared": "mkdir -p locale && COMPONENT=shared node scripts/extract-locale.js", - "extract-locale:wizard": "mkdir -p locale && COMPONENT=wizard node scripts/extract-locale.js", - "apply-locale": "npm run apply-locale:registry && npm run apply-locale:shared && npm run apply-locale:wizard", - "apply-locale:registry": "COMPONENT=registry node scripts/apply-locale.js", - "apply-locale:shared": "COMPONENT=shared node scripts/apply-locale.js", - "apply-locale:wizard": "COMPONENT=wizard node scripts/apply-locale.js" + "pot": "mkdir -p locale && npm run pot:registry && npm run pot:wizard", + "pot:registry": "COMPONENT=registry node scripts/create-pot-file.js", + "pot:wizard": "COMPONENT=wizard node scripts/create-pot-file.js" }, "devDependencies": { "copy-webpack-plugin": "^11.0.0", @@ -57,6 +50,7 @@ "axios-retry": "^3.3.1", "bootstrap": "^5.2.1", "chart.js": "^3.9.1", - "flatpickr": "^4.6.13" + "flatpickr": "^4.6.13", + "po2json": "^1.0.0-beta-3" } } diff --git a/scripts/apply-locale.js b/scripts/apply-locale.js deleted file mode 100644 index 88db19557..000000000 --- a/scripts/apply-locale.js +++ /dev/null @@ -1,19 +0,0 @@ -const fs = require('fs') -const csv = require('fast-csv') -const utils = require('./utils') - - -const {defaultLocalePath, component} = utils.getComponentData() - -let localeContent = fs.readFileSync(defaultLocalePath, 'utf8') - -fs.createReadStream(`locale/${component}.csv`) - .pipe(csv.parse({headers: true})) - .on('data', (row) => { - const regexp = new RegExp(`\\( "${row.key}", ".*" \\)`, 'g') - const replacement = `( "${row.key}", "${row.value}" )` - localeContent = localeContent.replace(regexp, replacement) - }) - .on('end', (count) => { - fs.writeFileSync(defaultLocalePath, localeContent) - }) diff --git a/scripts/create-pot-file.js b/scripts/create-pot-file.js new file mode 100644 index 000000000..7bec238f1 --- /dev/null +++ b/scripts/create-pot-file.js @@ -0,0 +1,90 @@ +const fs = require('fs') +const glob = require('glob') +const package = require('../package.json') +const utils = require('./utils') + +const {component} = utils.getComponentData() + + +const regexGettext = /[\s+(]gettext "(.*?[^\\])?(\\\\)*"/g +const regexNGettext = /[\s+(]ngettext \( "(.*?[^\\])?(\\\\)*", "(.*?[^\\])?(\\\\)*" \)/g + +const keys = {} + +// npx po2json -f jed cs.po cs.json + +glob(`{engine-${component},engine-shared}/elm/**/*.elm`, (err, files) => { + files.forEach(parseFile) + + const metadata = [ + 'msgid ""', + 'msgstr ""', + `"Project-Id-Version: ${component}-client:${package.version}\\n"`, + `"POT-Creation-Date: ${new Date().toISOString()} \\n"`, + '"Language: en\\n"', + '"Content-Type: text/plain; charset=UTF-8\\n"', + '"Content-Transfer-Encoding: 8bit\\n"', + '"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\\n"', + ].join('\n') + + const keyLines = Object.values(keys).map(keyToString).join('\n\n') + fs.writeFileSync(`locale/${component}.pot`, metadata + '\n\n' + keyLines) +}) + + +function parseFile(file) { + const moduleContent = fs.readFileSync(file, 'utf8') + moduleContent.split('\n').forEach((line, i) => { + let result + while ((result = regexGettext.exec(line)) !== null) { + const msgId = result[1] + if (!keys[msgId]) { + keys[msgId] = { + msgId, + usage: [] + } + } + keys[msgId].usage.push(`${file}:${i + 1}`) + } + + while ((result = regexNGettext.exec(line)) !== null) { + const msgId = result[1] + const msgIdPlural = result[3] + + if (!keys[msgId]) { + keys[msgId] = { + msgId, + msgIdPlural, + usage: [] + } + } + keys[msgId].usage.push(`${file}:${i + 1}`) + } + }) +} + +function keyToString(key) { + const usage = key.usage.map(usageToString) + + if (key.msgIdPlural) { + const lines = [ + ...usage, + `msgid "${key.msgId}"`, + `msgid_plural "${key.msgIdPlural}"`, + `msgstr[0] ""`, + `msgstr[1] ""` + ] + return lines.join('\n') + } + + const lines = [ + ...usage, + `msgid "${key.msgId}"`, + `msgstr ""` + ] + return lines.join('\n') +} + +function usageToString(usage) { + return `#: ${usage}` +} diff --git a/scripts/extract-locale.js b/scripts/extract-locale.js deleted file mode 100644 index e4a5766b4..000000000 --- a/scripts/extract-locale.js +++ /dev/null @@ -1,23 +0,0 @@ -const fs = require('fs') -const csv = require('fast-csv') -const utils = require('./utils') - -const {defaultLocalePath, component} = utils.getComponentData() - - -const csvStream = csv.format({ headers: true }) -csvStream - .pipe(fs.createWriteStream(`locale/${component}.csv`)) - .on('end', () => process.exit()) - - -const localeContent = fs.readFileSync(defaultLocalePath, 'utf8') -const regex = /\( "(.*)", "(.*)" \)/g - -let result -while ((result = regex.exec(localeContent)) !== null) { - csvStream.write({ - key: result[1], - value: result[2] - }) -} diff --git a/scripts/test-locale.js b/scripts/test-locale.js index 8c0664970..b8a703bab 100644 --- a/scripts/test-locale.js +++ b/scripts/test-locale.js @@ -48,7 +48,7 @@ glob(`${componentSource}/**/*.elm`, (err, files) => { function loadLocaleKeys() { const fileContent = fs.readFileSync(defaultLocalePath, 'utf8') const localeKeys = {} - const regex = /\( "(.*)", ".*" \)/g + const regex = /\s*[^(--)],? \( "(.*)", ".*" \)/g let result while ((result = regex.exec(fileContent)) !== null) { diff --git a/vendor/Gettext.elm b/vendor/Gettext.elm new file mode 100644 index 000000000..8b1310ff8 --- /dev/null +++ b/vendor/Gettext.elm @@ -0,0 +1,105 @@ +module Gettext exposing + ( Locale + , defaultLocale + , gettext + , localeDecoder + , ngettext + ) + +import Dict exposing (Dict) +import Gettext.Plural as Plural +import Json.Decode as D exposing (Decoder) +import Json.Decode.Pipeline as D +import List.Extra as List + + +type alias Locale = + { messages : Dict String (List String) + , plural : Plural.PluralAst + } + + +defaultLocale : Locale +defaultLocale = + { messages = Dict.empty + , plural = Plural.defaultPluralAst + } + + +localeDecoder : Decoder Locale +localeDecoder = + let + messagesDecoder = + D.dict + (D.oneOf + [ D.list D.string + , D.succeed [] + ] + ) + + pluralDecoder = + D.string + |> D.andThen + (\str -> + let + mbPluralString = + str + |> (List.last << String.split "plural=") + |> Maybe.andThen (List.head << String.split ";") + in + case mbPluralString of + Just pluralString -> + case Plural.fromString pluralString of + Ok pluralAst -> + D.succeed pluralAst + + Err error -> + D.fail error + + Nothing -> + D.fail "Invalid plural string" + ) + in + D.succeed Locale + |> D.requiredAt [ "locale_data", "messages" ] messagesDecoder + |> D.requiredAt [ "locale_data", "messages", "", "plural_forms" ] pluralDecoder + + +gettext : String -> Locale -> String +gettext msgid locale = + case Maybe.andThen List.head (Dict.get msgid locale.messages) of + Just value -> + if String.isEmpty value then + msgid + + else + value + + Nothing -> + msgid + + +ngettext : ( String, String ) -> Int -> Locale -> String +ngettext ( singular, plural ) n lang = + let + pluralIndex = + Plural.eval lang.plural n + + default = + if n == 1 then + singular + + else + plural + in + case Dict.get singular lang.messages of + Just options -> + case List.getAt pluralIndex options of + Just message -> + message + + Nothing -> + default + + Nothing -> + default diff --git a/vendor/Gettext/Plural.elm b/vendor/Gettext/Plural.elm new file mode 100644 index 000000000..e0665721f --- /dev/null +++ b/vendor/Gettext/Plural.elm @@ -0,0 +1,458 @@ +module Gettext.Plural exposing + ( PluralAst + , defaultPluralAst + , eval + , fromString + ) + +import Char exposing (isDigit) +import List.Extra as List + + +type PluralAst + = Ternary PluralAst PluralAst PluralAst + | OR PluralAst PluralAst + | AND PluralAst PluralAst + | LT PluralAst PluralAst + | LTE PluralAst PluralAst + | GT PluralAst PluralAst + | GTE PluralAst PluralAst + | NEQ PluralAst PluralAst + | EQ PluralAst PluralAst + | MOD PluralAst PluralAst + | VAR + | NUM Int + + +defaultPluralAst : PluralAst +defaultPluralAst = + NEQ VAR (NUM 1) + + +fromString : String -> Result String PluralAst +fromString str = + String.toList str + |> tokenize + |> parse + + +eval : PluralAst -> Int -> Int +eval ast num = + case ast of + VAR -> + num + + NUM x -> + x + + Ternary condition onTrue onFalse -> + case eval condition num of + 0 -> + eval onFalse num + + _ -> + eval onTrue num + + OR left right -> + bool2num ((eval left num /= 0) || (eval right num /= 0)) + + AND left right -> + bool2num ((eval left num /= 0) && (eval right num /= 0)) + + LT left right -> + bool2num (eval left num < eval right num) + + LTE left right -> + bool2num (eval left num <= eval right num) + + GT left right -> + bool2num (eval left num > eval right num) + + GTE left right -> + bool2num (eval left num >= eval right num) + + EQ left right -> + bool2num (eval left num == eval right num) + + NEQ left right -> + bool2num (eval left num /= eval right num) + + MOD left right -> + modBy (eval left num) (eval right num) + + +bool2num : Bool -> Int +bool2num val = + -- C-like (0 = False, >=1 = True) + case val of + True -> + 1 + + False -> + 0 + + +bracketsOk : Int -> List Token -> Bool +bracketsOk openedBrackets tokens = + case ( openedBrackets, tokens ) of + ( 0, [] ) -> + True + + ( _, [] ) -> + False + + ( 0, ClB :: _ ) -> + False + + ( n, OpB :: rest ) -> + bracketsOk (n + 1) rest + + ( n, ClB :: rest ) -> + bracketsOk (n - 1) rest + + ( n, _ :: rest ) -> + bracketsOk n rest + + +unbracket : List Token -> List Token +unbracket tokens = + case tokens of + [] -> + [] + + OpB :: rest -> + case List.reverse rest of + ClB :: restReversed -> + let + inside = + List.reverse restReversed + in + if bracketsOk 0 inside then + unbracket inside + + else + tokens + + _ -> + tokens + + _ -> + tokens + + +priority : Token -> Int +priority token = + case token of + Q -> + 9 + + And -> + 8 + + Or -> + 7 + + Lt -> + 6 + + Lte -> + 6 + + Gt -> + 6 + + Gte -> + 6 + + Eq -> + 6 + + Neq -> + 6 + + Mod -> + 5 + + _ -> + -1 + + +selectPriority : ( Int, Token ) -> ( Int, Token ) -> ( Int, Token ) +selectPriority ( prevPos, prevToken ) ( currPos, currToken ) = + if prevToken == currToken then + -- left-associative case (non-associative should error now?, nothing right-associative?) + ( prevPos, prevToken ) + + else + let + prevPriority = + priority prevToken + + currPriority = + priority currToken + in + if currPriority > prevPriority then + ( currPos, currToken ) + + else + ( prevPos, prevToken ) + + + +-- new has lower priority + + +nextOp : List Token -> Int -> Int -> ( Int, Token ) -> ( Int, Token ) +nextOp tokens actPos openedBrackets ( pos, tok ) = + let + nextPos = + actPos + 1 + in + case tokens of + [] -> + ( pos, tok ) + + OpB :: rest -> + nextOp rest nextPos (openedBrackets + 1) ( pos, tok ) + + ClB :: rest -> + nextOp rest nextPos (openedBrackets - 1) ( pos, tok ) + + actToken :: rest -> + if openedBrackets > 0 then + nextOp rest nextPos openedBrackets ( pos, tok ) + -- in brackets, must skip for later processing + + else + nextOp rest nextPos (openedBrackets - 1) (selectPriority ( pos, tok ) ( actPos, actToken )) + + +nextOpx : List Token -> ( Int, Token ) +nextOpx tokens = + case tokens of + [] -> + ( -1, Col ) + + OpB :: rest -> + nextOp rest 1 1 ( 0, OpB ) + + first :: rest -> + nextOp rest 1 0 ( 0, first ) + + +findTernaryColon : List Token -> Int -> Int -> Int +findTernaryColon tokens actPos openedBrackets = + case ( tokens, openedBrackets ) of + ( [], _ ) -> + actPos + + ( Col :: _, 0 ) -> + actPos + 1 + + ( OpB :: rest, _ ) -> + findTernaryColon rest (actPos + 1) (openedBrackets + 1) + + ( ClB :: rest, _ ) -> + findTernaryColon rest (actPos + 1) (openedBrackets - 1) + + ( _ :: rest, _ ) -> + findTernaryColon rest (actPos + 1) openedBrackets + + +parseTernaryRight : List Token -> Result String ( PluralAst, PluralAst ) +parseTernaryRight tokens = + let + colonPos = + findTernaryColon tokens -1 0 + in + if colonPos < 0 then + Err "Colon for ternary expected but not found" + + else + let + right1 = + parse (List.take colonPos tokens) + + right2 = + parse (List.drop (colonPos + 1) tokens) + in + case ( right1, right2 ) of + ( Err err, _ ) -> + Err err + + ( _, Err err ) -> + Err err + + ( Ok r1, Ok r2 ) -> + Ok ( r1, r2 ) + + +parse : List Token -> Result String PluralAst +parse tokens = + -- recursive algorithm + let + xtokens = + unbracket tokens + in + case xtokens of + [] -> + Err "Invalid expression (reached end when not expected)" + + [ Var ] -> + Ok VAR + + [ Num x ] -> + Ok (NUM x) + + _ -> + case nextOpx xtokens of + ( pos, Q ) -> + let + leftOperand = + parse (List.take pos xtokens) + + rightOperands = + parseTernaryRight (List.drop (pos + 1) xtokens) + in + case ( leftOperand, rightOperands ) of + ( Err _, _ ) -> + -- propagate left error + leftOperand + + ( _, Err err ) -> + -- propagate right error + Err err + + ( Ok left, Ok ( right1, right2 ) ) -> + Ok (Ternary left right1 right2) + + ( pos, binaryOp ) -> + let + leftOperand = + parse (List.take pos xtokens) + + rightOperand = + parse (List.drop (pos + 1) xtokens) + in + case ( leftOperand, rightOperand ) of + ( Err _, _ ) -> + -- propagate left error + leftOperand + + ( _, Err _ ) -> + -- propagate right error + rightOperand + + ( Ok left, Ok right ) -> + case binaryOp of + Or -> + Ok (OR left right) + + And -> + Ok (AND left right) + + Lt -> + Ok (LT left right) + + Lte -> + Ok (LTE left right) + + Gt -> + Ok (GT left right) + + Gte -> + Ok (GTE left right) + + Neq -> + Ok (NEQ left right) + + Eq -> + Ok (EQ left right) + + Mod -> + Ok (MOD left right) + + _ -> + -- Invalid, e.g. Col where it should not be + Err "Invalid expression" + + +type Token + = Var + | Num Int + | Or + | And + | Lt + | Lte + | Gt + | Gte + | Eq + | Neq + | Mod + | Q + | Col + | OpB + | ClB + + +tokenize : List Char -> List Token +tokenize source = + case source of + 'n' :: rest -> + Var :: tokenize rest + + '|' :: '|' :: rest -> + Or :: tokenize rest + + '&' :: '&' :: rest -> + And :: tokenize rest + + '<' :: '=' :: rest -> + Lte :: tokenize rest + + '<' :: rest -> + Lt :: tokenize rest + + '>' :: '=' :: rest -> + Gte :: tokenize rest + + '>' :: rest -> + Gt :: tokenize rest + + '=' :: '=' :: rest -> + Eq :: tokenize rest + + '!' :: '=' :: rest -> + Neq :: tokenize rest + + '%' :: rest -> + Mod :: tokenize rest + + '?' :: rest -> + Q :: tokenize rest + + ':' :: rest -> + Col :: tokenize rest + + '(' :: rest -> + OpB :: tokenize rest + + ')' :: rest -> + ClB :: tokenize rest + + a :: rest -> + if isDigit a then + let + num = + List.takeWhile isDigit source + + afterNum = + List.dropWhile isDigit source + in + Num (Maybe.withDefault 0 (String.toInt (String.fromList num))) :: tokenize afterNum + + else + tokenize rest + + _ -> + [] From d25edeb3896ae7cb2a5c433bf5986dede6991c2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:09:59 +0000 Subject: [PATCH 08/21] Bump jest from 29.0.3 to 29.2.2 in /wizard-style-builder Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.3 to 29.2.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.2.2/packages/jest) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- wizard-style-builder/package-lock.json | 1782 +++++++++++------------- wizard-style-builder/package.json | 2 +- 2 files changed, 848 insertions(+), 936 deletions(-) diff --git a/wizard-style-builder/package-lock.json b/wizard-style-builder/package-lock.json index 5fa14affb..b030f97f5 100644 --- a/wizard-style-builder/package-lock.json +++ b/wizard-style-builder/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "wizard-style-builder", - "version": "3.15.2", + "version": "3.16.0", "license": "Apache-2.0", "dependencies": { "compression": "^1.7.4", @@ -17,7 +17,7 @@ "sass": "^1.55.0" }, "devDependencies": { - "jest": "^29.0.3", + "jest": "^29.2.2", "jest-environment-node-single-context": "^29.0.0", "nodemon": "^2.0.20", "supertest": "^6.2.4" @@ -49,30 +49,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.0.tgz", - "integrity": "sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.0.tgz", + "integrity": "sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.0.tgz", - "integrity": "sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==", + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.6.tgz", + "integrity": "sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helpers": "^7.19.0", - "@babel/parser": "^7.19.0", + "@babel/generator": "^7.19.6", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helpers": "^7.19.4", + "@babel/parser": "^7.19.6", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0", + "@babel/traverse": "^7.19.6", + "@babel/types": "^7.19.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -120,12 +120,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.0.tgz", - "integrity": "sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.0.tgz", + "integrity": "sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==", "dev": true, "dependencies": { - "@babel/types": "^7.19.0", + "@babel/types": "^7.20.0", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -148,14 +148,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz", - "integrity": "sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", + "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.19.0", + "@babel/compat-data": "^7.20.0", "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.20.2", + "browserslist": "^4.21.3", "semver": "^6.3.0" }, "engines": { @@ -221,19 +221,19 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", - "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz", + "integrity": "sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-simple-access": "^7.19.4", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.19.6", + "@babel/types": "^7.19.4" }, "engines": { "node": ">=6.9.0" @@ -249,12 +249,12 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", - "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz", + "integrity": "sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.19.4" }, "engines": { "node": ">=6.9.0" @@ -273,18 +273,18 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", - "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -300,14 +300,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", - "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.0.tgz", + "integrity": "sha512-aGMjYraN0zosCEthoGLdqot1oRsmxVTQRHadsUPz5QM44Zej2PYRz7XiDE7GqnkZnNtLbOuxqoZw42vkU7+XEQ==", "dev": true, "dependencies": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0" }, "engines": { "node": ">=6.9.0" @@ -378,9 +378,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.0.tgz", - "integrity": "sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.0.tgz", + "integrity": "sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -552,12 +552,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", - "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", + "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.19.0" }, "engines": { "node": ">=6.9.0" @@ -581,19 +581,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.0.tgz", - "integrity": "sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.0.tgz", + "integrity": "sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", + "@babel/generator": "^7.20.0", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.19.0", - "@babel/types": "^7.19.0", + "@babel/parser": "^7.20.0", + "@babel/types": "^7.20.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -625,13 +625,13 @@ "dev": true }, "node_modules/@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.0.tgz", + "integrity": "sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { @@ -670,16 +670,16 @@ } }, "node_modules/@jest/console": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.0.3.tgz", - "integrity": "sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.2.1.tgz", + "integrity": "sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", "slash": "^3.0.0" }, "engines": { @@ -687,37 +687,37 @@ } }, "node_modules/@jest/core": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.0.3.tgz", - "integrity": "sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.2.2.tgz", + "integrity": "sha512-susVl8o2KYLcZhhkvSB+b7xX575CX3TmSvxfeDjpRko7KmT89rHkXj6XkDkNpSeFMBzIENw5qIchO9HC9Sem+A==", "dev": true, "dependencies": { - "@jest/console": "^29.0.3", - "@jest/reporters": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/reporters": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.0.0", - "jest-config": "^29.0.3", - "jest-haste-map": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-resolve-dependencies": "^29.0.3", - "jest-runner": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", - "jest-watcher": "^29.0.3", + "jest-changed-files": "^29.2.0", + "jest-config": "^29.2.2", + "jest-haste-map": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-resolve-dependencies": "^29.2.2", + "jest-runner": "^29.2.2", + "jest-runtime": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", + "jest-watcher": "^29.2.2", "micromatch": "^4.0.4", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -734,88 +734,88 @@ } }, "node_modules/@jest/environment": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.0.3.tgz", - "integrity": "sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.2.2.tgz", + "integrity": "sha512-OWn+Vhu0I1yxuGBJEFFekMYc8aGBGrY4rt47SOh/IFaI+D7ZHCk7pKRiSoZ2/Ml7b0Ony3ydmEHRx/tEOC7H1A==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/fake-timers": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", - "jest-mock": "^29.0.3" + "jest-mock": "^29.2.2" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.0.3.tgz", - "integrity": "sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.2.2.tgz", + "integrity": "sha512-zwblIZnrIVt8z/SiEeJ7Q9wKKuB+/GS4yZe9zw7gMqfGf4C5hBLGrVyxu1SzDbVSqyMSlprKl3WL1r80cBNkgg==", "dev": true, "dependencies": { - "expect": "^29.0.3", - "jest-snapshot": "^29.0.3" + "expect": "^29.2.2", + "jest-snapshot": "^29.2.2" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.0.3.tgz", - "integrity": "sha512-i1xUkau7K/63MpdwiRqaxgZOjxYs4f0WMTGJnYwUKubsNRZSeQbLorS7+I4uXVF9KQ5r61BUPAUMZ7Lf66l64Q==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.2.2.tgz", + "integrity": "sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg==", "dev": true, "dependencies": { - "jest-get-type": "^29.0.0" + "jest-get-type": "^29.2.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.0.3.tgz", - "integrity": "sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.2.2.tgz", + "integrity": "sha512-nqaW3y2aSyZDl7zQ7t1XogsxeavNpH6kkdq+EpXncIDvAkjvFD7hmhcIs1nWloengEWUoWqkqSA6MSbf9w6DgA==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@sinonjs/fake-timers": "^9.1.2", "@types/node": "*", - "jest-message-util": "^29.0.3", - "jest-mock": "^29.0.3", - "jest-util": "^29.0.3" + "jest-message-util": "^29.2.1", + "jest-mock": "^29.2.2", + "jest-util": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.0.3.tgz", - "integrity": "sha512-YqGHT65rFY2siPIHHFjuCGUsbzRjdqkwbat+Of6DmYRg5shIXXrLdZoVE/+TJ9O1dsKsFmYhU58JvIbZRU1Z9w==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.2.2.tgz", + "integrity": "sha512-/nt+5YMh65kYcfBhj38B3Hm0Trk4IsuMXNDGKE/swp36yydBWfz3OXkLqkSvoAtPW8IJMSJDFCbTM2oj5SNprw==", "dev": true, "dependencies": { - "@jest/environment": "^29.0.3", - "@jest/expect": "^29.0.3", - "@jest/types": "^29.0.3", - "jest-mock": "^29.0.3" + "@jest/environment": "^29.2.2", + "@jest/expect": "^29.2.2", + "@jest/types": "^29.2.1", + "jest-mock": "^29.2.2" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.0.3.tgz", - "integrity": "sha512-3+QU3d4aiyOWfmk1obDerie4XNCaD5Xo1IlKNde2yGEi02WQD+ZQD0i5Hgqm1e73sMV7kw6pMlCnprtEwEVwxw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.2.2.tgz", + "integrity": "sha512-AzjL2rl2zJC0njIzcooBvjA4sJjvdoq98sDuuNs4aNugtLPSQ+91nysGKRF0uY1to5k0MdGMdOBggUsPqvBcpA==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@jridgewell/trace-mapping": "^0.3.15", "@types/node": "*", "chalk": "^4.0.0", @@ -828,13 +828,12 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", + "jest-worker": "^29.2.1", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", - "terminal-link": "^2.0.0", "v8-to-istanbul": "^9.0.1" }, "engines": { @@ -862,9 +861,9 @@ } }, "node_modules/@jest/source-map": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.0.0.tgz", - "integrity": "sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.2.0.tgz", + "integrity": "sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.15", @@ -876,13 +875,13 @@ } }, "node_modules/@jest/test-result": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.0.3.tgz", - "integrity": "sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.2.1.tgz", + "integrity": "sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA==", "dev": true, "dependencies": { - "@jest/console": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/types": "^29.2.1", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -891,14 +890,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.0.3.tgz", - "integrity": "sha512-Hf4+xYSWZdxTNnhDykr8JBs0yBN/nxOXyUQWfotBUqqy0LF9vzcFB0jm/EDNZCx587znLWTIgxcokW7WeZMobQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.2.2.tgz", + "integrity": "sha512-Cuc1znc1pl4v9REgmmLf0jBd3Y65UXJpioGYtMr/JNpQEIGEzkmHhy6W6DLbSsXeUA13TDzymPv0ZGZ9jH3eIw==", "dev": true, "dependencies": { - "@jest/test-result": "^29.0.3", + "@jest/test-result": "^29.2.1", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", + "jest-haste-map": "^29.2.1", "slash": "^3.0.0" }, "engines": { @@ -906,22 +905,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.0.3.tgz", - "integrity": "sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.2.2.tgz", + "integrity": "sha512-aPe6rrletyuEIt2axxgdtxljmzH8O/nrov4byy6pDw9S8inIrTV+2PnjyP/oFHMSynzGxJ2s6OHowBNMXp/Jzg==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@jridgewell/trace-mapping": "^0.3.15", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-util": "^29.0.3", + "jest-haste-map": "^29.2.1", + "jest-regex-util": "^29.2.0", + "jest-util": "^29.2.1", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -932,9 +931,9 @@ } }, "node_modules/@jest/types": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.0.3.tgz", - "integrity": "sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.2.1.tgz", + "integrity": "sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==", "dev": true, "dependencies": { "@jest/schemas": "^29.0.0", @@ -986,13 +985,13 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", + "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" } }, "node_modules/@sinclair/typebox": { @@ -1052,9 +1051,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", - "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", + "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", "dev": true, "dependencies": { "@babel/types": "^7.3.0" @@ -1100,9 +1099,9 @@ "dev": true }, "node_modules/@types/prettier": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz", - "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==", "dev": true }, "node_modules/@types/stack-utils": { @@ -1222,15 +1221,15 @@ "dev": true }, "node_modules/babel-jest": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.0.3.tgz", - "integrity": "sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.2.2.tgz", + "integrity": "sha512-kkq2QSDIuvpgfoac3WZ1OOcHsQQDU5xYk2Ql7tLdJ8BVAYbefEXal+NfS45Y5LVZA7cxC8KYcQMObpCt1J025w==", "dev": true, "dependencies": { - "@jest/transform": "^29.0.3", + "@jest/transform": "^29.2.2", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.0.2", + "babel-preset-jest": "^29.2.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -1259,9 +1258,9 @@ } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.2.tgz", - "integrity": "sha512-eBr2ynAEFjcebVvu8Ktx580BD1QKCrBG1XwEUTXJe285p9HA/4hOhfWCFRQhTKSyBV0VzjhG7H91Eifz9s29hg==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz", + "integrity": "sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", @@ -1297,12 +1296,12 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.0.2.tgz", - "integrity": "sha512-BeVXp7rH5TK96ofyEnHjznjLMQ2nAeDJ+QzxKnHAAMs0RgrQsCywjAN8m4mOm5Di0pxU//3AoEeJJrerMH5UeA==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz", + "integrity": "sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^29.0.2", + "babel-plugin-jest-hoist": "^29.2.0", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { @@ -1401,9 +1400,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz", - "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==", + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", "dev": true, "funding": [ { @@ -1416,10 +1415,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001370", - "electron-to-chromium": "^1.4.202", + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.5" + "update-browserslist-db": "^1.0.9" }, "bin": { "browserslist": "cli.js" @@ -1482,9 +1481,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001399", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001399.tgz", - "integrity": "sha512-4vQ90tMKS+FkvuVWS5/QY1+d805ODxZiKFzsU8o/RsVJz49ZSRR8EjykLJbqhzdPgadbX6wB538wOzle3JniRA==", + "version": "1.0.30001427", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001427.tgz", + "integrity": "sha512-lfXQ73oB9c8DP5Suxaszm+Ta2sr/4tf8+381GkIm1MLj/YdLf+rEDyDSRCzeltuyTVGm+/s18gdZ0q+Wmp8VsQ==", "dev": true, "funding": [ { @@ -1576,14 +1575,17 @@ "dev": true }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/co": { @@ -1719,13 +1721,10 @@ } }, "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/cookie": { "version": "0.5.0", @@ -1821,9 +1820,9 @@ } }, "node_modules/diff-sequences": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.0.0.tgz", - "integrity": "sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.2.0.tgz", + "integrity": "sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -1835,15 +1834,15 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/electron-to-chromium": { - "version": "1.4.249", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.249.tgz", - "integrity": "sha512-GMCxR3p2HQvIw47A599crTKYZprqihoBL4lDSAUmr7IYekXFK5t/WgEBrGJDCa2HWIZFQEkGuMqPCi05ceYqPQ==", + "version": "1.4.284", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", + "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, "node_modules/emittery": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz", - "integrity": "sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "engines": { "node": ">=12" @@ -1952,16 +1951,16 @@ } }, "node_modules/expect": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.0.3.tgz", - "integrity": "sha512-t8l5DTws3212VbmPL+tBFXhjRHLmctHB0oQbL8eUc6S7NzZtYUhycrFO9mkxA0ZUC6FAWdNi7JchJSkODtcu1Q==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.2.2.tgz", + "integrity": "sha512-hE09QerxZ5wXiOhqkXy5d2G9ar+EqOyifnCXCpMNu+vZ6DG9TJ6CO2c2kPDSLqERTTWrO7OZj8EkYHQqSd78Yw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3" + "@jest/expect-utils": "^29.2.2", + "jest-get-type": "^29.2.0", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -2059,9 +2058,9 @@ "dev": true }, "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { "bser": "2.1.1" @@ -2487,9 +2486,9 @@ } }, "node_modules/is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -2571,9 +2570,9 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", - "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { "@babel/core": "^7.12.3", @@ -2681,15 +2680,15 @@ } }, "node_modules/jest": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.0.3.tgz", - "integrity": "sha512-ElgUtJBLgXM1E8L6K1RW1T96R897YY/3lRYqq9uVcPWtP2AAl/nQ16IYDh/FzQOOQ12VEuLdcPU83mbhG2C3PQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.2.2.tgz", + "integrity": "sha512-r+0zCN9kUqoON6IjDdjbrsWobXM/09Nd45kIPRD8kloaRh1z5ZCMdVsgLXGxmlL7UpAJsvCYOQNO+NjvG/gqiQ==", "dev": true, "dependencies": { - "@jest/core": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/core": "^29.2.2", + "@jest/types": "^29.2.1", "import-local": "^3.0.2", - "jest-cli": "^29.0.3" + "jest-cli": "^29.2.2" }, "bin": { "jest": "bin/jest.js" @@ -2707,9 +2706,9 @@ } }, "node_modules/jest-changed-files": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.0.0.tgz", - "integrity": "sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.2.0.tgz", + "integrity": "sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA==", "dev": true, "dependencies": { "execa": "^5.0.0", @@ -2720,28 +2719,28 @@ } }, "node_modules/jest-circus": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.0.3.tgz", - "integrity": "sha512-QeGzagC6Hw5pP+df1+aoF8+FBSgkPmraC1UdkeunWh0jmrp7wC0Hr6umdUAOELBQmxtKAOMNC3KAdjmCds92Zg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.2.2.tgz", + "integrity": "sha512-upSdWxx+Mh4DV7oueuZndJ1NVdgtTsqM4YgywHEx05UMH5nxxA2Qu9T9T9XVuR021XxqSoaKvSmmpAbjwwwxMw==", "dev": true, "dependencies": { - "@jest/environment": "^29.0.3", - "@jest/expect": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/environment": "^29.2.2", + "@jest/expect": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^0.7.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.0.3", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", + "jest-each": "^29.2.1", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-runtime": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", "p-limit": "^3.1.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -2750,21 +2749,21 @@ } }, "node_modules/jest-cli": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.0.3.tgz", - "integrity": "sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.2.2.tgz", + "integrity": "sha512-R45ygnnb2CQOfd8rTPFR+/fls0d+1zXS6JPYTBBrnLPrhr58SSuPTiA5Tplv8/PXpz4zXR/AYNxmwIj6J6nrvg==", "dev": true, "dependencies": { - "@jest/core": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/core": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-config": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "prompts": "^2.0.1", "yargs": "^17.3.1" }, @@ -2784,31 +2783,31 @@ } }, "node_modules/jest-config": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.0.3.tgz", - "integrity": "sha512-U5qkc82HHVYe3fNu2CRXLN4g761Na26rWKf7CjM8LlZB3In1jadEkZdMwsE37rd9RSPV0NfYaCjHdk/gu3v+Ew==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.2.2.tgz", + "integrity": "sha512-Q0JX54a5g1lP63keRfKR8EuC7n7wwny2HoTRDb8cx78IwQOiaYUVZAdjViY3WcTxpR02rPUpvNVmZ1fkIlZPcw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.0.3", - "@jest/types": "^29.0.3", - "babel-jest": "^29.0.3", + "@jest/test-sequencer": "^29.2.2", + "@jest/types": "^29.2.1", + "babel-jest": "^29.2.2", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.0.3", - "jest-environment-node": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-runner": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-circus": "^29.2.2", + "jest-environment-node": "^29.2.2", + "jest-get-type": "^29.2.0", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-runner": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -2829,24 +2828,24 @@ } }, "node_modules/jest-diff": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.0.3.tgz", - "integrity": "sha512-+X/AIF5G/vX9fWK+Db9bi9BQas7M9oBME7egU7psbn4jlszLFCu0dW63UgeE6cs/GANq4fLaT+8sGHQQ0eCUfg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.2.1.tgz", + "integrity": "sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.0.0", - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "diff-sequences": "^29.2.0", + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-docblock": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.0.0.tgz", - "integrity": "sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.2.0.tgz", + "integrity": "sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==", "dev": true, "dependencies": { "detect-newline": "^3.0.0" @@ -2856,33 +2855,33 @@ } }, "node_modules/jest-each": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.0.3.tgz", - "integrity": "sha512-wILhZfESURHHBNvPMJ0lZlYZrvOQJxAo3wNHi+ycr90V7M+uGR9Gh4+4a/BmaZF0XTyZsk4OiYEf3GJN7Ltqzg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.2.1.tgz", + "integrity": "sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "chalk": "^4.0.0", - "jest-get-type": "^29.0.0", - "jest-util": "^29.0.3", - "pretty-format": "^29.0.3" + "jest-get-type": "^29.2.0", + "jest-util": "^29.2.1", + "pretty-format": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.0.3.tgz", - "integrity": "sha512-cdZqRCnmIlTXC+9vtvmfiY/40Cj6s2T0czXuq1whvQdmpzAnj4sbqVYuZ4zFHk766xTTJ+Ij3uUqkk8KCfXoyg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.2.2.tgz", + "integrity": "sha512-B7qDxQjkIakQf+YyrqV5dICNs7tlCO55WJ4OMSXsqz1lpI/0PmeuXdx2F7eU8rnPbRkUR/fItSSUh0jvE2y/tw==", "dev": true, "dependencies": { - "@jest/environment": "^29.0.3", - "@jest/fake-timers": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/environment": "^29.2.2", + "@jest/fake-timers": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", - "jest-mock": "^29.0.3", - "jest-util": "^29.0.3" + "jest-mock": "^29.2.2", + "jest-util": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -2901,29 +2900,29 @@ } }, "node_modules/jest-get-type": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.0.0.tgz", - "integrity": "sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.2.0.tgz", + "integrity": "sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.0.3.tgz", - "integrity": "sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.2.1.tgz", + "integrity": "sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.0.0", - "jest-util": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-regex-util": "^29.2.0", + "jest-util": "^29.2.1", + "jest-worker": "^29.2.1", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -2935,46 +2934,46 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.0.3.tgz", - "integrity": "sha512-YfW/G63dAuiuQ3QmQlh8hnqLDe25WFY3eQhuc/Ev1AGmkw5zREblTh7TCSKLoheyggu6G9gxO2hY8p9o6xbaRQ==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz", + "integrity": "sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug==", "dev": true, "dependencies": { - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz", - "integrity": "sha512-RsR1+cZ6p1hDV4GSCQTg+9qjeotQCgkaleIKLK7dm+U4V/H2bWedU3RAtLm8+mANzZ7eDV33dMar4pejd7047w==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz", + "integrity": "sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.0.3", - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "jest-diff": "^29.2.1", + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.0.3.tgz", - "integrity": "sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.2.1.tgz", + "integrity": "sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -2983,13 +2982,14 @@ } }, "node_modules/jest-mock": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.0.3.tgz", - "integrity": "sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.2.2.tgz", + "integrity": "sha512-1leySQxNAnivvbcx0sCB37itu8f4OX2S/+gxLAV4Z62shT4r4dTG9tACDywUAEZoLSr36aYUTsVp3WKwWt4PMQ==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", - "@types/node": "*" + "@jest/types": "^29.2.1", + "@types/node": "*", + "jest-util": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3013,26 +3013,26 @@ } }, "node_modules/jest-regex-util": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.0.0.tgz", - "integrity": "sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.2.0.tgz", + "integrity": "sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.0.3.tgz", - "integrity": "sha512-toVkia85Y/BPAjJasTC9zIPY6MmVXQPtrCk8SmiheC4MwVFE/CMFlOtMN6jrwPMC6TtNh8+sTMllasFeu1wMPg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.2.2.tgz", + "integrity": "sha512-3gaLpiC3kr14rJR3w7vWh0CBX2QAhfpfiQTwrFPvVrcHe5VUBtIXaR004aWE/X9B2CFrITOQAp5gxLONGrk6GA==", "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", + "jest-haste-map": "^29.2.1", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "resolve": "^1.20.0", "resolve.exports": "^1.1.0", "slash": "^3.0.0" @@ -3042,43 +3042,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.3.tgz", - "integrity": "sha512-KzuBnXqNvbuCdoJpv8EanbIGObk7vUBNt/PwQPPx2aMhlv/jaXpUJsqWYRpP/0a50faMBY7WFFP8S3/CCzwfDw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.2.tgz", + "integrity": "sha512-wWOmgbkbIC2NmFsq8Lb+3EkHuW5oZfctffTGvwsA4JcJ1IRk8b2tg+hz44f0lngvRTeHvp3Kyix9ACgudHH9aQ==", "dev": true, "dependencies": { - "jest-regex-util": "^29.0.0", - "jest-snapshot": "^29.0.3" + "jest-regex-util": "^29.2.0", + "jest-snapshot": "^29.2.2" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.0.3.tgz", - "integrity": "sha512-Usu6VlTOZlCZoNuh3b2Tv/yzDpKqtiNAetG9t3kJuHfUyVMNW7ipCCJOUojzKkjPoaN7Bl1f7Buu6PE0sGpQxw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.2.2.tgz", + "integrity": "sha512-1CpUxXDrbsfy9Hr9/1zCUUhT813kGGK//58HeIw/t8fa/DmkecEwZSWlb1N/xDKXg3uCFHQp1GCvlSClfImMxg==", "dev": true, "dependencies": { - "@jest/console": "^29.0.3", - "@jest/environment": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/environment": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", - "emittery": "^0.10.2", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.0.0", - "jest-environment-node": "^29.0.3", - "jest-haste-map": "^29.0.3", - "jest-leak-detector": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-resolve": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-util": "^29.0.3", - "jest-watcher": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-docblock": "^29.2.0", + "jest-environment-node": "^29.2.2", + "jest-haste-map": "^29.2.1", + "jest-leak-detector": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-resolve": "^29.2.2", + "jest-runtime": "^29.2.2", + "jest-util": "^29.2.1", + "jest-watcher": "^29.2.2", + "jest-worker": "^29.2.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -3087,31 +3087,31 @@ } }, "node_modules/jest-runtime": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.0.3.tgz", - "integrity": "sha512-12gZXRQ7ozEeEHKTY45a+YLqzNDR/x4c//X6AqwKwKJPpWM8FY4vwn4VQJOcLRS3Nd1fWwgP7LU4SoynhuUMHQ==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.0.3", - "@jest/fake-timers": "^29.0.3", - "@jest/globals": "^29.0.3", - "@jest/source-map": "^29.0.0", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.2.2.tgz", + "integrity": "sha512-TpR1V6zRdLynckKDIQaY41od4o0xWL+KOPUCZvJK2bu5P1UXhjobt5nJ2ICNeIxgyj9NGkO0aWgDqYPVhDNKjA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.2.2", + "@jest/fake-timers": "^29.2.2", + "@jest/globals": "^29.2.2", + "@jest/source-map": "^29.2.0", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-mock": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", + "jest-haste-map": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-mock": "^29.2.2", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -3120,9 +3120,9 @@ } }, "node_modules/jest-snapshot": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.0.3.tgz", - "integrity": "sha512-52q6JChm04U3deq+mkQ7R/7uy7YyfVIrebMi6ZkBoDJ85yEjm/sJwdr1P0LOIEHmpyLlXrxy3QP0Zf5J2kj0ew==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.2.2.tgz", + "integrity": "sha512-GfKJrpZ5SMqhli3NJ+mOspDqtZfJBryGA8RIBxF+G+WbDoC7HCqKaeAss4Z/Sab6bAW11ffasx8/vGsj83jyjA==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", @@ -3131,23 +3131,23 @@ "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/expect-utils": "^29.2.2", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/babel__traverse": "^7.0.6", "@types/prettier": "^2.1.5", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.0.3", + "expect": "^29.2.2", "graceful-fs": "^4.2.9", - "jest-diff": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-haste-map": "^29.0.3", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", + "jest-diff": "^29.2.1", + "jest-get-type": "^29.2.0", + "jest-haste-map": "^29.2.1", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", "natural-compare": "^1.4.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "semver": "^7.3.5" }, "engines": { @@ -3155,9 +3155,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3170,12 +3170,12 @@ } }, "node_modules/jest-util": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.0.3.tgz", - "integrity": "sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.2.1.tgz", + "integrity": "sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -3187,17 +3187,17 @@ } }, "node_modules/jest-validate": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.0.3.tgz", - "integrity": "sha512-OebiqqT6lK8cbMPtrSoS3aZP4juID762lZvpf1u+smZnwTEBCBInan0GAIIhv36MxGaJvmq5uJm7dl5gVt+Zrw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.2.2.tgz", + "integrity": "sha512-eJXATaKaSnOuxNfs8CLHgdABFgUrd0TtWS8QckiJ4L/QVDF4KVbZFBBOwCBZHOS0Rc5fOxqngXeGXE3nGQkpQA==", "dev": true, "dependencies": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.0.0", + "jest-get-type": "^29.2.0", "leven": "^3.1.0", - "pretty-format": "^29.0.3" + "pretty-format": "^29.2.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3216,18 +3216,18 @@ } }, "node_modules/jest-watcher": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.0.3.tgz", - "integrity": "sha512-tQX9lU91A+9tyUQKUMp0Ns8xAcdhC9fo73eqA3LFxP2bSgiF49TNcc+vf3qgGYYK9qRjFpXW9+4RgF/mbxyOOw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.2.2.tgz", + "integrity": "sha512-j2otfqh7mOvMgN2WlJ0n7gIx9XCMWntheYGlBK7+5g3b1Su13/UAK7pdKGyd4kDlrLwtH2QPvRv5oNIxWvsJ1w==", "dev": true, "dependencies": { - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "emittery": "^0.10.2", - "jest-util": "^29.0.3", + "emittery": "^0.13.1", + "jest-util": "^29.2.1", "string-length": "^4.0.1" }, "engines": { @@ -3235,12 +3235,13 @@ } }, "node_modules/jest-worker": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.0.3.tgz", - "integrity": "sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.2.1.tgz", + "integrity": "sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg==", "dev": true, "dependencies": { "@types/node": "*", + "jest-util": "^29.2.1", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -3841,9 +3842,9 @@ } }, "node_modules/pretty-format": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.0.3.tgz", - "integrity": "sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.2.1.tgz", + "integrity": "sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA==", "dev": true, "dependencies": { "@jest/schemas": "^29.0.0", @@ -4445,40 +4446,6 @@ "node": ">=4" } }, - "node_modules/supports-hyperlinks": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", - "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -4491,22 +4458,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -4623,9 +4574,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz", - "integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", "dev": true, "funding": [ { @@ -4760,12 +4711,12 @@ "dev": true }, "node_modules/yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", + "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", @@ -4820,27 +4771,27 @@ } }, "@babel/compat-data": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.0.tgz", - "integrity": "sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.0.tgz", + "integrity": "sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==", "dev": true }, "@babel/core": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.0.tgz", - "integrity": "sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==", + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.6.tgz", + "integrity": "sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", - "@babel/helper-compilation-targets": "^7.19.0", - "@babel/helper-module-transforms": "^7.19.0", - "@babel/helpers": "^7.19.0", - "@babel/parser": "^7.19.0", + "@babel/generator": "^7.19.6", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.6", + "@babel/helpers": "^7.19.4", + "@babel/parser": "^7.19.6", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0", + "@babel/traverse": "^7.19.6", + "@babel/types": "^7.19.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -4872,12 +4823,12 @@ } }, "@babel/generator": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.0.tgz", - "integrity": "sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.0.tgz", + "integrity": "sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==", "dev": true, "requires": { - "@babel/types": "^7.19.0", + "@babel/types": "^7.20.0", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -4896,14 +4847,14 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz", - "integrity": "sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz", + "integrity": "sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.19.0", + "@babel/compat-data": "^7.20.0", "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.20.2", + "browserslist": "^4.21.3", "semver": "^6.3.0" }, "dependencies": { @@ -4950,19 +4901,19 @@ } }, "@babel/helper-module-transforms": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", - "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", + "version": "7.19.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz", + "integrity": "sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-simple-access": "^7.19.4", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.19.6", + "@babel/types": "^7.19.4" } }, "@babel/helper-plugin-utils": { @@ -4972,12 +4923,12 @@ "dev": true }, "@babel/helper-simple-access": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", - "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz", + "integrity": "sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.19.4" } }, "@babel/helper-split-export-declaration": { @@ -4990,15 +4941,15 @@ } }, "@babel/helper-string-parser": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", - "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/helper-validator-option": { @@ -5008,14 +4959,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", - "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.0.tgz", + "integrity": "sha512-aGMjYraN0zosCEthoGLdqot1oRsmxVTQRHadsUPz5QM44Zej2PYRz7XiDE7GqnkZnNtLbOuxqoZw42vkU7+XEQ==", "dev": true, "requires": { "@babel/template": "^7.18.10", - "@babel/traverse": "^7.19.0", - "@babel/types": "^7.19.0" + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0" } }, "@babel/highlight": { @@ -5073,9 +5024,9 @@ } }, "@babel/parser": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.0.tgz", - "integrity": "sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.0.tgz", + "integrity": "sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -5196,12 +5147,12 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz", - "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", + "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.19.0" } }, "@babel/template": { @@ -5216,19 +5167,19 @@ } }, "@babel/traverse": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.0.tgz", - "integrity": "sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.0.tgz", + "integrity": "sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", + "@babel/generator": "^7.20.0", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.19.0", - "@babel/types": "^7.19.0", + "@babel/parser": "^7.20.0", + "@babel/types": "^7.20.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -5251,13 +5202,13 @@ } }, "@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.0.tgz", + "integrity": "sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, @@ -5287,123 +5238,123 @@ "dev": true }, "@jest/console": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.0.3.tgz", - "integrity": "sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.2.1.tgz", + "integrity": "sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", "slash": "^3.0.0" } }, "@jest/core": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.0.3.tgz", - "integrity": "sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.2.2.tgz", + "integrity": "sha512-susVl8o2KYLcZhhkvSB+b7xX575CX3TmSvxfeDjpRko7KmT89rHkXj6XkDkNpSeFMBzIENw5qIchO9HC9Sem+A==", "dev": true, "requires": { - "@jest/console": "^29.0.3", - "@jest/reporters": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/reporters": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.0.0", - "jest-config": "^29.0.3", - "jest-haste-map": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-resolve-dependencies": "^29.0.3", - "jest-runner": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", - "jest-watcher": "^29.0.3", + "jest-changed-files": "^29.2.0", + "jest-config": "^29.2.2", + "jest-haste-map": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-resolve-dependencies": "^29.2.2", + "jest-runner": "^29.2.2", + "jest-runtime": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", + "jest-watcher": "^29.2.2", "micromatch": "^4.0.4", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "strip-ansi": "^6.0.0" } }, "@jest/environment": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.0.3.tgz", - "integrity": "sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.2.2.tgz", + "integrity": "sha512-OWn+Vhu0I1yxuGBJEFFekMYc8aGBGrY4rt47SOh/IFaI+D7ZHCk7pKRiSoZ2/Ml7b0Ony3ydmEHRx/tEOC7H1A==", "dev": true, "requires": { - "@jest/fake-timers": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/fake-timers": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", - "jest-mock": "^29.0.3" + "jest-mock": "^29.2.2" } }, "@jest/expect": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.0.3.tgz", - "integrity": "sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.2.2.tgz", + "integrity": "sha512-zwblIZnrIVt8z/SiEeJ7Q9wKKuB+/GS4yZe9zw7gMqfGf4C5hBLGrVyxu1SzDbVSqyMSlprKl3WL1r80cBNkgg==", "dev": true, "requires": { - "expect": "^29.0.3", - "jest-snapshot": "^29.0.3" + "expect": "^29.2.2", + "jest-snapshot": "^29.2.2" } }, "@jest/expect-utils": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.0.3.tgz", - "integrity": "sha512-i1xUkau7K/63MpdwiRqaxgZOjxYs4f0WMTGJnYwUKubsNRZSeQbLorS7+I4uXVF9KQ5r61BUPAUMZ7Lf66l64Q==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.2.2.tgz", + "integrity": "sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg==", "dev": true, "requires": { - "jest-get-type": "^29.0.0" + "jest-get-type": "^29.2.0" } }, "@jest/fake-timers": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.0.3.tgz", - "integrity": "sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.2.2.tgz", + "integrity": "sha512-nqaW3y2aSyZDl7zQ7t1XogsxeavNpH6kkdq+EpXncIDvAkjvFD7hmhcIs1nWloengEWUoWqkqSA6MSbf9w6DgA==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@sinonjs/fake-timers": "^9.1.2", "@types/node": "*", - "jest-message-util": "^29.0.3", - "jest-mock": "^29.0.3", - "jest-util": "^29.0.3" + "jest-message-util": "^29.2.1", + "jest-mock": "^29.2.2", + "jest-util": "^29.2.1" } }, "@jest/globals": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.0.3.tgz", - "integrity": "sha512-YqGHT65rFY2siPIHHFjuCGUsbzRjdqkwbat+Of6DmYRg5shIXXrLdZoVE/+TJ9O1dsKsFmYhU58JvIbZRU1Z9w==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.2.2.tgz", + "integrity": "sha512-/nt+5YMh65kYcfBhj38B3Hm0Trk4IsuMXNDGKE/swp36yydBWfz3OXkLqkSvoAtPW8IJMSJDFCbTM2oj5SNprw==", "dev": true, "requires": { - "@jest/environment": "^29.0.3", - "@jest/expect": "^29.0.3", - "@jest/types": "^29.0.3", - "jest-mock": "^29.0.3" + "@jest/environment": "^29.2.2", + "@jest/expect": "^29.2.2", + "@jest/types": "^29.2.1", + "jest-mock": "^29.2.2" } }, "@jest/reporters": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.0.3.tgz", - "integrity": "sha512-3+QU3d4aiyOWfmk1obDerie4XNCaD5Xo1IlKNde2yGEi02WQD+ZQD0i5Hgqm1e73sMV7kw6pMlCnprtEwEVwxw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.2.2.tgz", + "integrity": "sha512-AzjL2rl2zJC0njIzcooBvjA4sJjvdoq98sDuuNs4aNugtLPSQ+91nysGKRF0uY1to5k0MdGMdOBggUsPqvBcpA==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@jridgewell/trace-mapping": "^0.3.15", "@types/node": "*", "chalk": "^4.0.0", @@ -5416,13 +5367,12 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", + "jest-worker": "^29.2.1", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", - "terminal-link": "^2.0.0", "v8-to-istanbul": "^9.0.1" } }, @@ -5436,9 +5386,9 @@ } }, "@jest/source-map": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.0.0.tgz", - "integrity": "sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.2.0.tgz", + "integrity": "sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.15", @@ -5447,46 +5397,46 @@ } }, "@jest/test-result": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.0.3.tgz", - "integrity": "sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.2.1.tgz", + "integrity": "sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA==", "dev": true, "requires": { - "@jest/console": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/types": "^29.2.1", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.0.3.tgz", - "integrity": "sha512-Hf4+xYSWZdxTNnhDykr8JBs0yBN/nxOXyUQWfotBUqqy0LF9vzcFB0jm/EDNZCx587znLWTIgxcokW7WeZMobQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.2.2.tgz", + "integrity": "sha512-Cuc1znc1pl4v9REgmmLf0jBd3Y65UXJpioGYtMr/JNpQEIGEzkmHhy6W6DLbSsXeUA13TDzymPv0ZGZ9jH3eIw==", "dev": true, "requires": { - "@jest/test-result": "^29.0.3", + "@jest/test-result": "^29.2.1", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", + "jest-haste-map": "^29.2.1", "slash": "^3.0.0" } }, "@jest/transform": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.0.3.tgz", - "integrity": "sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.2.2.tgz", + "integrity": "sha512-aPe6rrletyuEIt2axxgdtxljmzH8O/nrov4byy6pDw9S8inIrTV+2PnjyP/oFHMSynzGxJ2s6OHowBNMXp/Jzg==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@jridgewell/trace-mapping": "^0.3.15", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-util": "^29.0.3", + "jest-haste-map": "^29.2.1", + "jest-regex-util": "^29.2.0", + "jest-util": "^29.2.1", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -5494,9 +5444,9 @@ } }, "@jest/types": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.0.3.tgz", - "integrity": "sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.2.1.tgz", + "integrity": "sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==", "dev": true, "requires": { "@jest/schemas": "^29.0.0", @@ -5536,13 +5486,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", + "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" } }, "@sinclair/typebox": { @@ -5602,9 +5552,9 @@ } }, "@types/babel__traverse": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.1.tgz", - "integrity": "sha512-FSdLaZh2UxaMuLp9lixWaHq/golWTRWOnRsAXzDTDSDOQLuZb1nsdCt6pJSPWSEQt2eFZ2YVk3oYhn+1kLMeMA==", + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz", + "integrity": "sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -5650,9 +5600,9 @@ "dev": true }, "@types/prettier": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz", - "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==", "dev": true }, "@types/stack-utils": { @@ -5751,15 +5701,15 @@ "dev": true }, "babel-jest": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.0.3.tgz", - "integrity": "sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.2.2.tgz", + "integrity": "sha512-kkq2QSDIuvpgfoac3WZ1OOcHsQQDU5xYk2Ql7tLdJ8BVAYbefEXal+NfS45Y5LVZA7cxC8KYcQMObpCt1J025w==", "dev": true, "requires": { - "@jest/transform": "^29.0.3", + "@jest/transform": "^29.2.2", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.0.2", + "babel-preset-jest": "^29.2.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -5779,9 +5729,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.2.tgz", - "integrity": "sha512-eBr2ynAEFjcebVvu8Ktx580BD1QKCrBG1XwEUTXJe285p9HA/4hOhfWCFRQhTKSyBV0VzjhG7H91Eifz9s29hg==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz", + "integrity": "sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -5811,12 +5761,12 @@ } }, "babel-preset-jest": { - "version": "29.0.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.0.2.tgz", - "integrity": "sha512-BeVXp7rH5TK96ofyEnHjznjLMQ2nAeDJ+QzxKnHAAMs0RgrQsCywjAN8m4mOm5Di0pxU//3AoEeJJrerMH5UeA==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz", + "integrity": "sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^29.0.2", + "babel-plugin-jest-hoist": "^29.2.0", "babel-preset-current-node-syntax": "^1.0.0" } }, @@ -5892,15 +5842,15 @@ } }, "browserslist": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz", - "integrity": "sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==", + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001370", - "electron-to-chromium": "^1.4.202", + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.5" + "update-browserslist-db": "^1.0.9" } }, "bser": { @@ -5945,9 +5895,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001399", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001399.tgz", - "integrity": "sha512-4vQ90tMKS+FkvuVWS5/QY1+d805ODxZiKFzsU8o/RsVJz49ZSRR8EjykLJbqhzdPgadbX6wB538wOzle3JniRA==", + "version": "1.0.30001427", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001427.tgz", + "integrity": "sha512-lfXQ73oB9c8DP5Suxaszm+Ta2sr/4tf8+381GkIm1MLj/YdLf+rEDyDSRCzeltuyTVGm+/s18gdZ0q+Wmp8VsQ==", "dev": true }, "chalk": { @@ -6011,13 +5961,13 @@ "dev": true }, "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "requires": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, @@ -6119,13 +6069,10 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "cookie": { "version": "0.5.0", @@ -6202,9 +6149,9 @@ } }, "diff-sequences": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.0.0.tgz", - "integrity": "sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.2.0.tgz", + "integrity": "sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw==", "dev": true }, "ee-first": { @@ -6213,15 +6160,15 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.4.249", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.249.tgz", - "integrity": "sha512-GMCxR3p2HQvIw47A599crTKYZprqihoBL4lDSAUmr7IYekXFK5t/WgEBrGJDCa2HWIZFQEkGuMqPCi05ceYqPQ==", + "version": "1.4.284", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", + "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", "dev": true }, "emittery": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz", - "integrity": "sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true }, "emoji-regex": { @@ -6296,16 +6243,16 @@ "dev": true }, "expect": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.0.3.tgz", - "integrity": "sha512-t8l5DTws3212VbmPL+tBFXhjRHLmctHB0oQbL8eUc6S7NzZtYUhycrFO9mkxA0ZUC6FAWdNi7JchJSkODtcu1Q==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.2.2.tgz", + "integrity": "sha512-hE09QerxZ5wXiOhqkXy5d2G9ar+EqOyifnCXCpMNu+vZ6DG9TJ6CO2c2kPDSLqERTTWrO7OZj8EkYHQqSd78Yw==", "dev": true, "requires": { - "@jest/expect-utils": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3" + "@jest/expect-utils": "^29.2.2", + "jest-get-type": "^29.2.0", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1" } }, "express": { @@ -6379,9 +6326,9 @@ "dev": true }, "fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "requires": { "bser": "2.1.1" @@ -6695,9 +6642,9 @@ } }, "is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" @@ -6752,9 +6699,9 @@ "dev": true }, "istanbul-lib-instrument": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", - "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "requires": { "@babel/core": "^7.12.3", @@ -6839,21 +6786,21 @@ } }, "jest": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.0.3.tgz", - "integrity": "sha512-ElgUtJBLgXM1E8L6K1RW1T96R897YY/3lRYqq9uVcPWtP2AAl/nQ16IYDh/FzQOOQ12VEuLdcPU83mbhG2C3PQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.2.2.tgz", + "integrity": "sha512-r+0zCN9kUqoON6IjDdjbrsWobXM/09Nd45kIPRD8kloaRh1z5ZCMdVsgLXGxmlL7UpAJsvCYOQNO+NjvG/gqiQ==", "dev": true, "requires": { - "@jest/core": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/core": "^29.2.2", + "@jest/types": "^29.2.1", "import-local": "^3.0.2", - "jest-cli": "^29.0.3" + "jest-cli": "^29.2.2" } }, "jest-changed-files": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.0.0.tgz", - "integrity": "sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.2.0.tgz", + "integrity": "sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA==", "dev": true, "requires": { "execa": "^5.0.0", @@ -6861,128 +6808,128 @@ } }, "jest-circus": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.0.3.tgz", - "integrity": "sha512-QeGzagC6Hw5pP+df1+aoF8+FBSgkPmraC1UdkeunWh0jmrp7wC0Hr6umdUAOELBQmxtKAOMNC3KAdjmCds92Zg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.2.2.tgz", + "integrity": "sha512-upSdWxx+Mh4DV7oueuZndJ1NVdgtTsqM4YgywHEx05UMH5nxxA2Qu9T9T9XVuR021XxqSoaKvSmmpAbjwwwxMw==", "dev": true, "requires": { - "@jest/environment": "^29.0.3", - "@jest/expect": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/environment": "^29.2.2", + "@jest/expect": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^0.7.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.0.3", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", + "jest-each": "^29.2.1", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-runtime": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", "p-limit": "^3.1.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "jest-cli": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.0.3.tgz", - "integrity": "sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.2.2.tgz", + "integrity": "sha512-R45ygnnb2CQOfd8rTPFR+/fls0d+1zXS6JPYTBBrnLPrhr58SSuPTiA5Tplv8/PXpz4zXR/AYNxmwIj6J6nrvg==", "dev": true, "requires": { - "@jest/core": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/core": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-config": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "prompts": "^2.0.1", "yargs": "^17.3.1" } }, "jest-config": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.0.3.tgz", - "integrity": "sha512-U5qkc82HHVYe3fNu2CRXLN4g761Na26rWKf7CjM8LlZB3In1jadEkZdMwsE37rd9RSPV0NfYaCjHdk/gu3v+Ew==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.2.2.tgz", + "integrity": "sha512-Q0JX54a5g1lP63keRfKR8EuC7n7wwny2HoTRDb8cx78IwQOiaYUVZAdjViY3WcTxpR02rPUpvNVmZ1fkIlZPcw==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.0.3", - "@jest/types": "^29.0.3", - "babel-jest": "^29.0.3", + "@jest/test-sequencer": "^29.2.2", + "@jest/types": "^29.2.1", + "babel-jest": "^29.2.2", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.0.3", - "jest-environment-node": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-runner": "^29.0.3", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-circus": "^29.2.2", + "jest-environment-node": "^29.2.2", + "jest-get-type": "^29.2.0", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-runner": "^29.2.2", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" } }, "jest-diff": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.0.3.tgz", - "integrity": "sha512-+X/AIF5G/vX9fWK+Db9bi9BQas7M9oBME7egU7psbn4jlszLFCu0dW63UgeE6cs/GANq4fLaT+8sGHQQ0eCUfg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.2.1.tgz", + "integrity": "sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^29.0.0", - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "diff-sequences": "^29.2.0", + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" } }, "jest-docblock": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.0.0.tgz", - "integrity": "sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.2.0.tgz", + "integrity": "sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==", "dev": true, "requires": { "detect-newline": "^3.0.0" } }, "jest-each": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.0.3.tgz", - "integrity": "sha512-wILhZfESURHHBNvPMJ0lZlYZrvOQJxAo3wNHi+ycr90V7M+uGR9Gh4+4a/BmaZF0XTyZsk4OiYEf3GJN7Ltqzg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.2.1.tgz", + "integrity": "sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "chalk": "^4.0.0", - "jest-get-type": "^29.0.0", - "jest-util": "^29.0.3", - "pretty-format": "^29.0.3" + "jest-get-type": "^29.2.0", + "jest-util": "^29.2.1", + "pretty-format": "^29.2.1" } }, "jest-environment-node": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.0.3.tgz", - "integrity": "sha512-cdZqRCnmIlTXC+9vtvmfiY/40Cj6s2T0czXuq1whvQdmpzAnj4sbqVYuZ4zFHk766xTTJ+Ij3uUqkk8KCfXoyg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.2.2.tgz", + "integrity": "sha512-B7qDxQjkIakQf+YyrqV5dICNs7tlCO55WJ4OMSXsqz1lpI/0PmeuXdx2F7eU8rnPbRkUR/fItSSUh0jvE2y/tw==", "dev": true, "requires": { - "@jest/environment": "^29.0.3", - "@jest/fake-timers": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/environment": "^29.2.2", + "@jest/fake-timers": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", - "jest-mock": "^29.0.3", - "jest-util": "^29.0.3" + "jest-mock": "^29.2.2", + "jest-util": "^29.2.1" } }, "jest-environment-node-single-context": { @@ -6995,78 +6942,79 @@ } }, "jest-get-type": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.0.0.tgz", - "integrity": "sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.2.0.tgz", + "integrity": "sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA==", "dev": true }, "jest-haste-map": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.0.3.tgz", - "integrity": "sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.2.1.tgz", + "integrity": "sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "fsevents": "^2.3.2", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.0.0", - "jest-util": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-regex-util": "^29.2.0", + "jest-util": "^29.2.1", + "jest-worker": "^29.2.1", "micromatch": "^4.0.4", "walker": "^1.0.8" } }, "jest-leak-detector": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.0.3.tgz", - "integrity": "sha512-YfW/G63dAuiuQ3QmQlh8hnqLDe25WFY3eQhuc/Ev1AGmkw5zREblTh7TCSKLoheyggu6G9gxO2hY8p9o6xbaRQ==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.2.1.tgz", + "integrity": "sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug==", "dev": true, "requires": { - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" } }, "jest-matcher-utils": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz", - "integrity": "sha512-RsR1+cZ6p1hDV4GSCQTg+9qjeotQCgkaleIKLK7dm+U4V/H2bWedU3RAtLm8+mANzZ7eDV33dMar4pejd7047w==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz", + "integrity": "sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^29.0.3", - "jest-get-type": "^29.0.0", - "pretty-format": "^29.0.3" + "jest-diff": "^29.2.1", + "jest-get-type": "^29.2.0", + "pretty-format": "^29.2.1" } }, "jest-message-util": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.0.3.tgz", - "integrity": "sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.2.1.tgz", + "integrity": "sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "jest-mock": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.0.3.tgz", - "integrity": "sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.2.2.tgz", + "integrity": "sha512-1leySQxNAnivvbcx0sCB37itu8f4OX2S/+gxLAV4Z62shT4r4dTG9tACDywUAEZoLSr36aYUTsVp3WKwWt4PMQ==", "dev": true, "requires": { - "@jest/types": "^29.0.3", - "@types/node": "*" + "@jest/types": "^29.2.1", + "@types/node": "*", + "jest-util": "^29.2.1" } }, "jest-pnp-resolver": { @@ -7077,101 +7025,101 @@ "requires": {} }, "jest-regex-util": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.0.0.tgz", - "integrity": "sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug==", + "version": "29.2.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.2.0.tgz", + "integrity": "sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==", "dev": true }, "jest-resolve": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.0.3.tgz", - "integrity": "sha512-toVkia85Y/BPAjJasTC9zIPY6MmVXQPtrCk8SmiheC4MwVFE/CMFlOtMN6jrwPMC6TtNh8+sTMllasFeu1wMPg==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.2.2.tgz", + "integrity": "sha512-3gaLpiC3kr14rJR3w7vWh0CBX2QAhfpfiQTwrFPvVrcHe5VUBtIXaR004aWE/X9B2CFrITOQAp5gxLONGrk6GA==", "dev": true, "requires": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", + "jest-haste-map": "^29.2.1", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.0.3", - "jest-validate": "^29.0.3", + "jest-util": "^29.2.1", + "jest-validate": "^29.2.2", "resolve": "^1.20.0", "resolve.exports": "^1.1.0", "slash": "^3.0.0" } }, "jest-resolve-dependencies": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.0.3.tgz", - "integrity": "sha512-KzuBnXqNvbuCdoJpv8EanbIGObk7vUBNt/PwQPPx2aMhlv/jaXpUJsqWYRpP/0a50faMBY7WFFP8S3/CCzwfDw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.2.2.tgz", + "integrity": "sha512-wWOmgbkbIC2NmFsq8Lb+3EkHuW5oZfctffTGvwsA4JcJ1IRk8b2tg+hz44f0lngvRTeHvp3Kyix9ACgudHH9aQ==", "dev": true, "requires": { - "jest-regex-util": "^29.0.0", - "jest-snapshot": "^29.0.3" + "jest-regex-util": "^29.2.0", + "jest-snapshot": "^29.2.2" } }, "jest-runner": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.0.3.tgz", - "integrity": "sha512-Usu6VlTOZlCZoNuh3b2Tv/yzDpKqtiNAetG9t3kJuHfUyVMNW7ipCCJOUojzKkjPoaN7Bl1f7Buu6PE0sGpQxw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.2.2.tgz", + "integrity": "sha512-1CpUxXDrbsfy9Hr9/1zCUUhT813kGGK//58HeIw/t8fa/DmkecEwZSWlb1N/xDKXg3uCFHQp1GCvlSClfImMxg==", "dev": true, "requires": { - "@jest/console": "^29.0.3", - "@jest/environment": "^29.0.3", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/console": "^29.2.1", + "@jest/environment": "^29.2.2", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", - "emittery": "^0.10.2", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.0.0", - "jest-environment-node": "^29.0.3", - "jest-haste-map": "^29.0.3", - "jest-leak-detector": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-resolve": "^29.0.3", - "jest-runtime": "^29.0.3", - "jest-util": "^29.0.3", - "jest-watcher": "^29.0.3", - "jest-worker": "^29.0.3", + "jest-docblock": "^29.2.0", + "jest-environment-node": "^29.2.2", + "jest-haste-map": "^29.2.1", + "jest-leak-detector": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-resolve": "^29.2.2", + "jest-runtime": "^29.2.2", + "jest-util": "^29.2.1", + "jest-watcher": "^29.2.2", + "jest-worker": "^29.2.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" } }, "jest-runtime": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.0.3.tgz", - "integrity": "sha512-12gZXRQ7ozEeEHKTY45a+YLqzNDR/x4c//X6AqwKwKJPpWM8FY4vwn4VQJOcLRS3Nd1fWwgP7LU4SoynhuUMHQ==", - "dev": true, - "requires": { - "@jest/environment": "^29.0.3", - "@jest/fake-timers": "^29.0.3", - "@jest/globals": "^29.0.3", - "@jest/source-map": "^29.0.0", - "@jest/test-result": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.2.2.tgz", + "integrity": "sha512-TpR1V6zRdLynckKDIQaY41od4o0xWL+KOPUCZvJK2bu5P1UXhjobt5nJ2ICNeIxgyj9NGkO0aWgDqYPVhDNKjA==", + "dev": true, + "requires": { + "@jest/environment": "^29.2.2", + "@jest/fake-timers": "^29.2.2", + "@jest/globals": "^29.2.2", + "@jest/source-map": "^29.2.0", + "@jest/test-result": "^29.2.1", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-mock": "^29.0.3", - "jest-regex-util": "^29.0.0", - "jest-resolve": "^29.0.3", - "jest-snapshot": "^29.0.3", - "jest-util": "^29.0.3", + "jest-haste-map": "^29.2.1", + "jest-message-util": "^29.2.1", + "jest-mock": "^29.2.2", + "jest-regex-util": "^29.2.0", + "jest-resolve": "^29.2.2", + "jest-snapshot": "^29.2.2", + "jest-util": "^29.2.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" } }, "jest-snapshot": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.0.3.tgz", - "integrity": "sha512-52q6JChm04U3deq+mkQ7R/7uy7YyfVIrebMi6ZkBoDJ85yEjm/sJwdr1P0LOIEHmpyLlXrxy3QP0Zf5J2kj0ew==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.2.2.tgz", + "integrity": "sha512-GfKJrpZ5SMqhli3NJ+mOspDqtZfJBryGA8RIBxF+G+WbDoC7HCqKaeAss4Z/Sab6bAW11ffasx8/vGsj83jyjA==", "dev": true, "requires": { "@babel/core": "^7.11.6", @@ -7180,30 +7128,30 @@ "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.0.3", - "@jest/transform": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/expect-utils": "^29.2.2", + "@jest/transform": "^29.2.2", + "@jest/types": "^29.2.1", "@types/babel__traverse": "^7.0.6", "@types/prettier": "^2.1.5", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.0.3", + "expect": "^29.2.2", "graceful-fs": "^4.2.9", - "jest-diff": "^29.0.3", - "jest-get-type": "^29.0.0", - "jest-haste-map": "^29.0.3", - "jest-matcher-utils": "^29.0.3", - "jest-message-util": "^29.0.3", - "jest-util": "^29.0.3", + "jest-diff": "^29.2.1", + "jest-get-type": "^29.2.0", + "jest-haste-map": "^29.2.1", + "jest-matcher-utils": "^29.2.2", + "jest-message-util": "^29.2.1", + "jest-util": "^29.2.1", "natural-compare": "^1.4.0", - "pretty-format": "^29.0.3", + "pretty-format": "^29.2.1", "semver": "^7.3.5" }, "dependencies": { "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -7212,12 +7160,12 @@ } }, "jest-util": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.0.3.tgz", - "integrity": "sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.2.1.tgz", + "integrity": "sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -7226,17 +7174,17 @@ } }, "jest-validate": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.0.3.tgz", - "integrity": "sha512-OebiqqT6lK8cbMPtrSoS3aZP4juID762lZvpf1u+smZnwTEBCBInan0GAIIhv36MxGaJvmq5uJm7dl5gVt+Zrw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.2.2.tgz", + "integrity": "sha512-eJXATaKaSnOuxNfs8CLHgdABFgUrd0TtWS8QckiJ4L/QVDF4KVbZFBBOwCBZHOS0Rc5fOxqngXeGXE3nGQkpQA==", "dev": true, "requires": { - "@jest/types": "^29.0.3", + "@jest/types": "^29.2.1", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.0.0", + "jest-get-type": "^29.2.0", "leven": "^3.1.0", - "pretty-format": "^29.0.3" + "pretty-format": "^29.2.1" }, "dependencies": { "camelcase": { @@ -7248,28 +7196,29 @@ } }, "jest-watcher": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.0.3.tgz", - "integrity": "sha512-tQX9lU91A+9tyUQKUMp0Ns8xAcdhC9fo73eqA3LFxP2bSgiF49TNcc+vf3qgGYYK9qRjFpXW9+4RgF/mbxyOOw==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.2.2.tgz", + "integrity": "sha512-j2otfqh7mOvMgN2WlJ0n7gIx9XCMWntheYGlBK7+5g3b1Su13/UAK7pdKGyd4kDlrLwtH2QPvRv5oNIxWvsJ1w==", "dev": true, "requires": { - "@jest/test-result": "^29.0.3", - "@jest/types": "^29.0.3", + "@jest/test-result": "^29.2.1", + "@jest/types": "^29.2.1", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "emittery": "^0.10.2", - "jest-util": "^29.0.3", + "emittery": "^0.13.1", + "jest-util": "^29.2.1", "string-length": "^4.0.1" } }, "jest-worker": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.0.3.tgz", - "integrity": "sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.2.1.tgz", + "integrity": "sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg==", "dev": true, "requires": { "@types/node": "*", + "jest-util": "^29.2.1", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -7709,9 +7658,9 @@ } }, "pretty-format": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.0.3.tgz", - "integrity": "sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q==", + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.2.1.tgz", + "integrity": "sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA==", "dev": true, "requires": { "@jest/schemas": "^29.0.0", @@ -8157,49 +8106,12 @@ "has-flag": "^3.0.0" } }, - "supports-hyperlinks": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", - "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", - "dev": true, - "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - } - }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -8283,9 +8195,9 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, "update-browserslist-db": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz", - "integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", + "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", "dev": true, "requires": { "escalade": "^3.1.1", @@ -8377,12 +8289,12 @@ "dev": true }, "yargs": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", - "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.0.tgz", + "integrity": "sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g==", "dev": true, "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", diff --git a/wizard-style-builder/package.json b/wizard-style-builder/package.json index fc1ca0d6c..7118b99df 100644 --- a/wizard-style-builder/package.json +++ b/wizard-style-builder/package.json @@ -22,7 +22,7 @@ "sass": "^1.55.0" }, "devDependencies": { - "jest": "^29.0.3", + "jest": "^29.2.2", "jest-environment-node-single-context": "^29.0.0", "nodemon": "^2.0.20", "supertest": "^6.2.4" From 1eaa0891a689d5296e75e5546bff8cfb638dcbfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:08:07 +0000 Subject: [PATCH 09/21] Bump supertest from 6.2.4 to 6.3.1 in /wizard-style-builder Bumps [supertest](https://github.com/visionmedia/supertest) from 6.2.4 to 6.3.1. - [Release notes](https://github.com/visionmedia/supertest/releases) - [Commits](https://github.com/visionmedia/supertest/compare/v6.2.4...v6.3.1) --- updated-dependencies: - dependency-name: supertest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- wizard-style-builder/package-lock.json | 159 ++++++++----------------- wizard-style-builder/package.json | 2 +- 2 files changed, 50 insertions(+), 111 deletions(-) diff --git a/wizard-style-builder/package-lock.json b/wizard-style-builder/package-lock.json index b030f97f5..e38b99957 100644 --- a/wizard-style-builder/package-lock.json +++ b/wizard-style-builder/package-lock.json @@ -20,7 +20,7 @@ "jest": "^29.2.2", "jest-environment-node-single-context": "^29.0.0", "nodemon": "^2.0.20", - "supertest": "^6.2.4" + "supertest": "^6.3.1" } }, "node_modules/@ampproject/remapping": { @@ -3940,20 +3940,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -4251,35 +4237,6 @@ "node": ">= 0.8" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -4350,9 +4307,9 @@ } }, "node_modules/superagent": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.0.tgz", - "integrity": "sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.3.tgz", + "integrity": "sha512-oBC+aNsCjzzjmO5AOPBPFS+Z7HPzlx+DQr/aHwM08kI+R24gsDmAS1LMfza1fK+P+SKlTAoNZpOvooE/pRO1HA==", "dev": true, "dependencies": { "component-emitter": "^1.3.0", @@ -4363,9 +4320,8 @@ "formidable": "^2.0.1", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.11.0", + "semver": "^7.3.8" }, "engines": { "node": ">=6.4.0 <13 || >=14" @@ -4406,10 +4362,25 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/superagent/node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/superagent/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4422,13 +4393,13 @@ } }, "node_modules/supertest": { - "version": "6.2.4", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.4.tgz", - "integrity": "sha512-M8xVnCNv+q2T2WXVzxDECvL2695Uv2uUj2O0utxsld/HRyJvOU8W9f1gvsYxSNU4wmIe0/L/ItnpU4iKq0emDA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.1.tgz", + "integrity": "sha512-hRohNeIfk/cA48Cxpa/w48hktP6ZaRqXb0QV5rLvW0C7paRsBU3Q5zydzYrslOJtj/gd48qx540jKtcs6vG1fQ==", "dev": true, "dependencies": { "methods": "^1.1.2", - "superagent": "^8.0.0" + "superagent": "^8.0.3" }, "engines": { "node": ">=6.4.0" @@ -4599,12 +4570,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -7731,17 +7696,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -7971,23 +7925,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -8037,9 +7974,9 @@ "dev": true }, "superagent": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.0.tgz", - "integrity": "sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.3.tgz", + "integrity": "sha512-oBC+aNsCjzzjmO5AOPBPFS+Z7HPzlx+DQr/aHwM08kI+R24gsDmAS1LMfza1fK+P+SKlTAoNZpOvooE/pRO1HA==", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -8050,9 +7987,8 @@ "formidable": "^2.0.1", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.11.0", + "semver": "^7.3.8" }, "dependencies": { "debug": { @@ -8076,10 +8012,19 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -8088,13 +8033,13 @@ } }, "supertest": { - "version": "6.2.4", - "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.2.4.tgz", - "integrity": "sha512-M8xVnCNv+q2T2WXVzxDECvL2695Uv2uUj2O0utxsld/HRyJvOU8W9f1gvsYxSNU4wmIe0/L/ItnpU4iKq0emDA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.1.tgz", + "integrity": "sha512-hRohNeIfk/cA48Cxpa/w48hktP6ZaRqXb0QV5rLvW0C7paRsBU3Q5zydzYrslOJtj/gd48qx540jKtcs6vG1fQ==", "dev": true, "requires": { "methods": "^1.1.2", - "superagent": "^8.0.0" + "superagent": "^8.0.3" } }, "supports-color": { @@ -8204,12 +8149,6 @@ "picocolors": "^1.0.0" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", diff --git a/wizard-style-builder/package.json b/wizard-style-builder/package.json index 7118b99df..3f3bb6ffa 100644 --- a/wizard-style-builder/package.json +++ b/wizard-style-builder/package.json @@ -25,7 +25,7 @@ "jest": "^29.2.2", "jest-environment-node-single-context": "^29.0.0", "nodemon": "^2.0.20", - "supertest": "^6.2.4" + "supertest": "^6.3.1" }, "jest": { "testEnvironment": "jest-environment-node-single-context", From 6ebe423471d2961e16e45f400fe6507ae629b790 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 23:00:53 +0000 Subject: [PATCH 10/21] Bump uglify-js from 3.17.2 to 3.17.4 Bumps [uglify-js](https://github.com/mishoo/UglifyJS) from 3.17.2 to 3.17.4. - [Release notes](https://github.com/mishoo/UglifyJS/releases) - [Commits](https://github.com/mishoo/UglifyJS/compare/v3.17.2...v3.17.4) --- updated-dependencies: - dependency-name: uglify-js dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index a849712da..767ffeff2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "sass": "^1.55.0", "sass-loader": "^13.0.2", "terser-webpack-plugin": "^5.3.6", - "uglify-js": "^3.17.2", + "uglify-js": "^3.17.4", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.11.1" @@ -8290,9 +8290,9 @@ } }, "node_modules/uglify-js": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.2.tgz", - "integrity": "sha512-bbxglRjsGQMchfvXZNusUcYgiB9Hx2K4AHYXQy2DITZ9Rd+JzhX7+hoocE5Winr7z2oHvPsekkBwXtigvxevXg==", + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -15340,9 +15340,9 @@ } }, "uglify-js": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.2.tgz", - "integrity": "sha512-bbxglRjsGQMchfvXZNusUcYgiB9Hx2K4AHYXQy2DITZ9Rd+JzhX7+hoocE5Winr7z2oHvPsekkBwXtigvxevXg==", + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", "dev": true }, "unique-filename": { diff --git a/package.json b/package.json index 567529518..a88ae11d4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "sass": "^1.55.0", "sass-loader": "^13.0.2", "terser-webpack-plugin": "^5.3.6", - "uglify-js": "^3.17.2", + "uglify-js": "^3.17.4", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.11.1" From 95b2d1b9e6db8cec5bee38c992decc111f76b959 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:08:08 +0000 Subject: [PATCH 11/21] Bump css-minimizer-webpack-plugin from 4.1.0 to 4.2.2 Bumps [css-minimizer-webpack-plugin](https://github.com/webpack-contrib/css-minimizer-webpack-plugin) from 4.1.0 to 4.2.2. - [Release notes](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/releases) - [Changelog](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/compare/v4.1.0...v4.2.2) --- updated-dependencies: - dependency-name: css-minimizer-webpack-plugin dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 288 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 272 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 767ffeff2..17a3686a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "devDependencies": { "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", - "css-minimizer-webpack-plugin": "^4.1.0", + "css-minimizer-webpack-plugin": "^4.2.2", "elm": "^0.19.1-5", "elm-review": "^2.7.5", "elm-test": "^0.19.1-revision9", @@ -180,6 +180,35 @@ "optional": true, "peer": true }, + "node_modules/@jest/schemas": { + "version": "29.0.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.0.0.tgz", + "integrity": "sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.24.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.2.1.tgz", + "integrity": "sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.0.0", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -333,6 +362,12 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@sinclair/typebox": { + "version": "0.24.51", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", + "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", + "dev": true + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -497,6 +532,30 @@ "@types/node": "*" } }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, "node_modules/@types/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", @@ -610,6 +669,21 @@ "@types/node": "*" } }, + "node_modules/@types/yargs": { + "version": "17.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", + "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -1701,6 +1775,12 @@ "node": ">=6.0" } }, + "node_modules/ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, "node_modules/clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -2125,14 +2205,14 @@ } }, "node_modules/css-minimizer-webpack-plugin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.1.0.tgz", - "integrity": "sha512-Zd+yz4nta4GXi3pMqF6skO8kjzuCUbr62z8SLMGZZtxWxTGTLopOiabPGNDEyjHCRhnhdA1EfHmqLa2Oekjtng==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.2.2.tgz", + "integrity": "sha512-s3Of/4jKfw1Hj9CxEO1E5oXhQAxlayuHO2y/ML+C6I9sQ7FdzfEV6QgMLN3vI+qFsjJGIAFLKtQK7t8BOXAIyA==", "dev": true, "dependencies": { "cssnano": "^5.1.8", - "jest-worker": "^27.5.1", - "postcss": "^8.4.13", + "jest-worker": "^29.1.2", + "postcss": "^8.4.17", "schema-utils": "^4.0.0", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1" @@ -2151,6 +2231,9 @@ "@parcel/css": { "optional": true }, + "@swc/css": { + "optional": true + }, "clean-css": { "optional": true }, @@ -2193,6 +2276,30 @@ "ajv": "^8.0.0" } }, + "node_modules/css-minimizer-webpack-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/jest-worker": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.2.1.tgz", + "integrity": "sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.2.1", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -2212,6 +2319,21 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/css-minimizer-webpack-plugin/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/css-select": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", @@ -4672,6 +4794,23 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "node_modules/jest-util": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.2.1.tgz", + "integrity": "sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==", + "dev": true, + "dependencies": { + "@jest/types": "^29.2.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -6167,9 +6306,9 @@ } }, "node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "dev": true, "funding": [ { @@ -9147,6 +9286,29 @@ "optional": true, "peer": true }, + "@jest/schemas": { + "version": "29.0.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.0.0.tgz", + "integrity": "sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.24.1" + } + }, + "@jest/types": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.2.1.tgz", + "integrity": "sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==", + "dev": true, + "requires": { + "@jest/schemas": "^29.0.0", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + } + }, "@jridgewell/gen-mapping": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", @@ -9268,6 +9430,12 @@ "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", "peer": true }, + "@sinclair/typebox": { + "version": "0.24.51", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", + "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", + "dev": true + }, "@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -9417,6 +9585,30 @@ "@types/node": "*" } }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, "@types/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", @@ -9530,6 +9722,21 @@ "@types/node": "*" } }, + "@types/yargs": { + "version": "17.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz", + "integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -10382,6 +10589,12 @@ "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true }, + "ci-info": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.5.0.tgz", + "integrity": "sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==", + "dev": true + }, "clean-css": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.2.tgz", @@ -10707,14 +10920,14 @@ } }, "css-minimizer-webpack-plugin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.1.0.tgz", - "integrity": "sha512-Zd+yz4nta4GXi3pMqF6skO8kjzuCUbr62z8SLMGZZtxWxTGTLopOiabPGNDEyjHCRhnhdA1EfHmqLa2Oekjtng==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-4.2.2.tgz", + "integrity": "sha512-s3Of/4jKfw1Hj9CxEO1E5oXhQAxlayuHO2y/ML+C6I9sQ7FdzfEV6QgMLN3vI+qFsjJGIAFLKtQK7t8BOXAIyA==", "dev": true, "requires": { "cssnano": "^5.1.8", - "jest-worker": "^27.5.1", - "postcss": "^8.4.13", + "jest-worker": "^29.1.2", + "postcss": "^8.4.17", "schema-utils": "^4.0.0", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1" @@ -10741,6 +10954,24 @@ "fast-deep-equal": "^3.1.3" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "jest-worker": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.2.1.tgz", + "integrity": "sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.2.1", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -10752,6 +10983,15 @@ "ajv-formats": "^2.1.1", "ajv-keywords": "^5.0.0" } + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, @@ -12617,6 +12857,20 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "jest-util": { + "version": "29.2.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.2.1.tgz", + "integrity": "sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==", + "dev": true, + "requires": { + "@jest/types": "^29.2.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, "jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -13774,9 +14028,9 @@ } }, "postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.18.tgz", + "integrity": "sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==", "dev": true, "requires": { "nanoid": "^3.3.4", diff --git a/package.json b/package.json index a88ae11d4..a654f39ad 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "devDependencies": { "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", - "css-minimizer-webpack-plugin": "^4.1.0", + "css-minimizer-webpack-plugin": "^4.2.2", "elm": "^0.19.1-5", "elm-review": "^2.7.5", "elm-test": "^0.19.1-revision9", From d5f104214219f061be07b5daa0c91fbbc8622ef2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:08:20 +0000 Subject: [PATCH 12/21] Bump express from 4.18.1 to 4.18.2 in /wizard-style-builder Bumps [express](https://github.com/expressjs/express) from 4.18.1 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.1...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- wizard-style-builder/package-lock.json | 136 ++++++++----------------- wizard-style-builder/package.json | 2 +- 2 files changed, 41 insertions(+), 97 deletions(-) diff --git a/wizard-style-builder/package-lock.json b/wizard-style-builder/package-lock.json index e38b99957..15ff835f5 100644 --- a/wizard-style-builder/package-lock.json +++ b/wizard-style-builder/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "compression": "^1.7.4", - "express": "^4.18.1", + "express": "^4.18.2", "fs-extra": "^10.1.0", "helmet": "^6.0.0", "morgan": "^1.10.0", @@ -1337,9 +1337,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -1349,7 +1349,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -1359,14 +1359,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/body-parser/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/body-parser/node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -1791,6 +1783,14 @@ "node": ">=0.4.0" } }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -1967,13 +1967,13 @@ } }, "node_modules/express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -1992,7 +1992,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -2007,14 +2007,6 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/express/node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -2378,14 +2370,6 @@ "node": ">= 0.8" } }, - "node_modules/http-errors/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -3417,7 +3401,7 @@ "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "engines": { "node": ">= 0.6" } @@ -3520,14 +3504,6 @@ "node": ">= 0.8.0" } }, - "node_modules/morgan/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3899,9 +3875,9 @@ "dev": true }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -4065,14 +4041,6 @@ "node": ">= 0.8.0" } }, - "node_modules/send/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5755,9 +5723,9 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -5767,17 +5735,12 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" }, "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -6092,6 +6055,11 @@ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, "destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -6221,13 +6189,13 @@ } }, "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -6246,7 +6214,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -6258,11 +6226,6 @@ "vary": "~1.1.2" }, "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -6522,13 +6485,6 @@ "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } } }, "human-signals": { @@ -7313,7 +7269,7 @@ "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { "version": "1.0.1", @@ -7384,13 +7340,6 @@ "depd": "~2.0.0", "on-finished": "~2.3.0", "on-headers": "~1.0.2" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } } }, "ms": { @@ -7667,9 +7616,9 @@ "dev": true }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -7788,11 +7737,6 @@ "statuses": "2.0.1" }, "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/wizard-style-builder/package.json b/wizard-style-builder/package.json index 3f3bb6ffa..fe0310a36 100644 --- a/wizard-style-builder/package.json +++ b/wizard-style-builder/package.json @@ -15,7 +15,7 @@ "license": "Apache-2.0", "dependencies": { "compression": "^1.7.4", - "express": "^4.18.1", + "express": "^4.18.2", "fs-extra": "^10.1.0", "helmet": "^6.0.0", "morgan": "^1.10.0", From e7a8eb494219e365a0b72b2dfdeee8b52ece8367 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:07:58 +0000 Subject: [PATCH 13/21] Bump bootstrap from 5.2.1 to 5.2.2 Bumps [bootstrap](https://github.com/twbs/bootstrap) from 5.2.1 to 5.2.2. - [Release notes](https://github.com/twbs/bootstrap/releases) - [Commits](https://github.com/twbs/bootstrap/compare/v5.2.1...v5.2.2) --- updated-dependencies: - dependency-name: bootstrap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17a3686a1..01970d942 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@fortawesome/fontawesome-free": "^5.15.4", "axios": "^0.27.2", "axios-retry": "^3.3.1", - "bootstrap": "^5.2.1", + "bootstrap": "^5.2.2", "chart.js": "^3.9.1", "flatpickr": "^4.6.13", "po2json": "^1.0.0-beta-3" @@ -1406,9 +1406,9 @@ "dev": true }, "node_modules/bootstrap": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.1.tgz", - "integrity": "sha512-UQi3v2NpVPEi1n35dmRRzBJFlgvWHYwyem6yHhuT6afYF+sziEt46McRbT//kVXZ7b1YUYEVGdXEH74Nx3xzGA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.2.tgz", + "integrity": "sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==", "funding": [ { "type": "github", @@ -10334,9 +10334,9 @@ "dev": true }, "bootstrap": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.1.tgz", - "integrity": "sha512-UQi3v2NpVPEi1n35dmRRzBJFlgvWHYwyem6yHhuT6afYF+sziEt46McRbT//kVXZ7b1YUYEVGdXEH74Nx3xzGA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.2.tgz", + "integrity": "sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==", "requires": {} }, "brace-expansion": { diff --git a/package.json b/package.json index a654f39ad..5ff4ec3f3 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@fortawesome/fontawesome-free": "^5.15.4", "axios": "^0.27.2", "axios-retry": "^3.3.1", - "bootstrap": "^5.2.1", + "bootstrap": "^5.2.2", "chart.js": "^3.9.1", "flatpickr": "^4.6.13", "po2json": "^1.0.0-beta-3" From 61a46ae0d47e6411d50b9fa7c23b0bcaa0217888 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 09:23:40 +0000 Subject: [PATCH 14/21] Bump sass-loader from 13.0.2 to 13.1.0 Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 13.0.2 to 13.1.0. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v13.0.2...v13.1.0) --- updated-dependencies: - dependency-name: sass-loader dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 01970d942..702096b2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "lodash": "^4.17.21", "mini-css-extract-plugin": "^2.6.1", "sass": "^1.55.0", - "sass-loader": "^13.0.2", + "sass-loader": "^13.1.0", "terser-webpack-plugin": "^5.3.6", "uglify-js": "^3.17.4", "webpack": "^5.74.0", @@ -7392,9 +7392,9 @@ } }, "node_modules/sass-loader": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.0.2.tgz", - "integrity": "sha512-BbiqbVmbfJaWVeOOAu2o7DhYWtcNmTfvroVgFXa6k2hHheMxNAeDHLNoDy/Q5aoaVlz0LH+MbMktKwm9vN/j8Q==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.1.0.tgz", + "integrity": "sha512-tZS1RJQ2n2+QNyf3CCAo1H562WjL/5AM6Gi8YcPVVoNxQX8d19mx8E+8fRrMWsyc93ZL6Q8vZDSM0FHVTJaVnQ==", "dev": true, "dependencies": { "klona": "^2.0.4", @@ -14787,9 +14787,9 @@ } }, "sass-loader": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.0.2.tgz", - "integrity": "sha512-BbiqbVmbfJaWVeOOAu2o7DhYWtcNmTfvroVgFXa6k2hHheMxNAeDHLNoDy/Q5aoaVlz0LH+MbMktKwm9vN/j8Q==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.1.0.tgz", + "integrity": "sha512-tZS1RJQ2n2+QNyf3CCAo1H562WjL/5AM6Gi8YcPVVoNxQX8d19mx8E+8fRrMWsyc93ZL6Q8vZDSM0FHVTJaVnQ==", "dev": true, "requires": { "klona": "^2.0.4", diff --git a/package.json b/package.json index 5ff4ec3f3..5027cc925 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "lodash": "^4.17.21", "mini-css-extract-plugin": "^2.6.1", "sass": "^1.55.0", - "sass-loader": "^13.0.2", + "sass-loader": "^13.1.0", "terser-webpack-plugin": "^5.3.6", "uglify-js": "^3.17.4", "webpack": "^5.74.0", From 7caee2ec500ab3ba21fa5d32c271f66f692934b8 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Sun, 30 Oct 2022 10:34:57 +0100 Subject: [PATCH 15/21] [DSW-1547] Add logout flow for OpenID --- engine-shared/elm/Shared/Api/Users.elm | 6 ++++++ engine-wizard/elm/Wizard/Auth/Msgs.elm | 1 + engine-wizard/elm/Wizard/Auth/Update.elm | 11 +++++++++-- .../elm/Wizard/Settings/Authentication/View.elm | 8 +++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/engine-shared/elm/Shared/Api/Users.elm b/engine-shared/elm/Shared/Api/Users.elm index c5088d122..19ac6e192 100644 --- a/engine-shared/elm/Shared/Api/Users.elm +++ b/engine-shared/elm/Shared/Api/Users.elm @@ -1,5 +1,6 @@ module Shared.Api.Users exposing ( GetUsersFilters + , deleteToken , deleteUser , getCurrentUser , getUser @@ -117,3 +118,8 @@ putUserActivation uuid hash = deleteUser : String -> AbstractAppState a -> ToMsg () msg -> Cmd msg deleteUser uuid = jwtDelete ("/users/" ++ uuid) + + +deleteToken : AbstractAppState a -> ToMsg () msg -> Cmd msg +deleteToken = + jwtDelete "/users/current/token" diff --git a/engine-wizard/elm/Wizard/Auth/Msgs.elm b/engine-wizard/elm/Wizard/Auth/Msgs.elm index 0b32ac13b..6d1a86339 100644 --- a/engine-wizard/elm/Wizard/Auth/Msgs.elm +++ b/engine-wizard/elm/Wizard/Auth/Msgs.elm @@ -8,4 +8,5 @@ import Shared.Error.ApiError exposing (ApiError) type Msg = GetCurrentUserCompleted (Maybe String) (Result ApiError User) | Logout + | LogoutDone | GotToken Token (Maybe String) diff --git a/engine-wizard/elm/Wizard/Auth/Update.elm b/engine-wizard/elm/Wizard/Auth/Update.elm index cb3c6fbbc..318fe58c6 100644 --- a/engine-wizard/elm/Wizard/Auth/Update.elm +++ b/engine-wizard/elm/Wizard/Auth/Update.elm @@ -25,7 +25,7 @@ update msg model = setSession (Session.setToken model.appState.session token) model in ( newModel - , UsersApi.getCurrentUser newModel.appState (AuthMsgs.GetCurrentUserCompleted mbOriginalUrl >> Wizard.Msgs.AuthMsg) + , UsersApi.getCurrentUser newModel.appState (Wizard.Msgs.AuthMsg << AuthMsgs.GetCurrentUserCompleted mbOriginalUrl) ) AuthMsgs.GetCurrentUserCompleted mbOriginalUrl result -> @@ -34,6 +34,9 @@ update msg model = AuthMsgs.Logout -> logout model + AuthMsgs.LogoutDone -> + ( model, Cmd.none ) + getCurrentUserCompleted : Model -> Maybe String -> Result ApiError User -> ( Model, Cmd Msg ) getCurrentUserCompleted model mbOriginalUrl result = @@ -73,6 +76,10 @@ logout : Model -> ( Model, Cmd Msg ) logout model = let cmd = - Cmd.batch [ Ports.clearSession (), cmdNavigate model.appState Routes.publicHome ] + Cmd.batch + [ Ports.clearSession () + , UsersApi.deleteToken model.appState (Wizard.Msgs.AuthMsg << always AuthMsgs.LogoutDone) + , cmdNavigate model.appState Routes.publicHome + ] in ( setSession Session.init model, cmd ) diff --git a/engine-wizard/elm/Wizard/Settings/Authentication/View.elm b/engine-wizard/elm/Wizard/Settings/Authentication/View.elm index 24e458649..333854966 100644 --- a/engine-wizard/elm/Wizard/Settings/Authentication/View.elm +++ b/engine-wizard/elm/Wizard/Settings/Authentication/View.elm @@ -91,6 +91,11 @@ serviceFormView appState openIDPrefabs form i = |> Maybe.map (\id -> appState.clientUrl ++ "/auth/" ++ id ++ "/callback") |> Maybe.withDefault "-" + logoutUrl = + (Form.getFieldAsString idField form).value + |> Maybe.map (\id -> appState.apiUrl ++ "/auth/" ++ id ++ "/logout") + |> Maybe.withDefault "-" + buttonName = Maybe.withDefault "" <| (Form.getFieldAsString nameField form).value @@ -118,7 +123,7 @@ serviceFormView appState openIDPrefabs form i = openID.style.background in div [ class "prefab-selection" ] - [ strong [] [ text "Quick setup" ] + [ strong [] [ text (gettext "Quick setup" appState.locale) ] , div [] (List.map viewPrefabButton <| List.sortBy .name openIDPrefabs) ] @@ -144,6 +149,7 @@ serviceFormView appState openIDPrefabs form i = ] ] , FormGroup.textView "callback-url" callbackUrl (gettext "Callback URL" appState.locale) + , FormGroup.textView "logout-url" logoutUrl (gettext "Logout URL" appState.locale) , div [ class "row" ] [ div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientIdField (gettext "Client ID" appState.locale) ] , div [ class "col" ] [ mapFormMsg <| FormGroup.input appState form clientSecretField (gettext "Client Secret" appState.locale) ] From a5468eb8e2fb58d452918393579f9675a731d5bf Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Sun, 30 Oct 2022 11:04:21 +0100 Subject: [PATCH 16/21] Bump axios to 1.1.2 --- engine-wizard/index.js | 2 +- package-lock.json | 34 +++++++++++++++++++++++----------- package.json | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/engine-wizard/index.js b/engine-wizard/index.js index 2f694b505..8d6c360e0 100644 --- a/engine-wizard/index.js +++ b/engine-wizard/index.js @@ -1,6 +1,6 @@ 'use strict' -const axios = require('axios') +const axios = require('axios').default const axiosRetry = require('axios-retry') const program = require('./elm/Wizard.elm') diff --git a/package-lock.json b/package-lock.json index 702096b2f..f75587825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", - "axios": "^0.27.2", + "axios": "1.1.2", "axios-retry": "^3.3.1", "bootstrap": "^5.2.2", "chart.js": "^3.9.1", @@ -1273,12 +1273,13 @@ "dev": true }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.2.tgz", + "integrity": "sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA==", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/axios-retry": { @@ -6897,6 +6898,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -10223,12 +10229,13 @@ "dev": true }, "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.2.tgz", + "integrity": "sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA==", "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" }, "dependencies": { "form-data": { @@ -14415,6 +14422,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", diff --git a/package.json b/package.json index 5027cc925..444b39968 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", - "axios": "^0.27.2", + "axios": "1.1.2", "axios-retry": "^3.3.1", "bootstrap": "^5.2.2", "chart.js": "^3.9.1", From f4eec3644fc915463f10f37329b93f0f3d31e785 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 31 Oct 2022 08:30:27 +0100 Subject: [PATCH 17/21] [DSW-1554] Fix offering project template that is migrating --- engine-shared/elm/Shared/Api/Questionnaires.elm | 2 ++ .../elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm | 1 + .../elm/Wizard/Projects/Create/TemplateCreate/Update.elm | 1 + engine-wizard/elm/Wizard/Projects/Index/Update.elm | 1 + 4 files changed, 5 insertions(+) diff --git a/engine-shared/elm/Shared/Api/Questionnaires.elm b/engine-shared/elm/Shared/Api/Questionnaires.elm index b134082a7..f2f22d01c 100644 --- a/engine-shared/elm/Shared/Api/Questionnaires.elm +++ b/engine-shared/elm/Shared/Api/Questionnaires.elm @@ -50,6 +50,7 @@ import Uuid exposing (Uuid) type alias GetQuestionnairesFilters = { isTemplate : Maybe Bool + , isMigrating : Maybe Bool , userUuids : Maybe String , userUuidsOp : Maybe FilterOperator , projectTags : Maybe String @@ -65,6 +66,7 @@ getQuestionnaires filters qs = extraParams = PaginationQueryString.filterParams <| [ ( "isTemplate", Maybe.map boolToString filters.isTemplate ) + , ( "isMigrating", Maybe.map boolToString filters.isMigrating ) , ( "userUuids", filters.userUuids ) , ( "userUuidsOp", Maybe.map FilterOperator.toString filters.userUuidsOp ) , ( "projectTags", filters.projectTags ) diff --git a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm index d7b9ba690..30cb3147c 100644 --- a/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm +++ b/engine-wizard/elm/Wizard/Dashboard/Dashboards/ResearcherDashboard.elm @@ -49,6 +49,7 @@ fetchData appState = in QuestionnairesApi.getQuestionnaires { isTemplate = Just False + , isMigrating = Nothing , userUuids = mbUserUuid , userUuidsOp = Nothing , projectTags = Nothing diff --git a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm index 7a3fcf2ac..c6e09c8cf 100644 --- a/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Create/TemplateCreate/Update.elm @@ -96,6 +96,7 @@ handlePackageTypeHintInputMsg wrapMsg typeHintInputMsg appState model = , getTypeHints = QuestionnairesApi.getQuestionnaires { isTemplate = Just True + , isMigrating = Just False , userUuids = Nothing , userUuidsOp = Nothing , projectTags = Nothing diff --git a/engine-wizard/elm/Wizard/Projects/Index/Update.elm b/engine-wizard/elm/Wizard/Projects/Index/Update.elm index a9de026a0..ab3f5c04b 100644 --- a/engine-wizard/elm/Wizard/Projects/Index/Update.elm +++ b/engine-wizard/elm/Wizard/Projects/Index/Update.elm @@ -326,6 +326,7 @@ listingUpdateConfig wrapMsg appState model = { getRequest = QuestionnairesApi.getQuestionnaires { isTemplate = isTemplate + , isMigrating = Nothing , userUuids = users , userUuidsOp = usersOp , projectTags = projectTags From affc5f90ce755bdaed879d5bb463870a86a5bea1 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 31 Oct 2022 08:32:19 +0100 Subject: [PATCH 18/21] Fix updated label in list views --- engine-wizard/elm/Wizard/Common/Components/Listing/View.elm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm b/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm index aca1b0580..380751d7a 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Listing/View.elm @@ -30,6 +30,7 @@ import Shared.Data.PaginationQueryFilters as PaginationQueryFilters exposing (Pa import Shared.Data.PaginationQueryString as PaginationQueryString exposing (PaginationQueryString, SortDirection(..)) import Shared.Html exposing (emptyNode, fa, faSet) import Shared.Undraw as Undraw +import String.Format as String import Time import Time.Distance exposing (inWordsWithConfig) import Wizard.Common.AppState exposing (AppState) @@ -568,7 +569,7 @@ viewUpdated appState config item = TimeUtils.toReadableDateTime appState.timeZone time in span (tooltip readableTime) - [ text <| gettext "Updated" appState.locale ++ inWordsWithConfig { withAffix = True } (locale appState) time updated.currentTime ] + [ text <| String.format (gettext "Updated %s" appState.locale) [ inWordsWithConfig { withAffix = True } (locale appState) time updated.currentTime ] ] Nothing -> emptyNode From d7e0c80f1214cfd1546c855c97d4392da939aea4 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 31 Oct 2022 10:43:27 +0100 Subject: [PATCH 19/21] Fix integration visible name --- engine-shared/elm/Shared/Data/KnowledgeModel.elm | 2 +- .../elm/Shared/Data/KnowledgeModel/Integration.elm | 8 +++++++- .../elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm | 2 +- .../elm/Wizard/KMEditor/Editor/Components/KMEditor.elm | 6 +++--- .../Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm | 2 +- .../elm/Wizard/KMEditor/Migration/View/DiffTree.elm | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel.elm b/engine-shared/elm/Shared/Data/KnowledgeModel.elm index 3194deffd..3ab956748 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel.elm @@ -365,7 +365,7 @@ getTagName km uuid = getIntegrationName : KnowledgeModel -> String -> String getIntegrationName km uuid = - Maybe.unwrap "" Integration.getName <| getIntegration uuid km + Maybe.unwrap "" Integration.getVisibleName <| getIntegration uuid km getQuestionName : KnowledgeModel -> String -> String diff --git a/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm b/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm index 454700d97..deb161205 100644 --- a/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm +++ b/engine-shared/elm/Shared/Data/KnowledgeModel/Integration.elm @@ -17,6 +17,7 @@ module Shared.Data.KnowledgeModel.Integration exposing , getResponseListField , getTypeString , getUuid + , getVisibleName , getWidgetUrl ) @@ -82,7 +83,12 @@ getId = getName : Integration -> String -getName integration = +getName = + .name << getCommonIntegrationData + + +getVisibleName : Integration -> String +getVisibleName integration = let name = (getCommonIntegrationData integration).name diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm index b25198a48..9883b5035 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Common/EditorBranch.elm @@ -254,7 +254,7 @@ getEditorName appState uuid editorBranch = getEditorName_ (String.withDefault (gettext "Untitled tag" appState.locale) << .name) KnowledgeModel.getTag getIntegrationName = - getEditorName_ (String.withDefault (gettext "Untitled integration" appState.locale) << Integration.getName) KnowledgeModel.getIntegration + getEditorName_ (String.withDefault (gettext "Untitled integration" appState.locale) << Integration.getVisibleName) KnowledgeModel.getIntegration getAnswerName = getEditorName_ (String.withDefault (gettext "Untitled answer" appState.locale) << .label) KnowledgeModel.getAnswer diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm index 799416ce9..f558170b3 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor.elm @@ -999,7 +999,7 @@ viewQuestionEditor { appState, wrapMsg, eventMsg, model, editorBranch } question integrationUuidOptions = KnowledgeModel.getIntegrations editorBranch.branch.knowledgeModel |> EditorBranch.filterDeletedWith Integration.getUuid editorBranch - |> List.map (\integration -> ( Integration.getUuid integration, String.withDefault (gettext "Untitled integration" appState.locale) (Integration.getName integration) )) + |> List.map (\integration -> ( Integration.getUuid integration, String.withDefault (gettext "Untitled integration" appState.locale) (Integration.getVisibleName integration) )) |> (::) ( Uuid.toString Uuid.nil, gettext "- select integration -" appState.locale ) selectedIntegrationProps = @@ -1578,13 +1578,13 @@ viewIntegrationEditor { appState, wrapMsg, eventMsg, integrationPrefabs, editorB li [] [ a [ onClick (createEditEventFromPrefab i) ] [ viewLogo i - , span [] [ text (Integration.getName i) ] + , span [] [ text (Integration.getVisibleName i) ] ] ] in div [ class "prefab-selection" ] [ strong [] [ text (gettext "Quick setup" appState.locale) ] - , ul [] (List.map viewIntegrationButton <| List.sortBy Integration.getName integrationPrefabs) + , ul [] (List.map viewIntegrationButton <| List.sortBy Integration.getVisibleName integrationPrefabs) ] else diff --git a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm index 125a69707..43f2d3f5c 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Editor/Components/KMEditor/Tree.elm @@ -167,7 +167,7 @@ treeNodeIntegration props appState editorBranch integration = config = { uuid = Integration.getUuid integration , icon = faSet "km.integration" appState - , label = Integration.getName integration + , label = Integration.getVisibleName integration , children = [] , untitledLabel = gettext "Untitled integration" appState.locale } diff --git a/engine-wizard/elm/Wizard/KMEditor/Migration/View/DiffTree.elm b/engine-wizard/elm/Wizard/KMEditor/Migration/View/DiffTree.elm index 790ca5e5e..936686420 100644 --- a/engine-wizard/elm/Wizard/KMEditor/Migration/View/DiffTree.elm +++ b/engine-wizard/elm/Wizard/KMEditor/Migration/View/DiffTree.elm @@ -48,7 +48,7 @@ viewEvent appState kmName km event = Maybe.map .name <| KnowledgeModel.getTag commonData.entityUuid km getIntegrationName commonData = - Maybe.map Integration.getName <| KnowledgeModel.getIntegration commonData.entityUuid km + Maybe.map Integration.getVisibleName <| KnowledgeModel.getIntegration commonData.entityUuid km getQuestionTitle commonData = Maybe.map Question.getTitle <| KnowledgeModel.getQuestion commonData.entityUuid km From 59b9eb79864c8c41aa27e7b87fb70f18fa0e8f60 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 31 Oct 2022 10:53:30 +0100 Subject: [PATCH 20/21] Fix feedback modal title --- .../Questionnaire/FeedbackModal.elm | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm index c9244f8c8..2293925d4 100644 --- a/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm +++ b/engine-wizard/elm/Wizard/Common/Components/Questionnaire/FeedbackModal.elm @@ -6,8 +6,6 @@ module Wizard.Common.Components.Questionnaire.FeedbackModal exposing , view ) ---import Shared.Locale exposing (l, lf, lg, lh, lx) - import ActionResult exposing (ActionResult(..)) import Form exposing (Form) import Gettext exposing (gettext) @@ -27,27 +25,6 @@ import Wizard.Common.View.FormGroup as FormGroup import Wizard.Common.View.Modal as Modal - ---l_ : String -> AppState -> String ---l_ = --- l "Wizard.Common.Components.Questionnaire.FeedbackModal" --- --- ---lf_ : String -> List String -> AppState -> String ---lf_ = --- lf "Wizard.Common.Components.Questionnaire.FeedbackModal" --- --- ---lh_ : String -> List (Html msg) -> AppState -> List (Html msg) ---lh_ = --- lh "Wizard.Common.Components.Questionnaire.FeedbackModal" --- --- ---lx_ : String -> AppState -> Html msg ---lx_ = --- lx "Wizard.Common.Components.Questionnaire.FeedbackModal" - - type alias Model = { target : Maybe ( String, String ) , feedbacks : ActionResult (List Feedback) @@ -167,7 +144,7 @@ view appState model = ( gettext "Send" appState.locale, FeedbackFormMsg Form.Submit, Just <| CloseFeedback ) modalConfig = - { modalTitle = gettext "Title" appState.locale + { modalTitle = gettext "Feedback" appState.locale , modalContent = modalContent , visible = visible , actionResult = ActionResult.map (\_ -> gettext "Your feedback has been sent." appState.locale) model.feedbackResult From dfd1a40ca8effda31648dd8d5480da187de1ea3c Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 31 Oct 2022 09:16:34 +0100 Subject: [PATCH 21/21] 3.17.0 --- package-lock.json | 2 +- package.json | 2 +- wizard-style-builder/package-lock.json | 2 +- wizard-style-builder/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f75587825..1590fc976 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "engine-frontend", - "version": "3.16.0", + "version": "3.17.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 444b39968..ccc962ba3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "engine-frontend", - "version": "3.16.0", + "version": "3.17.0", "repository": "https://github.com/ds-wizard/engine-frontend", "license": "Apache-2.0", "scripts": { diff --git a/wizard-style-builder/package-lock.json b/wizard-style-builder/package-lock.json index 15ff835f5..53acbf2f6 100644 --- a/wizard-style-builder/package-lock.json +++ b/wizard-style-builder/package-lock.json @@ -1,6 +1,6 @@ { "name": "wizard-style-builder", - "version": "3.16.0", + "version": "3.17.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/wizard-style-builder/package.json b/wizard-style-builder/package.json index fe0310a36..cb8b4921e 100644 --- a/wizard-style-builder/package.json +++ b/wizard-style-builder/package.json @@ -1,6 +1,6 @@ { "name": "wizard-style-builder", - "version": "3.16.0", + "version": "3.17.0", "description": "", "main": "index.js", "scripts": {