mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
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:
parent
362cd74a9b
commit
a436e70764
9 changed files with 206 additions and 32 deletions
|
@ -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>
|
||||
|
|
32
src/components/LanguageList.tsx
Normal file
32
src/components/LanguageList.tsx
Normal 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>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue