Add localization support (#333)

* Add updated i18n config and en locale
This commit is contained in:
Jeff
2023-10-30 19:22:45 -07:00
committed by GitHub
parent 11863fd4c1
commit 8430b1ec95
90 changed files with 2679 additions and 908 deletions
@@ -1,4 +1,5 @@
import { ButtonProps } from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { RiSortAsc, RiSortDesc } from 'react-icons/ri';
import { SortOrder } from '/@/renderer/api/types';
import { Button, Tooltip } from '/@/renderer/components';
@@ -10,8 +11,15 @@ interface OrderToggleButtonProps {
}
export const OrderToggleButton = ({ sortOrder, onToggle, buttonProps }: OrderToggleButtonProps) => {
const { t } = useTranslation();
return (
<Tooltip label={sortOrder}>
<Tooltip
label={
sortOrder === SortOrder.ASC
? t('common.ascending', { postProcess: 'titleCase' })
: t('common.descending', { postProcess: 'titleCase' })
}
>
<Button
compact
fw="600"