feat: localization (#196)
* Started adding locale translations :) * Added some more translations * Working on translating even more pages * More translations * Added test default locale retrieval * replace `intl.formatMessage` with custom `t` hook * add more translations * improve title syntax * add more translations * translate admin config page * translated error messages * add language selecter * minor fixes * improve language handling * add upcoming languages * add `crowdin.yml` * run formatter --------- Co-authored-by: Steve Tautonico <stautonico@gmail.com>
This commit is contained in:
@@ -2,10 +2,13 @@ import { ActionIcon, TextInput } from "@mantine/core";
|
||||
import { useClipboard } from "@mantine/hooks";
|
||||
import { useRef, useState } from "react";
|
||||
import { TbCheck, TbCopy } from "react-icons/tb";
|
||||
import useTranslate from "../../hooks/useTranslate.hook";
|
||||
import toast from "../../utils/toast.util";
|
||||
|
||||
function CopyTextField(props: { link: string }) {
|
||||
const clipboard = useClipboard({ timeout: 500 });
|
||||
const t = useTranslate();
|
||||
|
||||
const [checkState, setCheckState] = useState(false);
|
||||
const [textClicked, setTextClicked] = useState(false);
|
||||
const timerRef = useRef<number | ReturnType<typeof setTimeout> | undefined>(
|
||||
@@ -14,7 +17,7 @@ function CopyTextField(props: { link: string }) {
|
||||
|
||||
const copyLink = () => {
|
||||
clipboard.copy(props.link);
|
||||
toast.success("The link was copied to your clipboard.");
|
||||
toast.success(t("common.notify.copied"));
|
||||
if (timerRef.current) clearTimeout(timerRef.current);
|
||||
timerRef.current = setTimeout(() => {
|
||||
setCheckState(false);
|
||||
@@ -25,7 +28,7 @@ function CopyTextField(props: { link: string }) {
|
||||
return (
|
||||
<TextInput
|
||||
readOnly
|
||||
label="Link"
|
||||
label={t("common.text.link")}
|
||||
variant="filled"
|
||||
value={props.link}
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user