Skip to content

Commit d434113

Browse files
committed
fix localization
1 parent 586be63 commit d434113

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/stories/Form.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Picker from '@components/Picker';
1313
import StateSelector from '@components/StateSelector';
1414
import Text from '@components/Text';
1515
import TextInput from '@components/TextInput';
16+
import useLocalize from '@hooks/useLocalize';
1617
import {isRequiredFulfilled} from '@libs/ValidationUtils';
1718
import {clearErrors, setDraftValues, setErrors, setIsLoading} from '@userActions/FormActions';
1819
import CONST from '@src/CONST';
@@ -63,6 +64,8 @@ const story: Meta<typeof FormProvider> = {
6364
};
6465

6566
function Template(props: FormProviderProps & FormProviderOnyxProps) {
67+
const {translate} = useLocalize();
68+
6669
// Form consumes data from Onyx, so we initialize Onyx with the necessary data here
6770
setIsLoading(props.formID, !!props.formState?.isLoading);
6871
setDraftValues(props.formID, props.draftValues);
@@ -99,7 +102,7 @@ function Template(props: FormProviderProps & FormProviderOnyxProps) {
99102
label="Street"
100103
inputID="street"
101104
containerStyles={defaultStyles.mt4}
102-
hint="common.noPO"
105+
hint={translate('common.noPO')}
103106
/>
104107
<InputWrapper
105108
InputComponent={DatePicker}

src/stories/PromotedActionBar.stories.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ const story = {
1414
component: PromotedActionsBar,
1515
};
1616

17-
type PromotedActionWithText = Omit<PromotedAction, 'translationKey'> & {text: string};
18-
type PromotedActionsBarPropsWithText = Omit<PromotedActionsBarProps, 'promotedActions'> & {promotedActions: PromotedActionWithText[]};
17+
type PromotedActionsBarPropsWithText = Omit<PromotedActionsBarProps, 'promotedActions'> & {promotedActions: PromotedAction[]};
1918
type StoryType = typeof Template & {args?: Partial<PromotedActionsBarPropsWithText>};
2019

2120
function Template(args: PromotedActionsBarProps) {
@@ -33,29 +32,29 @@ const promotedActions = [
3332
{
3433
key: 'join',
3534
icon: 'CommentBubbles',
36-
text: 'Join',
35+
translationKey: 'common.message',
3736
onSelected: () => {},
3837
},
3938
{
4039
key: 'pin',
4140
icon: 'Pin',
42-
text: 'Pin',
41+
translationKey: 'common.pin',
4342
onSelected: () => {},
4443
},
4544
{
4645
key: 'share',
4746
icon: 'QrCode',
48-
text: 'Share',
47+
translationKey: 'common.share',
4948
onSelected: () => {},
5049
},
51-
] satisfies PromotedActionWithText[];
50+
] satisfies PromotedAction[];
5251

5352
const defaultPromotedAction = {
5453
key: '',
5554
icon: 'ChatBubbles',
56-
text: '',
55+
translationKey: 'common.join',
5756
onSelected: () => {},
58-
} satisfies PromotedActionWithText;
57+
} satisfies PromotedAction;
5958

6059
// Arguments can be passed to the component by binding
6160
// See: https://storybook.js.org/docs/react/writing-stories/introduction#using-args

0 commit comments

Comments
 (0)