Internationalization followup (#500)

* add translations in data.ts

* add language list
add spanish version

* fixes pr review

* add more translations

* remove unused label

Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
Fernando Alava Zambrano 2020-01-22 16:25:04 +02:00 committed by Lipis
parent 362cd74a9b
commit a436e70764
9 changed files with 206 additions and 32 deletions

View file

@ -127,8 +127,8 @@ export function ExportDialog({
<ToolIcon
type="button"
icon={link}
title="Get shareable link"
aria-label="Get shareable link"
title={t("buttons.getShareableLink")}
aria-label={t("buttons.getShareableLink")}
onClick={() => onExportToBackend(exportedElements, 1)}
/>
</Stack.Row>

View file

@ -0,0 +1,32 @@
import React from "react";
export function LanguageList<T>({
onClick,
languages,
currentLanguage
}: {
languages: { lng: string; label: string }[];
onClick: (value: string) => void;
currentLanguage: string;
}) {
return (
<ul>
{languages.map((language, idx) => (
<li
key={idx}
className={currentLanguage === language.lng ? "current" : ""}
>
<a
href="/"
onClick={e => {
onClick(language.lng);
e.preventDefault();
}}
>
{language.label}
</a>
</li>
))}
</ul>
);
}