Add localization support for endpoint pages components (#667)

* init localization

* Update defaul to en

* Fix merge issue and import path.

* Set default to en

* Change jsx to tsx

* Update the password max length string.

* Remove languageContext as using the recoil instead.

* Add localization to component endpoints pages

* Revert default to en after testing.

* Update LoginForm.tsx

* Fix translation.

* Make lint happy
This commit is contained in:
Abner Chou 2023-07-22 15:09:45 -04:00 committed by GitHub
parent 4148c6d219
commit b64273957a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 212 additions and 67 deletions

View file

@ -5,6 +5,10 @@ import CrossIcon from '../svg/CrossIcon';
import { Save } from 'lucide-react';
import { cn } from '~/utils/';
import store from '~/store';
import { useRecoilValue } from 'recoil';
import { localize } from '~/localization/Translation';
function EndpointOptionsPopover({
content,
visible,
@ -12,6 +16,7 @@ function EndpointOptionsPopover({
switchToSimpleMode,
additionalButton = null,
}) {
const lang = useRecoilValue(store.lang);
const cardStyle =
'shadow-md rounded-md min-w-[75px] font-normal bg-white border-black/10 border dark:bg-gray-700 text-black dark:text-white';
@ -37,7 +42,7 @@ function EndpointOptionsPopover({
onClick={saveAsPreset}
>
<Save className="mr-1 w-[14px]" />
Save as preset
{localize(lang, 'com_endpoint_save_as_preset')}
</Button>
{additionalButton && (
<Button