Skip to content

Commit

Permalink
Add missing localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Deraen committed Oct 25, 2024
1 parent 978dc0a commit 46676e5
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 34 deletions.
24 changes: 19 additions & 5 deletions webapp/src/cljc/lipas/i18n/generated.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@
:add-subroute "Lisää osareitti"
:delete-route-prompt "Haluatko varmasti poistaa tämän reitin?"
:custom-rule "Oma lupa, sääntö, ohje"
:custom-rules "Omat säännöt"}
:custom-rules "Omat säännöt"
:add-subroute-ok "OK"
:route-is-made-of-subroutes "Reitti koostuu monesta erillisestä osuudesta"
:select-route-parts-on-map "Valitse reitin osat kartalta"
:finish-route-details "Reitti valmis"}
:newsletter
{:subscribe-short "Tilaa"
:subscribe "Tilaa uutiskirje"
Expand Down Expand Up @@ -1131,7 +1135,11 @@
:add-subroute "Lägg till delrutt"
:delete-route-prompt "Är du säker på att du vill ta bort den här rutten?"
:custom-rule "Egna tillstånd, regler, anvisningar"
:custom-rules "Egen regler"}
:custom-rules "Egen regler"
:add-subroute-ok "OK"
:route-is-made-of-subroutes "Rutten består av flera separata sektioner"
:select-route-parts-on-map "Välj ruttdelar på kartan"
:finish-route-details "Rutt färdig"}

:analysis
{:headline "Analysverktyg (beta)"
Expand Down Expand Up @@ -1551,7 +1559,8 @@
:add-new "Lägg till en idrottsanläggning",
:contact "Kontaktinformation",
:owner "Ägare",
:marketing-name "Varumärkesnamn"},
:marketing-name "Varumärkesnamn"
:no-permission-tab "Du har inte behörighet att redigera informationen på denna flik"},
:status
{:active "Aktiv",
:planned "Planerad"
Expand Down Expand Up @@ -2002,7 +2011,11 @@ Utflyktsmålets administratör ansvarar för uppgifternas riktighet och utflykts
:add-subroute "Add sub-route"
:delete-route-prompt "Are you sure you want to delete this route?"
:custom-rule "Custom permit, regulation, instruction"
:custom-rules "Custom instructions"}
:custom-rules "Custom instructions"
:add-subroute-ok "OK"
:route-is-made-of-subroutes "The route consists of multiple separate sections"
:select-route-parts-on-map "Select route parts on the map"
:finish-route-details "Route completed"}
:analysis
{:headline "Analysis Tool (beta)"
:description "The analysis tool can be used to evaluate the supply and accessibility of physical activity conditions by comparing the distance and travel times to physical activity facilities in relation to other facilities, population, and educational institutions."
Expand Down Expand Up @@ -2491,7 +2504,8 @@ Utflyktsmålets administratör ansvarar för uppgifternas riktighet och utflykts
:add-new "Add Sports Facility",
:contact "Contact",
:owner "Owner",
:marketing-name "Marketing name"},
:marketing-name "Marketing name"
:no-permission-tab "You do not have permission to edit the information on this tab"},
:status
{:active "Active",
:planned "Planned"
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/cljs/lipas/ui/map/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,6 @@
{:tr tr
:display-data display-data
:edit-data edit-data
;; FIXME: Only activities?
:read-only? (or (not editing?) (not can-publish?))
:types (vals types)
:size-categories size-categories
Expand Down Expand Up @@ -980,6 +979,7 @@
:on-change (partial set-field :properties)
:display-data (:properties display-data)
:edit-data (:properties edit-data)
:editing? (<== [:lipas.ui.sports-sites.subs/editing? lipas-id])
:geoms (-> edit-data :location :geometries)
:geom-type geom-type
:problems? problems?
Expand Down
47 changes: 23 additions & 24 deletions webapp/src/cljs/lipas/ui/sports_sites/activities/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,21 @@
[lui/expansion-panel
{:label (get-in field [:label locale])
:default-expanded false}
[lui/text-field
{:label (get-in field [:description locale])
:multiline true
:rows 5
:fullWidth true
:variant "outlined"
:on-change #(set-field prop-k locale %)
:value (get-in value [prop-k locale])}]]])])
(if read-only?
[->display-tf
{:label (get-in field [:description locale])
:mui-props {:fullWidth true}
:value (get-in value [prop-k locale])}
true
5]
[lui/text-field
{:label (get-in field [:description locale])
:multiline true
:rows 5
:fullWidth true
:variant "outlined"
:on-change #(set-field prop-k locale %)
:value (get-in value [prop-k locale])}])]])])

(defn duration
[{:keys [locale label description set-field value]}]
Expand Down Expand Up @@ -958,14 +965,16 @@
[:<>

[mui/grid {:item true :xs 12}
[mui/typography {:variant "body2"} "Valitse reitin osat kartalta"]]
[mui/typography
{:variant "body2"}
(tr :utp/select-route-parts-on-map)]]

[mui/grid {:item true :xs 12}
[mui/button
{:variant "contained"
:color "secondary"
:on-click #(==> [::events/finish-route])}
"OK"]]])
(tr :utp/add-subroute-ok)]]])

(when (and editing? (= :route-details mode))
[:<>
Expand Down Expand Up @@ -994,7 +1003,7 @@
:id selected-route-id
:route @route-form-state
:lipas-id lipas-id}])}
"Reitti valmis"]]
(tr :utp/finish-route-details)]]

;; Delete
[mui/grid {:item true}
Expand Down Expand Up @@ -1023,7 +1032,8 @@
[{:keys [read-only? _route-props lipas-id activity-k value
_locale _label _description _set-field _type-code]
:as props}]
(let [routes (if read-only?
(let [tr (<== [:lipas.ui.subs/translator])
routes (if read-only?
value
(<== [::subs/routes lipas-id activity-k]))
default-route-view (if (> (count routes) 1)
Expand All @@ -1044,7 +1054,7 @@

(when-not read-only?
[mui/grid {:item true :xs 12}
[lui/switch {:label "Reitti koostuu monesta erillisestä osuudesta"
[lui/switch {:label (tr :utp/route-is-made-of-subroutes)
:value (= :multi route-view)
:disabled (> route-count 1)
:on-change #(==> [::events/select-route-view ({true :multi false :single} %1)])}]])
Expand Down Expand Up @@ -1298,17 +1308,6 @@

;; Locale selector
[mui/grid {:item true :xs 12 :style {:padding-top "0.5em" :padding-bottom "0.5em"}}
#_[lui/select
{:value locale
:items {:fi "Suomi"
:se "Svenska"
:en "English"}
:label "Valitse kieli"
:label-fn second
:value-fn first
:on-change #(==> [:lipas.ui.events/set-translator %])}]

;; Language selector
[lang-selector {:locale locale}]]

;; Form
Expand Down
6 changes: 2 additions & 4 deletions webapp/src/cljs/lipas/ui/sports_sites/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
:on-change on-change}])))

(defn properties-form
[{:keys [tr edit-data display-data type-code on-change read-only?
[{:keys [tr edit-data editing? display-data type-code on-change read-only?
key geoms geom-type problems? width]}]
(let [locale (tr)
types-props (<== [::subs/types-props type-code])
Expand All @@ -577,9 +577,7 @@
{:key key
:read-only? read-only?}


(when (and edit-data
read-only?)
(when (and editing? read-only?)
[:> Alert
{:severity "info"}
(tr :lipas.sports-site/no-permission-tab)])
Expand Down

0 comments on commit 46676e5

Please sign in to comment.