Skip to content

Commit c25c996

Browse files
Finish with the finalize event translations
1 parent 6a85fc1 commit c25c996

File tree

16 files changed

+119
-32
lines changed

16 files changed

+119
-32
lines changed

src/lang/el-GR.edn

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,31 @@
324324

325325
:renderer.tool.impl.element.polyshape
326326
{:add-points "Κάντε κλικ για να προσθέτε σημεία."
327-
:finalize-shape "Διπλό κλικ για να οριστικοποιήσετε το σχήμα."}
327+
:finalize-shape "Διπλό κλικ για να οριστικοποιήσετε το σχήμα."
328+
:create-tool "Δημιουργία %1"}
328329

329330
:renderer.tool.impl.element.rect
330331
{:name "Ορθογώνιο παραλληλόγραμμο"
331-
:help [:div "Κρατήστε %1 για να κλειδώσετε τις αναλογίες."]}
332+
:help [:div "Κρατήστε %1 για να κλειδώσετε τις αναλογίες."]
333+
:create-rectangle "Δημιουργία ορθ. παραλληλόγραμου"}
332334

333335
:renderer.tool.impl.element.svg
334-
{:help [:div "Κρατήστε %1 για να κλειδώσετε τις αναλογίες."]}
336+
{:help [:div "Κρατήστε %1 για να κλειδώσετε τις αναλογίες."]
337+
:create-svg "Δημιουργία svg"}
338+
339+
:renderer.tool.impl.extension.blob
340+
{:create-blob "Δημιουργία blob"}
341+
342+
:renderer.tool.impl.misc.dropper
343+
{:help "Κάντε κλικ οπουδήποτε για να επιλέξετε χρώμα."
344+
:pick-color "Επιλογή χρώματος"}
345+
346+
:renderer.tool.impl.misc.fill
347+
{:help "Κάντε κλικ σε ένα στοιχείο για γέμισμα."
348+
:fill "Γέμισμα"}
349+
350+
:renderer.tool.impl.misc.measure
351+
{:help "Κάντε κλικ και σύρετε για να μετρήσετε μια απόσταση."}
335352

336353
:renderer.attribute.impl.stroke-linecap
337354
{:description "Η ιδιότητα stroke-linecap είναι μια ιδιότητα παρουσίασης που καθορίζει το σχήμα που θα χρησιμοποιηθεί στο τέλος των ανοιχτών υποδιαδρομών
@@ -426,6 +443,24 @@
426443
{:zoom-in [:div "Κάντε κλικ ή επιλέξτε μια περιοχή για μεγέθυνση."]
427444
:zoom-out [:div "Κρατήστε %1 για σμίκρυνση."]}
428445

446+
:renderer.tool.impl.draw.brush
447+
{:draw-brush "Πινέλο σχεδίασης"}
448+
449+
:renderer.tool.impl.draw.pen
450+
{:draw-line "Σχεδίαση γραμμής"}
451+
452+
:renderer.tool.impl.draw.core
453+
{:help "Κάντε κλικ και σύρετε για να σχεδιάσετε."}
454+
455+
:renderer.tool.impl.element.circle
456+
{:create-circle "Δημιουργία κύκλου"}
457+
458+
:renderer.tool.impl.element.ellipse
459+
{:create-ellipse "Δημιουργία έλλειψης"}
460+
461+
:renderer.tool.impl.element.line
462+
{:create-line "Δημιουργία γραμμής"}
463+
429464
:renderer.document.events
430465
{:save-changes "Θέλετε να αποθηκεύσετε τις αλλαγές σας?"
431466
:create-doc "Δημιουργία εγγράφου"
@@ -528,6 +563,9 @@
528563
:bounds-center "κέντρο ορίων"
529564
:bounds-midpoint "μέσο σημείο ορίων"}
530565

566+
:renderer.history.events
567+
{:clear-history "Εκκαθάριση ιστορικού"}
568+
531569
:renderer.history.views
532570
{:center-view "Κεντρική προβολή"
533571
:clear-history "Εκκαθάριση ιστορικού"

src/lang/en-US.edn

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,31 @@
354354

355355
:renderer.tool.impl.element.polyshape
356356
{:add-points "Click to add more points."
357-
:finalize-shape "Double click to finalize the shape."}
357+
:finalize-shape "Double click to finalize the shape."
358+
:create-tool "Create %1"}
358359

359360
:renderer.tool.impl.element.rect
360361
{:name "Rectangle"
361-
:help [:div "Hold %1 to lock proportions."]}
362+
:help [:div "Hold %1 to lock proportions."]
363+
:create-rectangle "Create rectangle"}
362364

