From 13409f889c6114b98d5f40aa26b7f7f12e741dd2 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 17 Jan 2024 15:30:52 -0600 Subject: [PATCH] Some i18n --- src/components/Dialog/index.web.tsx | 11 ++++++----- src/components/Prompt.tsx | 8 ++++++-- src/view/screens/Storybook/Forms.tsx | 22 +++++++++++++--------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 88ebbbc1d2..bb7b6d33df 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -2,6 +2,8 @@ import React, {useImperativeHandle} from 'react' import {View, TouchableWithoutFeedback} from 'react-native' import {FocusScope} from '@tamagui/focus-scope' import Animated, {FadeInDown, FadeIn} from 'react-native-reanimated' +import {msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useTheme, atoms as a, useBreakpoints, web} from '#/alf' import {Text} from '#/components/Typography' @@ -22,6 +24,7 @@ export function Outer({ onClose, children, }: React.PropsWithChildren) { + const {_} = useLingui() const t = useTheme() const {gtMobile} = useBreakpoints() const [isOpen, setIsOpen] = React.useState(false) @@ -74,7 +77,7 @@ export function Outer({ - @@ -97,6 +100,7 @@ export function Action({ children, onPress, }: React.PropsWithChildren<{onPress?: () => void}>) { + const {_} = useLingui() const {close} = Dialog.useDialogContext() const handleOnPress = React.useCallback(() => { close() @@ -107,7 +111,7 @@ export function Action({ variant="solid" color="primary" size="small" - label="Confirm" + label={_(msg`Confirm`)} onPress={handleOnPress}> {children} diff --git a/src/view/screens/Storybook/Forms.tsx b/src/view/screens/Storybook/Forms.tsx index 66268cb802..cee24af288 100644 --- a/src/view/screens/Storybook/Forms.tsx +++ b/src/view/screens/Storybook/Forms.tsx @@ -163,15 +163,6 @@ export function Forms() { Click me - - @@ -235,6 +226,19 @@ export function Forms() { + +

ToggleButton