mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 15:39:50 -05:00
🌐 i18N for viewer
This commit is contained in:
parent
2bcc229334
commit
e7e67c6ad8
5 changed files with 51 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(ns uxbox.view
|
(ns uxbox.view
|
||||||
(:require [uxbox.config]
|
(:require [uxbox.config]
|
||||||
|
[uxbox.view.locales :as lc]
|
||||||
[uxbox.view.store :as st]
|
[uxbox.view.store :as st]
|
||||||
[uxbox.view.ui :as ui]))
|
[uxbox.view.ui :as ui]))
|
||||||
|
|
||||||
|
|
15
frontend/src/uxbox/view/locales.cljs
Normal file
15
frontend/src/uxbox/view/locales.cljs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz>
|
||||||
|
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
||||||
|
|
||||||
|
(ns uxbox.view.locales
|
||||||
|
"Initialization namespace for i18n locale data."
|
||||||
|
(:require [uxbox.util.i18n :as i18n]
|
||||||
|
[uxbox.view.locales.en :as en]))
|
||||||
|
|
||||||
|
(defn init
|
||||||
|
[]
|
||||||
|
(vswap! i18n/locales assoc :en en/locales))
|
14
frontend/src/uxbox/view/locales/en.cljs
Normal file
14
frontend/src/uxbox/view/locales/en.cljs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz>
|
||||||
|
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
||||||
|
|
||||||
|
(ns uxbox.view.locales.en)
|
||||||
|
|
||||||
|
(defonce locales
|
||||||
|
{"viewer.sitemap" "sitemap"
|
||||||
|
"viewer.interactions" "view interactions"
|
||||||
|
"viewer.share" "share"
|
||||||
|
"viewer.save" "save SVG"})
|
14
frontend/src/uxbox/view/locales/fr.cljs
Normal file
14
frontend/src/uxbox/view/locales/fr.cljs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2015-2016 Andrey Antukh <niwi@niwi.nz>
|
||||||
|
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
||||||
|
|
||||||
|
(ns uxbox.view.locales.en)
|
||||||
|
|
||||||
|
(defonce locales
|
||||||
|
{"viewer.sitemap" "plan du site"
|
||||||
|
"viewer.interactions" "voir les interactions"
|
||||||
|
"viewer.share" "partager"
|
||||||
|
"viewer.save" "sauvegarder en SVG"})
|
|
@ -10,6 +10,7 @@
|
||||||
[uxbox.builtins.icons :as i]
|
[uxbox.builtins.icons :as i]
|
||||||
[rumext.core :as mx :include-macros true]
|
[rumext.core :as mx :include-macros true]
|
||||||
[uxbox.main.data.lightbox :as udl]
|
[uxbox.main.data.lightbox :as udl]
|
||||||
|
[uxbox.util.i18n :refer (tr)]
|
||||||
[uxbox.view.store :as st]
|
[uxbox.view.store :as st]
|
||||||
[uxbox.view.data.viewer :as dv]))
|
[uxbox.view.data.viewer :as dv]))
|
||||||
|
|
||||||
|
@ -23,18 +24,20 @@
|
||||||
[:div.view-nav
|
[:div.view-nav
|
||||||
[:ul.view-options-btn
|
[:ul.view-options-btn
|
||||||
[:li.tooltip.tooltip-right
|
[:li.tooltip.tooltip-right
|
||||||
{:alt "sitemap"
|
{:alt (tr "viewer.sitemap")
|
||||||
:class (when sitemap? "selected")
|
:class (when sitemap? "selected")
|
||||||
:on-click toggle-sitemap}
|
:on-click toggle-sitemap}
|
||||||
i/project-tree]
|
i/project-tree]
|
||||||
[:li.tooltip.tooltip-right
|
[:li.tooltip.tooltip-right
|
||||||
{:alt "view interactions"
|
{:alt (tr "viewer.interactions")
|
||||||
:class (when interactions? "selected")
|
:class (when interactions? "selected")
|
||||||
:on-click toggle-interactions}
|
:on-click toggle-interactions}
|
||||||
i/action]
|
i/action]
|
||||||
[:li.tooltip.tooltip-right
|
[:li.tooltip.tooltip-right
|
||||||
{:alt "share"} i/export]
|
{:alt (tr "viewer.share")
|
||||||
|
:class "disabled"
|
||||||
|
:disabled true} i/export]
|
||||||
[:li.tooltip.tooltip-right
|
[:li.tooltip.tooltip-right
|
||||||
{:alt "save SVG"
|
{:alt (tr "viewer.save")
|
||||||
:on-click on-download}
|
:on-click on-download}
|
||||||
i/save]]]))
|
i/save]]]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue