Skip to content

Commit

Permalink
Start setting up an Internationalisation module for #10
Browse files Browse the repository at this point in the history
  • Loading branch information
hilverd committed Dec 1, 2023
1 parent 2abc93a commit 80acc91
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
11 changes: 11 additions & 0 deletions src/Internationalisation.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Internationalisation exposing (sandboxModeMessage)

{-| User interface text in a specific language (e.g. English).
-}

import Internationalisation.Eng as I18n


sandboxModeMessage : String
sandboxModeMessage =
I18n.sandboxModeMessage
5 changes: 4 additions & 1 deletion src/Components/Copy.elm → src/Internationalisation/Eng.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module Components.Copy exposing (sandboxModeMessage)
module Internationalisation.Eng exposing (sandboxModeMessage)

{-| User interface text in the English language.
-}


sandboxModeMessage : String
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/CreateOrEdit.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Browser.Dom as Dom
import CommonModel exposing (CommonModel)
import Components.Badge
import Components.Button
import Components.Copy
import Components.DropdownMenu
import Components.Form
import Components.GlossaryItemCard
Expand Down Expand Up @@ -42,6 +41,7 @@ import Html.Attributes exposing (class, id, required, style)
import Html.Events
import Http
import Icons
import Internationalisation as I18n
import PageMsg exposing (PageMsg)
import QueryParameters
import Set exposing (Set)
Expand Down Expand Up @@ -1085,7 +1085,7 @@ viewCreateFormFooter model =
, Extras.Html.showIf common.enableSavingChangesInMemory <|
div
[ class "mt-2 mb-2 text-sm text-gray-500 dark:text-gray-400 sm:text-right" ]
[ text Components.Copy.sandboxModeMessage ]
[ text I18n.sandboxModeMessage ]
, div
[ class "flex items-center" ]
[ Components.Button.white
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/EditTitleAndAbout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Browser.Dom as Dom
import CommonModel exposing (CommonModel)
import Components.AboutSection
import Components.Button
import Components.Copy
import Components.Form
import Components.Spinner
import Data.AboutLink as AboutLink
Expand All @@ -30,6 +29,7 @@ import Html.Attributes exposing (class, for, id, name, placeholder, required, sp
import Html.Events
import Http
import Icons
import Internationalisation as I18n
import PageMsg exposing (PageMsg)
import Svg.Attributes
import Task
Expand Down Expand Up @@ -559,7 +559,7 @@ viewCreateFormFooter model showValidationErrors glossaryItems =
, Extras.Html.showIf model.common.enableSavingChangesInMemory <|
div
[ class "mt-2 mb-2 text-sm text-gray-500 dark:text-gray-400 sm:text-right" ]
[ text Components.Copy.sandboxModeMessage ]
[ text I18n.sandboxModeMessage ]
, div
[ class "flex items-center" ]
[ Components.Button.white
Expand Down
6 changes: 3 additions & 3 deletions src/Pages/ListAll.elm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import CommonModel exposing (CommonModel)
import Components.AboutSection
import Components.Badge
import Components.Button
import Components.Copy
import Components.Dividers
import Components.DropdownMenu
import Components.GlossaryItemCard
Expand Down Expand Up @@ -75,6 +74,7 @@ import Html.Attributes exposing (class, for, href, id, readonly)
import Html.Events
import Http
import Icons
import Internationalisation as I18n
import PageMsg exposing (PageMsg)
import Process
import QueryParameters
Expand Down Expand Up @@ -1376,7 +1376,7 @@ viewConfirmDeleteModal enableSavingChangesInMemory maybeIdOfItemToDelete deletin
, Extras.Html.showIf enableSavingChangesInMemory <|
div
[ class "mt-5 sm:mt-4 text-sm text-gray-500 dark:text-gray-400 sm:text-right" ]
[ text Components.Copy.sandboxModeMessage ]
[ text I18n.sandboxModeMessage ]
, case deleting of
SavingFailed errorMessage ->
div
Expand Down Expand Up @@ -1439,7 +1439,7 @@ viewMakeChangesButton showSandboxModeMessage tabbable =
, Extras.Html.showIf showSandboxModeMessage <|
div
[ class "my-4 text-sm text-gray-500 dark:text-gray-400" ]
[ text Components.Copy.sandboxModeMessage ]
[ text I18n.sandboxModeMessage ]
]


Expand Down
4 changes: 2 additions & 2 deletions src/Pages/ManageTags.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Browser exposing (Document)
import Browser.Dom as Dom
import CommonModel exposing (CommonModel)
import Components.Button
import Components.Copy
import Components.Form
import Components.Spinner
import Data.Glossary as Glossary exposing (Glossary)
Expand All @@ -27,6 +26,7 @@ import Html.Attributes exposing (class, id)
import Html.Events
import Http
import Icons
import Internationalisation as I18n
import PageMsg exposing (PageMsg)
import Svg.Attributes
import TagsForm as Form exposing (Row, TagsForm)
Expand Down Expand Up @@ -492,7 +492,7 @@ viewFooter model showValidationErrors glossaryItems =
, Extras.Html.showIf model.common.enableSavingChangesInMemory <|
div
[ class "mt-2 mb-2 text-sm text-gray-500 dark:text-gray-400 sm:text-right" ]
[ text Components.Copy.sandboxModeMessage ]
[ text I18n.sandboxModeMessage ]
, div
[ class "flex items-center" ]
[ Components.Button.white
Expand Down

0 comments on commit 80acc91

Please sign in to comment.