Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Missing translation for server errors #30073

Merged
merged 69 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
241f5e7
fix: missing translation for server errors
tienifr Oct 20, 2023
1e9221d
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Oct 20, 2023
096ed12
remove redundant dependency
tienifr Oct 21, 2023
72ced42
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Oct 23, 2023
2b04a1a
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Oct 24, 2023
cd2f3f9
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Oct 25, 2023
0a9a467
do not translate already translated text in DotIndicatorMessage
tienifr Oct 25, 2023
b04abe5
fix missing translation for FormAlertWrapper
tienifr Oct 25, 2023
95188d6
fix missing translation for FormHelpMessage
tienifr Oct 25, 2023
e2d2551
fix lint
tienifr Oct 25, 2023
8b07f67
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Oct 27, 2023
11a35e4
Merge branch 'main' into fix/29712
tienifr Oct 30, 2023
e80c690
Merge branch 'main' into fix/29712
tienifr Nov 20, 2023
97ad718
Merge branch 'main' into fix/29712
tienifr Nov 21, 2023
6803203
fix translation for AddressForm
tienifr Nov 21, 2023
06989fc
Merge branch 'main' into fix/29712
tienifr Nov 22, 2023
ac7146f
Merge branch 'main' into fix/29712
tienifr Dec 1, 2023
b8dad84
create prop type for translatable text
tienifr Dec 1, 2023
bcd1c19
use translatable text type for hint
tienifr Dec 1, 2023
1d7bfa0
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Dec 1, 2023
b1c438c
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Dec 4, 2023
aaf1b7b
Merge branch 'main' into fix/29712
tienifr Dec 27, 2023
5276da1
use MaybePhraseKey type
tienifr Dec 27, 2023
93de980
fix type
tienifr Dec 27, 2023
916e3de
fix type
tienifr Dec 27, 2023
a6a8340
remove redundant logic
tienifr Dec 27, 2023
809a5f3
fix missing translation in OfflineWithFeedback
tienifr Dec 27, 2023
7647500
fix lint
tienifr Dec 27, 2023
5167629
fix type
tienifr Dec 27, 2023
72e81c0
fix missing translations for DotIndicatorMessage
tienifr Dec 27, 2023
94fc3e2
fix lint
tienifr Dec 28, 2023
736a9d1
Merge branch 'main' into fix/29712
tienifr Jan 2, 2024
dea7484
handle client error
tienifr Jan 2, 2024
a92b690
fix type
tienifr Jan 2, 2024
a8061ef
fix test
tienifr Jan 2, 2024
bb7c9ca
fix lint
tienifr Jan 2, 2024
49a45b2
fix test
tienifr Jan 2, 2024
31f46a5
Merge branch 'main' into fix/29712
tienifr Jan 4, 2024
68bc74d
update spanish translation message
tienifr Jan 4, 2024
d92aea9
Merge branch 'main' into fix/29712
tienifr Jan 9, 2024
cadac8b
Merge branch 'main' into fix/29712
tienifr Jan 9, 2024
7898d54
Merge branch 'main' into fix/29712
tienifr Jan 9, 2024
f81c7a1
fix lint
tienifr Jan 9, 2024
f7d546b
Merge branch 'main' into fix/29712
tienifr Jan 10, 2024
c9f67a7
Merge branch 'main' into fix/29712
tienifr Jan 18, 2024
df4e6f0
fix lint
tienifr Jan 18, 2024
592553b
move translatableTextPropTypes to TS file
tienifr Jan 18, 2024
ef01f37
remove redundant file
tienifr Jan 18, 2024
e520a8e
fix lint
tienifr Jan 18, 2024
257b186
Merge branch 'main' into fix/29712
tienifr Jan 18, 2024
2228e65
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Jan 23, 2024
e834c5f
reapply changes
tienifr Jan 23, 2024
272c2fb
Merge branch 'main' into fix/29712
tienifr Jan 23, 2024
ed0cce8
fix lint
tienifr Jan 23, 2024
03a41e3
fix remaining cases
tienifr Jan 23, 2024
0f98968
Merge branch 'main' into fix/29712
tienifr Jan 25, 2024
d3773d7
Merge branch 'main' into fix/29712
tienifr Jan 26, 2024
f9b2f6d
Merge branch 'main' into fix/29712
tienifr Jan 28, 2024
58719e8
revert unnecessary change
tienifr Jan 28, 2024
712092b
Merge branch 'main' of https://github.com/tienifr/App into fix/29712
tienifr Jan 29, 2024
dfb569f
fix console error
tienifr Jan 29, 2024
f2f2670
fix crash for attachment
tienifr Jan 29, 2024
f8bb87b
fix type console error
tienifr Jan 29, 2024
956502a
Merge branch 'main' into fix/29712
tienifr Jan 29, 2024
8fde90c
Merge branch 'main' into fix/29712
tienifr Jan 31, 2024
827842e
Merge branch 'main' into fix/29712
tienifr Feb 2, 2024
078c2b7
fix lint
tienifr Feb 2, 2024
659ad29
Merge branch 'main' into fix/29712
tienifr Feb 6, 2024
7f14df6
Merge branch 'main' into fix/29712
tienifr Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AddressForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function AddressForm({city, country, formID, onAddressChanged, onSubmit, shouldS
const styles = useThemeStyles();
const {translate} = useLocalize();
const zipSampleFormat = lodashGet(CONST.COUNTRY_ZIP_REGEX_DATA, [country, 'samples'], '');
const zipFormat = translate('common.zipCodeExampleFormat', {zipSampleFormat});
const zipFormat = ['common.zipCodeExampleFormat', {zipSampleFormat}];
const isUSAForm = country === CONST.COUNTRY.US;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/components/AddressSearch/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {RefObject} from 'react';
import type {NativeSyntheticEvent, StyleProp, TextInputFocusEventData, View, ViewStyle} from 'react-native';
import type {Place} from 'react-native-google-places-autocomplete';
import type {MaybePhraseKey} from '@libs/Localize';
import type Locale from '@src/types/onyx/Locale';

type CurrentLocationButtonProps = {
Expand Down Expand Up @@ -43,7 +44,7 @@ type AddressSearchProps = {
onBlur?: () => void;

/** Error text to display */
errorText?: string;
errorText?: MaybePhraseKey;

/** Hint text to display */
hint?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/AvatarWithImagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function AvatarWithImagePicker({
{errorData.validationError && (
<DotIndicatorMessage
style={[styles.mt6]}
messages={{0: translate(errorData.validationError, errorData.phraseParam)}}
messages={{0: [errorData.validationError, errorData.phraseParam]}}
type="error"
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/CheckboxWithLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {useState} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import variables from '@styles/variables';
import Checkbox from './Checkbox';
import FormHelpMessage from './FormHelpMessage';
Expand Down Expand Up @@ -40,7 +41,7 @@ type CheckboxWithLabelProps = RequiredLabelProps & {
style?: StyleProp<ViewStyle>;

/** Error text to display */
errorText?: string;
errorText?: MaybePhraseKey;

/** Value for checkbox. This prop is intended to be set by FormProvider only */
value?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/components/CountrySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import Navigation from '@libs/Navigation/Navigation';
import type {Country} from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand All @@ -11,7 +12,7 @@ import MenuItemWithTopDescription from './MenuItemWithTopDescription';

type CountrySelectorProps = {
/** Form error text. e.g when no country is selected */
errorText?: string;
errorText?: MaybePhraseKey;

/** Callback called when the country changes. */
onInputChange: (value?: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DistanceRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe
}

if (_.size(validatedWaypoints) < 2) {
return {0: translate('iou.error.atLeastTwoDifferentWaypoints')};
return {0: 'iou.error.atLeastTwoDifferentWaypoints'};
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/components/DotIndicatorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type DotIndicatorMessageProps = {
* timestamp: 'message',
* }
*/
messages: Record<string, Localize.MaybePhraseKey>;
messages: Record<string, Localize.MaybePhraseKey | ReceiptError>;

/** The type of message, 'error' shows a red dot, 'success' shows a green dot */
type: 'error' | 'success';
Expand All @@ -36,8 +36,8 @@ type DotIndicatorMessageProps = {
};

/** Check if the error includes a receipt. */
function isReceiptError(message: string | ReceiptError): message is ReceiptError {
if (typeof message === 'string') {
function isReceiptError(message: Localize.MaybePhraseKey | ReceiptError): message is ReceiptError {
if (typeof message === 'string' || Array.isArray(message)) {
return false;
}
return (message?.error ?? '') === CONST.IOU.RECEIPT_ERROR;
Expand All @@ -58,7 +58,7 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles}: DotIndica
.map((key) => messages[key]);

// Removing duplicates using Set and transforming the result into an array
const uniqueMessages = [...new Set(sortedMessages)].map((message) => Localize.translateIfPhraseKey(message));
const uniqueMessages = [...new Set(sortedMessages)].map((message) => (isReceiptError(message) ? message : Localize.translateIfPhraseKey(message)));

const isErrorMessage = type === 'error';

Expand Down
3 changes: 2 additions & 1 deletion src/components/FormAlertWithSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import React from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import Button from './Button';
import FormAlertWrapper from './FormAlertWrapper';

type FormAlertWithSubmitButtonProps = {
/** Error message to display above button */
message?: string;
message?: MaybePhraseKey;

/** Whether the button is disabled */
isDisabled?: boolean;
Expand Down
5 changes: 3 additions & 2 deletions src/components/FormAlertWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import type Network from '@src/types/onyx/Network';
import FormHelpMessage from './FormHelpMessage';
import {withNetwork} from './OnyxProvider';
Expand All @@ -28,7 +29,7 @@ type FormAlertWrapperProps = {
isMessageHtml?: boolean;

/** Error message to display above button */
message?: string;
message?: MaybePhraseKey;

/** Props to detect online status */
network: Network;
Expand Down Expand Up @@ -68,7 +69,7 @@ function FormAlertWrapper({
{` ${translate('common.inTheFormBeforeContinuing')}.`}
</Text>
);
} else if (isMessageHtml) {
} else if (isMessageHtml && typeof message === 'string') {
content = <RenderHTML html={`<alert-text>${message}</alert-text>`} />;
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/MagicCodeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import useNetwork from '@hooks/useNetwork';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Browser from '@libs/Browser';
import {translatableTextPropTypes} from '@libs/Localize';
import * as ValidationUtils from '@libs/ValidationUtils';
import CONST from '@src/CONST';
import FormHelpMessage from './FormHelpMessage';
Expand Down Expand Up @@ -34,7 +35,7 @@ const propTypes = {
shouldDelayFocus: PropTypes.bool,

/** Error text to display */
errorText: PropTypes.string,
errorText: translatableTextPropTypes,

/** Specifies autocomplete hints for the system, so it can provide autofill */
autoComplete: PropTypes.oneOf(['sms-otp', 'one-time-code', 'off']).isRequired,
Expand Down
3 changes: 2 additions & 1 deletion src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ControlSelection from '@libs/ControlSelection';
import convertToLTR from '@libs/convertToLTR';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import getButtonState from '@libs/getButtonState';
import type {MaybePhraseKey} from '@libs/Localize';
import type {AvatarSource} from '@libs/UserUtils';
import variables from '@styles/variables';
import * as Session from '@userActions/Session';
Expand Down Expand Up @@ -135,7 +136,7 @@ type MenuItemProps = (IconProps | AvatarProps | NoIcon) & {
error?: string;

/** Error to display at the bottom of the component */
errorText?: string;
errorText?: MaybePhraseKey;

/** A boolean flag that gives the icon a green fill if true */
success?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ function MoneyRequestConfirmationList(props) {
<FormHelpMessage
style={[styles.ph1, styles.mb2]}
isError
message={translate(formError)}
message={formError}
/>
)}
{button}
Expand All @@ -576,7 +576,6 @@ function MoneyRequestConfirmationList(props) {
formError,
styles.ph1,
styles.mb2,
translate,
]);

const {image: receiptImage, thumbnail: receiptThumbnail} =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,13 +606,13 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
<FormHelpMessage
style={[styles.ph1, styles.mb2]}
isError
message={translate(formError)}
message={formError}
/>
)}
{button}
</>
);
}, [isReadOnly, iouType, selectedParticipants.length, confirm, bankAccountRoute, iouCurrencyCode, policyID, splitOrRequestOptions, formError, styles.ph1, styles.mb2, translate]);
}, [isReadOnly, iouType, selectedParticipants.length, confirm, bankAccountRoute, iouCurrencyCode, policyID, splitOrRequestOptions, formError, styles.ph1, styles.mb2]);

const {image: receiptImage, thumbnail: receiptThumbnail} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, receiptPath, receiptFilename) : {};
return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/OfflineWithFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {View} from 'react-native';
import useNetwork from '@hooks/useNetwork';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import * as ErrorUtils from '@libs/ErrorUtils';
import mapChildrenFlat from '@libs/mapChildrenFlat';
import shouldRenderOffscreen from '@libs/shouldRenderOffscreen';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -84,7 +85,7 @@ function OfflineWithFeedback({

const hasErrors = !isEmptyObject(errors ?? {});
// Some errors have a null message. This is used to apply opacity only and to avoid showing redundant messages.
const errorMessages = omitBy(errors, (e) => e === null);
const errorMessages = ErrorUtils.getErrorsWithTranslationData(omitBy(errors, (e) => e === null));
const hasErrorMessages = !isEmptyObject(errorMessages);
const isOfflinePendingAction = !!isOffline && !!pendingAction;
const isUpdateOrDeleteError = hasErrors && (pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE);
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class BaseOptionsSelector extends Component {
updateSearchValue(value) {
this.setState({
paginationPage: 1,
errorMessage: value.length > this.props.maxLength ? this.props.translate('common.error.characterLimitExceedCounter', {length: value.length, limit: this.props.maxLength}) : '',
errorMessage: value.length > this.props.maxLength ? ['common.error.characterLimitExceedCounter', {length: value.length, limit: this.props.maxLength}] : '',
value,
});

Expand Down
6 changes: 3 additions & 3 deletions src/components/PDFView/PDFPasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ function PDFPasswordForm({isFocused, isPasswordInvalid, shouldShowLoadingIndicat

const errorText = useMemo(() => {
if (isPasswordInvalid) {
return translate('attachmentView.passwordIncorrect');
return 'attachmentView.passwordIncorrect';
}
if (!_.isEmpty(validationErrorText)) {
return translate(validationErrorText);
return validationErrorText;
}
return '';
}, [isPasswordInvalid, translate, validationErrorText]);
}, [isPasswordInvalid, validationErrorText]);

useEffect(() => {
if (!isFocused) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Picker/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {ChangeEvent, Component, ReactElement} from 'react';
import type {MeasureLayoutOnSuccessCallback, NativeMethods, StyleProp, ViewStyle} from 'react-native';
import type {MaybePhraseKey} from '@libs/Localize';

type MeasureLayoutOnFailCallback = () => void;

Expand Down Expand Up @@ -58,7 +59,7 @@ type BasePickerProps<TPickerValue> = {
placeholder?: PickerPlaceholder;

/** Error text to display */
errorText?: string;
errorText?: MaybePhraseKey;

/** Customize the BasePicker container */
containerStyles?: StyleProp<ViewStyle>;
Expand Down
3 changes: 2 additions & 1 deletion src/components/RadioButtonWithLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import FormHelpMessage from './FormHelpMessage';
import * as Pressables from './Pressable';
import RadioButton from './RadioButton';
Expand All @@ -28,7 +29,7 @@ type RadioButtonWithLabelProps = {
hasError?: boolean;

/** Error text to display */
errorText?: string;
errorText?: MaybePhraseKey;
};

const PressableWithFeedback = Pressables.PressableWithFeedback;
Expand Down
3 changes: 2 additions & 1 deletion src/components/RoomNameInput/roomNameInputPropTypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import refPropTypes from '@components/refPropTypes';
import {translatableTextPropTypes} from '@libs/Localize';

const propTypes = {
/** Callback to execute when the text input is modified correctly */
Expand All @@ -12,7 +13,7 @@ const propTypes = {
disabled: PropTypes.bool,

/** Error text to show */
errorText: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))]),
errorText: translatableTextPropTypes,

/** A ref forwarded to the TextInput */
forwardedRef: refPropTypes,
Expand Down
3 changes: 2 additions & 1 deletion src/components/StatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import FormHelpMessage from '@components/FormHelpMessage';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import type {MaybePhraseKey} from '@libs/Localize';
import type {CountryData} from '@libs/searchCountryOptions';
import StateSelectorModal from './StateSelectorModal';
import type {State} from './StateSelectorModal';

type StatePickerProps = {
/** Error text to display */
errorText?: string;
errorText?: MaybePhraseKey;

/** State to display */
value?: State;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import sourcePropTypes from '@components/Image/sourcePropTypes';
import {translatableTextPropTypes} from '@libs/Localize';

const propTypes = {
/** Input label */
Expand All @@ -18,7 +19,7 @@ const propTypes = {
placeholder: PropTypes.string,

/** Error text to display */
errorText: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))]),
errorText: translatableTextPropTypes,

/** Icon to display in right side of text input */
icon: sourcePropTypes,
Expand Down Expand Up @@ -68,7 +69,7 @@ const propTypes = {
maxLength: PropTypes.number,

/** Hint text to display below the TextInput */
hint: PropTypes.string,
hint: translatableTextPropTypes,

/** Prefix character */
prefixCharacter: PropTypes.string,
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput/BaseTextInput/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type CustomBaseTextInputProps = {
hideFocusedState?: boolean;

/** Hint text to display below the TextInput */
hint?: string;
hint?: MaybePhraseKey;

/** Prefix character */
prefixCharacter?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TimePicker/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ function TimePicker({forwardedRef, defaultValue, onSubmit, onInputChange}) {
{isError ? (
<FormHelpMessage
isError={isError}
message={translate('common.error.invalidTimeShouldBeFuture')}
message="common.error.invalidTimeShouldBeFuture"
style={styles.pl5}
/>
) : (
Expand Down
3 changes: 2 additions & 1 deletion src/components/ValuePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import refPropTypes from '@components/refPropTypes';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {translatableTextPropTypes} from '@libs/Localize';
import variables from '@styles/variables';
import ValueSelectorModal from './ValueSelectorModal';

const propTypes = {
/** Form Error description */
errorText: PropTypes.string,
errorText: translatableTextPropTypes,

/** Item to display */
value: PropTypes.string,
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,9 @@ export default {
sharedNoteMessage: 'Keep notes about this chat here. Expensify employees and other users on the team.expensify.com domain can view these notes.',
composerLabel: 'Notes',
myNote: 'My note',
error: {
genericFailureMessage: "Private notes couldn't be saved",
tienifr marked this conversation as resolved.
Show resolved Hide resolved
},
},
addDebitCardPage: {
addADebitCard: 'Add a debit card',
Expand Down
Loading
Loading