From 67eca2bda105b22f288930fd821f1e045857a9d0 Mon Sep 17 00:00:00 2001 From: Guillermo Peralta Scura Date: Sun, 26 Jan 2020 17:14:31 -0300 Subject: [PATCH] Add landmarks (#564) Use HTML semantic elements to set the landmarks of the page. This is helpful for assistive technologies to determine the different regions of content. In our case it's useful for jumping between the different islands that we use to group the form controls. --- public/index.html | 59 +- public/locales/en/translation.json | 11 +- public/locales/es/translation.json | 14 +- src/components/LanguageList.tsx | 4 + src/components/LockIcon.tsx | 1 + src/index.tsx | 1365 ++++++++++++++-------------- 6 files changed, 757 insertions(+), 697 deletions(-) diff --git a/public/index.html b/public/index.html index a748f696b7..ab820bfa54 100644 --- a/public/index.html +++ b/public/index.html @@ -81,35 +81,38 @@ -

Excalidraw

+
+

Excalidraw

+
- - - - + + - - - - - + + + + + + + diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 0eb33bba47..79ccc572b6 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -38,7 +38,8 @@ "cartoonist": "Cartoonist", "fileTitle": "File title", "colorPicker": "Color picker", - "canvasBackground": "Canvas background" + "canvasBackground": "Canvas background", + "drawingCanvas": "Drawing Canvas" }, "buttons": { "clearReset": "Clear the canvas & reset background color", @@ -48,7 +49,8 @@ "save": "Save", "load": "Load", "getShareableLink": "Get shareable link", - "close": "Close" + "close": "Close", + "selectLanguage": "Select Language" }, "alerts": { "clearReset": "This will clear the whole canvas. Are you sure?", @@ -67,5 +69,10 @@ "line": "Line", "text": "Text", "lock": "Keep selected tool active after drawing" + }, + "headings": { + "canvasActions": "Canvas actions", + "selectedShapeActions": "Selected shape actions", + "shapes": "Shapes" } } diff --git a/public/locales/es/translation.json b/public/locales/es/translation.json index b30fac029e..5c7a5a4410 100644 --- a/public/locales/es/translation.json +++ b/public/locales/es/translation.json @@ -38,7 +38,8 @@ "cartoonist": "Caricatura", "fileTitle": "Título del archivo", "colorPicker": "Selector de color", - "canvasBackground": "Fondo del lienzo" + "canvasBackground": "Fondo del lienzo", + "drawingCanvas": "Lienzo de dibujo" }, "buttons": { "clearReset": "Limpiar lienzo y reiniciar el color de fondo", @@ -49,7 +50,8 @@ "load": "Cargar", "getShareableLink": "Obtener enlace para compartir", "showExportDialog": "Mostrar diálogo para exportar", - "close": "Cerrar" + "close": "Cerrar", + "selectLanguage": "Select Language" }, "alerts": { "clearReset": "Esto limpiará todo el lienzo. Estás seguro?", @@ -66,6 +68,12 @@ "ellipse": "Elipse", "arrow": "Flecha", "line": "Línea", - "text": "Texto" + "text": "Texto", + "lock": "Mantener la herramienta seleccionada activa después de dibujar" + }, + "headings": { + "canvasActions": "Acciones del lienzo", + "selectedShapeActions": "Acciones de la forma seleccionada", + "shapes": "Formas" } } diff --git a/src/components/LanguageList.tsx b/src/components/LanguageList.tsx index 3c7047602f..75d5ffb4b7 100644 --- a/src/components/LanguageList.tsx +++ b/src/components/LanguageList.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useTranslation } from "react-i18next"; export function LanguageList({ onClick, @@ -9,12 +10,15 @@ export function LanguageList({ onClick: (value: string) => void; currentLanguage: string; }) { + const { t } = useTranslation(); + return (