Skip to content

Commit 46ce3ca

Browse files
authored
Merge pull request #8141 from csbisa/fluent-fixes
Fix several translation usages
2 parents 8a7fcc3 + 6f3b8a4 commit 46ce3ca

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

resources/public/i18n/en.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ game_agenda-count-with-req = {$agenda-point ->
409409
410410
game_approach-ice = Approach ice
411411
412+
game_approach-server = Approach server
413+
412414
game_archives = Archives ({$faceup}{$facedown} ↓)
413415
414416
game_attempt-reconnect = Attempt reconnect

src/cljs/nr/gameboard/board.cljs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,12 +1537,16 @@
15371537
(<= pos (count run-ice)))
15381538
(nth run-ice (dec pos))))))
15391539

1540-
(def phase->title
1541-
{"initiation" (tr [:game_initiation "Initiation"])
1542-
"approach-ice" (tr [:game_approach-ice "Approach ice"])
1543-
"encounter-ice" (tr [:game_encounter-ice "Encounter ice"])
1544-
"movement" (tr [:game_movement "Movement"])
1545-
"success" (tr [:game_success "Success"])})
1540+
(defn phase->title
1541+
[phase]
1542+
(case phase
1543+
"initiation" (tr [:game_initiation "Initiation"])
1544+
"approach-ice" (tr [:game_approach-ice "Approach ice"])
1545+
"approach-server" (tr [:game_approach-server "Approach server"])
1546+
"encounter-ice" (tr [:game_encounter-ice "Encounter ice"])
1547+
"movement" (tr [:game_movement "Movement"])
1548+
"success" (tr [:game_success "Success"])
1549+
nil))
15461550

15471551
(defn phase->next-phase-title
15481552
([run] (phase->next-phase-title (:phase @run) (:position @run)))
@@ -1575,7 +1579,7 @@
15751579
(when (or (:button @app-state) (get-in @app-state [:options :display-encounter-info]))
15761580
[encounter-info-div ice])])
15771581
(when @run
1578-
[:h4 (tr [:game_current-phase "Current phase"]) ":" [:br] (get phase->title (:phase @run) (tr [:game_unknown-phase "Unknown phase"]))])
1582+
[:h4 (tr [:game_current-phase "Current phase"]) ":" [:br] (or (phase->title (:phase @run)) (tr [:game_unknown-phase "Unknown phase"]))])
15791583

15801584
(cond
15811585
(and (= "approach-ice" (:phase @run))
@@ -1612,9 +1616,9 @@
16121616
;; initiation
16131617
(= "initiation" (:phase @run))
16141618
[cond-button
1615-
(str (tr [:game.continue-to "Continue to"]) " " (if (zero? (:position @run))
1616-
(tr [:game.approach-server "Approach server"])
1617-
(tr [:game.approach-ice "Approach ice"])))
1619+
(tr [:game_continue-to "Continue to"] {:phase (if (zero? (:position @run))
1620+
(tr [:game_approach-server "Approach server"])
1621+
(tr [:game_approach-ice "Approach ice"]))})
16181622
(not= "corp" (:no-action @run))
16191623
#(send-command "continue")]
16201624

@@ -1658,7 +1662,7 @@
16581662
(when (or (:button @app-state) (get-in @app-state [:options :display-encounter-info]))
16591663
[encounter-info-div ice])])
16601664
(when @run
1661-
[:h4 (tr [:game_current-phase "Current phase"]) ":" [:br] (get phase->title phase)])
1665+
[:h4 (tr [:game_current-phase "Current phase"]) ":" [:br] (phase->title phase)])
16621666

16631667
(cond
16641668
(and (:next-phase @run)
@@ -1671,9 +1675,9 @@
16711675

16721676
(= "initiation" (:phase @run))
16731677
[cond-button
1674-
(str (tr [:game.continue-to "Continue to"]) " " (if (zero? (:position @run))
1675-
(tr [:game.approach-server "Approach server"])
1676-
(tr [:game.approach-ice "Approach ice"])))
1678+
(tr [:game_continue-to "Continue to"] {:phase (if (zero? (:position @run))
1679+
(tr [:game_approach-server "Approach server"])
1680+
(tr [:game_approach-ice "Approach ice"]))})
16771681
(not= "runner" (:no-action @run))
16781682
#(send-command "continue")]
16791683

src/cljs/nr/navbar.cljs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,54 @@
99
goog.history.Html5History))
1010

1111
(def navbar-links
12-
[{:title (tr [:nav_welcome "Welcome"])
12+
[{:title [:nav_welcome "Welcome"]
1313
:cls "landing"
1414
:route "/"}
15-
{:title (tr [:nav_chat "Chat"])
15+
{:title [:nav_chat "Chat"]
1616
:cls "chat"
1717
:route "/chat"}
18-
{:title (tr [:nav_cards "Cards"])
18+
{:title [:nav_cards "Cards"]
1919
:cls "card"
2020
:route "/cards"}
21-
{:title (tr [:nav_deck-builder "Deck Builder"])
21+
{:title [:nav_deck-builder "Deck Builder"]
2222
:cls "deckbuilder"
2323
:route "/deckbuilder"}
24-
{:title (tr [:nav_play "Play"])
24+
{:title [:nav_play "Play"]
2525
:cls "play"
2626
:route "/play"}
27-
{:title (tr [:nav_help "Help"])
27+
{:title [:nav_help "Help"]
2828
:cls "help"
2929
:route "/help"}
30-
{:title (tr [:nav_settings "Settings"])
30+
{:title [:nav_settings "Settings"]
3131
:cls "settings"
3232
:route "/account"
3333
:show? :user}
34-
{:title (tr [:nav_stats "Stats"])
34+
{:title [:nav_stats "Stats"]
3535
:cls "stats"
3636
:route "/stats"
3737
:show? :user}
38-
{:title (tr [:nav_about "About"])
38+
{:title [:nav_about "About"]
3939
:cls "about"
4040
:route "/about"}
41-
{:title (tr [:nav_tournaments "Tournaments"])
41+
{:title [:nav_tournaments "Tournaments"]
4242
:cls "tournaments"
4343
:route "/tournament"
4444
:show? #(:tournament-organizer (:user %))}
45-
{:title (tr [:nav_admin "Admin"])
45+
{:title [:nav_admin "Admin"]
4646
:cls "admin"
4747
:route "/admin"
4848
:show? #(:isadmin (:user %))}
49-
{:title (tr [:nav_users "Users"])
49+
{:title [:nav_users "Users"]
5050
:cls "users"
5151
:route "/users"
5252
:show? #(or (:isadmin (:user %))
5353
(:ismoderator (:user %)))}
54-
{:title (tr [:nav_users "Prizes"])
54+
{:title [:nav_prizes "Prizes"]
5555
:cls "prizes"
5656
:route "/prizes"
5757
:show? #(or (:isadmin (:user %))
5858
(:ismoderator (:user %)))}
59-
{:title (tr [:nav_features "Features"])
59+
{:title [:nav_features "Features"]
6060
:cls "features"
6161
:route "/features"
6262
:show? #(:isadmin (:user %))}])
@@ -80,8 +80,8 @@
8080
(show? @app-state))
8181
[:li {:class (if (= (:path @routes/current-view) route) "active" "")
8282
:id (str cls "-nav")
83-
:key title
83+
:key (tr title)
8484
; :on-click #(.setToken history route)
8585
:data-target "#main"
8686
:data-slide-to idx}
87-
[:a {:href route} title]])))])
87+
[:a {:href route} (tr title)]])))])

0 commit comments

Comments
 (0)