363365
:renderer.tool.impl.element.svg
364-
{:help [:div "Hold %1 to lock proportions."]}
366+
{:help [:div "Hold %1 to lock proportions."]
367+
:create-svg "Create svg"}
368+
369+
:renderer.tool.impl.extension.blob
370+
{:create-blob "Create blob"}
371+
372+
:renderer.tool.impl.misc.dropper
373+
{:help "Click anywhere to pick a color."
374+
:pick-color "Pick color"}
375+
376+
:renderer.tool.impl.misc.fill
377+
{:help "Click on an element to fill."
378+
:fill "Fill"}
379+
380+
:renderer.tool.impl.misc.measure
381+
{:help "Click and drag to measure a distance."}
365382

366383
:renderer.tool.impl.element.text
367384
{:help "Click to start typing."}
@@ -457,6 +474,24 @@
457474
{:zoom-in [:div "Click or select an area to zoom in."]
458475
:zoom-out [:div "Hold %1 to zoom out."]}
459476

477+
:renderer.tool.impl.draw.brush
478+
{:draw-brush "Draw brush"}
479+
480+
:renderer.tool.impl.draw.pen
481+
{:draw-line "Draw line"}
482+
483+
:renderer.tool.impl.draw.core
484+
{:help "Click and drag to draw."}
485+
486+
:renderer.tool.impl.element.circle
487+
{:create-circle "Create circle"}
488+
489+
:renderer.tool.impl.element.ellipse
490+
{:create-ellipse "Create ellipse"}
491+
492+
:renderer.tool.impl.element.line
493+
{:create-line "Create line"}
494+
460495
:renderer.document.events
461496
{:save-changes "Do you want to save your changes?"
462497
:create-doc "Create document"
@@ -559,6 +594,9 @@
559594
:bounds-center "bounds center"
560595
:bounds-midpoint "bounds midpoint"}
561596

597+
:renderer.history.events
598+
{:clear-history "Clear history"}
599+
562600
:renderer.history.views
563601
{:center-view "Center view"
564602
:clear-history "Clear history"

src/renderer/history/events.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
(:require
33
[re-frame.core :as rf]
44
[renderer.app.effects :as app.effects]
5-
[renderer.history.handlers :as history.handlers]))
5+
[renderer.history.handlers :as history.handlers]
6+
[renderer.utils.i18n :refer [t]]))
67

78
(rf/reg-event-db
89
::undo
@@ -45,7 +46,7 @@
4546
::clear
4647
(fn [db _]
4748
(-> (history.handlers/clear db)
48-
(history.handlers/finalize "Clear history"))))
49+
(history.handlers/finalize #(t [::clear-history "Clear history"])))))
4950

5051
(rf/reg-event-db
5152
::tree-view-updated

src/renderer/tool/impl/draw/brush.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
[renderer.history.handlers :as history.handlers]
1212
[renderer.tool.handlers :as tool.handlers]
1313
[renderer.tool.hierarchy :as tool.hierarchy]
14-
[renderer.tool.subs :as-alias tool.subs]))
14+
[renderer.tool.subs :as-alias tool.subs]
15+
[renderer.utils.i18n :refer [t]]))
1516

1617
(derive :brush ::tool.hierarchy/draw)
1718

@@ -66,7 +67,7 @@
6667
(defmethod tool.hierarchy/on-drag-end :brush
6768
[db _e]
6869
(-> db
69-
(history.handlers/finalize "Draw brush")
70+
(history.handlers/finalize #(t [::draw-brush "Draw brush"]))
7071
(tool.handlers/activate :transform)))
7172

7273
(defmethod tool.hierarchy/render :brush

src/renderer/tool/impl/draw/core.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
[renderer.tool.handlers :as tool.handlers]
44
[renderer.tool.hierarchy :as tool.hierarchy]
55
[renderer.tool.impl.draw.brush]
6-
[renderer.tool.impl.draw.pen]))
6+
[renderer.tool.impl.draw.pen]
7+
[renderer.utils.i18n :refer [t]]))
78

89
(derive ::tool.hierarchy/draw ::tool.hierarchy/tool)
910

1011
(defmethod tool.hierarchy/help [::tool.hierarchy/draw :idle]
1112
[]
12-
"Click and drag to draw.")
13+
(t [::help "Click and drag to draw."]))
1314

