0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

🌐 i18N for viewer

This commit is contained in:
mathieu.brunot 2019-02-21 21:51:54 +01:00
parent 2bcc229334
commit e7e67c6ad8
No known key found for this signature in database
GPG key ID: 81584BEAF692D7E0
5 changed files with 51 additions and 4 deletions

View file

@ -6,6 +6,7 @@
(ns uxbox.view
(:require [uxbox.config]
[uxbox.view.locales :as lc]
[uxbox.view.store :as st]
[uxbox.view.ui :as ui]))

View 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))

View 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"})

View 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"})

View file

@ -10,6 +10,7 @@
[uxbox.builtins.icons :as i]
[rumext.core :as mx :include-macros true]
[uxbox.main.data.lightbox :as udl]
[uxbox.util.i18n :refer (tr)]
[uxbox.view.store :as st]
[uxbox.view.data.viewer :as dv]))
@ -23,18 +24,20 @@
[:div.view-nav
[:ul.view-options-btn
[:li.tooltip.tooltip-right
{:alt "sitemap"
{:alt (tr "viewer.sitemap")
:class (when sitemap? "selected")
:on-click toggle-sitemap}
i/project-tree]
[:li.tooltip.tooltip-right
{:alt "view interactions"
{:alt (tr "viewer.interactions")
:class (when interactions? "selected")
:on-click toggle-interactions}
i/action]
[:li.tooltip.tooltip-right
{:alt "share"} i/export]
{:alt (tr "viewer.share")
:class "disabled"
:disabled true} i/export]
[:li.tooltip.tooltip-right
{:alt "save SVG"
{:alt (tr "viewer.save")
:on-click on-download}
i/save]]]))