1415
(defmethod tool.hierarchy/on-activate ::tool.hierarchy/draw
1516
[db]

src/renderer/tool/impl/draw/pen.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[renderer.tool.handlers :as tool.handlers]
1010
[renderer.tool.hierarchy :as tool.hierarchy]
1111
[renderer.utils.element :as utils.element]
12+
[renderer.utils.i18n :refer [t]]
1213
[renderer.utils.path :as utils.path]))
1314

1415
(derive :pen ::tool.hierarchy/draw)
@@ -46,5 +47,5 @@
4647
(update-in [:attrs :d] utils.path/manipulate :simplify))]
4748
(-> db
4849
(element.handlers/swap path)
49-
(history.handlers/finalize "Draw line")
50+
(history.handlers/finalize #(t [::draw-line "Draw line"]))
5051
(tool.handlers/activate :transform))))

src/renderer/tool/impl/element/circle.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[renderer.element.handlers :as element.handlers]
77
[renderer.history.handlers :as history.handlers]
88
[renderer.tool.handlers :as tool.handlers]
9-
[renderer.tool.hierarchy :as tool.hierarchy]))
9+
[renderer.tool.hierarchy :as tool.hierarchy]
10+
[renderer.utils.i18n :refer [t]]))
1011

1112
(derive :circle ::tool.hierarchy/element)
1213

@@ -42,7 +43,7 @@
4243
(defmethod tool.hierarchy/on-drag-end :circle
4344
[db _e]
4445
(-> db
45-
(history.handlers/finalize "Create circle")
46+
(history.handlers/finalize #(t [::create-circle "Create circle"]))
4647
(tool.handlers/activate :transform)))
4748

4849
(defmethod tool.hierarchy/snapping-points :circle

src/renderer/tool/impl/element/ellipse.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[renderer.element.handlers :as element.handlers]
66
[renderer.history.handlers :as history.handlers]
77
[renderer.tool.handlers :as tool.handlers]
8-
[renderer.tool.hierarchy :as tool.hierarchy]))
8+
[renderer.tool.hierarchy :as tool.hierarchy]
9+
[renderer.utils.i18n :refer [t]]))
910

1011
(derive :ellipse ::tool.hierarchy/element)
1112

@@ -54,5 +55,5 @@
5455
(defmethod tool.hierarchy/on-drag-end :ellipse
5556
[db _e]
5657
(-> db
57-
(history.handlers/finalize "Create ellipse")
58+
(history.handlers/finalize #(t [::create-ellipse "Create ellipse"]))
5859
(tool.handlers/activate :transform)))

src/renderer/tool/impl/element/line.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
[renderer.element.hierarchy :as element.hierarchy]
88
[renderer.history.handlers :as history.handlers]
99
[renderer.tool.handlers :as tool.handlers]
10-
[renderer.tool.hierarchy :as tool.hierarchy]))
10+
[renderer.tool.hierarchy :as tool.hierarchy]
11+
[renderer.utils.i18n :refer [t]]))
1112

1213
(derive :line ::tool.hierarchy/element)
1314

@@ -46,5 +47,5 @@
4647
(defmethod tool.hierarchy/on-drag-end :line
4748
[db _e]
4849
(-> db
49-
(history.handlers/finalize "Create line")
50+
(history.handlers/finalize #(t [::create-line "Create line"]))
5051
(tool.handlers/activate :transform)))

src/renderer/tool/impl/element/polyshape.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@
8080
(defmethod tool.hierarchy/on-double-click ::tool.hierarchy/polyshape
8181
[db _e]
8282
(-> (drop-last-point db)
83-
(history.handlers/finalize (str "Create " (name (:tool db))))
83+
(history.handlers/finalize #(t [::create-tool "Create %1"] [(name (:tool db))]))
8484
(tool.handlers/activate :transform)))

src/renderer/tool/impl/element/rect.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
(defmethod tool.hierarchy/help [:rect :create]
2020
[]
21-
(t [::help [:div "Hold %1 to lock proportions."]]
21+
(t [::help [:div "Hold %1 to lock proportions."]]
2222
[[:span.shortcut-key "Ctrl"]]))
2323

2424
(defn attributes
@@ -58,5 +58,5 @@
5858
(defmethod tool.hierarchy/on-drag-end :rect
5959
[db _e]
6060
(-> db
61-
(history.handlers/finalize "Create rectangle")
61+
(history.handlers/finalize #(t [::create-rectangle "Create rectangle"]))
6262
(tool.handlers/activate :transform)))

src/renderer/tool/impl/element/svg.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@
4848
(defmethod tool.hierarchy/on-drag-end :svg
4949
[db _e]
5050
(-> db
51-
(history.handlers/finalize "Create SVG")
51+
(history.handlers/finalize #(t [::create-svg "Create SVG"]))
5252
(tool.handlers/activate :transform)))

src/renderer/tool/impl/extension/blob.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
[renderer.element.hierarchy :as element.hierarchy]
88
[renderer.history.handlers :as history.handlers]
99
[renderer.tool.handlers :as tool.handlers]
10-
[renderer.tool.hierarchy :as tool.hierarchy]))
10+
[renderer.tool.hierarchy :as tool.hierarchy]
11+
[renderer.utils.i18n :refer [t]]))
1112

1213
(derive :blob ::tool.hierarchy/element)
1314

@@ -60,5 +61,5 @@
6061
(defmethod tool.hierarchy/on-drag-end :blob
6162
[db _e]
6263
(-> db
63-
(history.handlers/finalize "Create blob")
64+
(history.handlers/finalize #(t [::create-blob "Create blob"]))
6465
(tool.handlers/activate :transform)))

src/renderer/tool/impl/misc/dropper.cljs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
[renderer.notification.handlers :as notification.handlers]
99
[renderer.notification.views :as notification.views]
1010
[renderer.tool.handlers :as tool.handlers]
11-
[renderer.tool.hierarchy :as tool.hierarchy]))
11+
[renderer.tool.hierarchy :as tool.hierarchy]
12+
[renderer.utils.i18n :refer [t]]))
1213

1314
(derive :dropper ::tool.hierarchy/tool)
1415

@@ -18,7 +19,7 @@
1819

1920
(defmethod tool.hierarchy/help [:dropper :idle]
2021
[]
21-
"Click anywhere to pick a color.")
22+
(t [::help "Click anywhere to pick a color."]))
2223

2324
(defmethod tool.hierarchy/on-activate :dropper
2425
[db]
@@ -39,7 +40,7 @@
3940
(-> db
4041
(document.handlers/assoc-attr :fill srgb-color)
4142
(element.handlers/assoc-attr :fill srgb-color)
42-
(history.handlers/finalize "Pick color")
43+
(history.handlers/finalize #(t [::pick-color "Pick color"]))
4344
(tool.handlers/activate :transform)))))
4445

4546
(rf/reg-event-db

src/renderer/tool/impl/misc/fill.cljs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
[renderer.element.handlers :as element.handlers]
55
[renderer.history.handlers :as history.handlers]
66
[renderer.tool.handlers :as tool.handlers]
7-
[renderer.tool.hierarchy :as tool.hierarchy]))
7+
[renderer.tool.hierarchy :as tool.hierarchy]
8+
[renderer.utils.i18n :refer [t]]))
89

910
(derive :fill ::tool.hierarchy/tool)
1011

@@ -14,7 +15,7 @@
1415

1516
(defmethod tool.hierarchy/help [:fill :idle]
1617
[]
17-
"Click on an element to fill.")
18+
(t [::help "Click on an element to fill."]))
1819

1920
(defmethod tool.hierarchy/on-activate :fill
2021
[db]
@@ -25,4 +26,4 @@
2526
(let [color (document.handlers/attr db :fill)
2627
el-id (-> e :element :id)]
2728
(-> (element.handlers/set-attr db el-id :fill color)
28-
(history.handlers/finalize "Fill"))))
29+
(history.handlers/finalize #(t [::fill "Fill"])))))

src/renderer/tool/impl/misc/measure.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[renderer.element.handlers :as element.handlers]
88
[renderer.tool.handlers :as tool.handlers]
99
[renderer.tool.hierarchy :as tool.hierarchy]
10+
[renderer.utils.i18n :refer [t]]
1011
[renderer.utils.length :as utils.length]
1112
[renderer.utils.math :as utils.math]
1213
[renderer.utils.svg :as utils.svg]))
@@ -26,7 +27,7 @@
2627

2728
(defmethod tool.hierarchy/help [:measure :idle]
2829
[]
29-
"Click and drag to measure a distance.")
30+
(t [::help "Click and drag to measure a distance."]))
3031

3132
(defmethod tool.hierarchy/on-activate :measure
3233
[db]

0 commit comments

Comments
 (0)