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

Updating Translate to Manage Pluralization #38783

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
debffae
init
brandonhenry Mar 21, 2024
7a562f6
Final iteration
brandonhenry Apr 4, 2024
dc76775
move warn up
brandonhenry Apr 4, 2024
c8aa1d9
add space at bottom of file
brandonhenry Apr 4, 2024
f688f77
Update index.ts
brandonhenry Apr 4, 2024
91e5752
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 4, 2024
301b717
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 6, 2024
91935dc
updated to change even less from original and added an example
brandonhenry Apr 8, 2024
35b8f1c
simpler example
brandonhenry Apr 8, 2024
492850a
real patch to remove array
brandonhenry Apr 11, 2024
2d0bb59
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 11, 2024
4c4191b
updated conceirge option to not be array
brandonhenry Apr 12, 2024
ad5599f
Update en.ts
brandonhenry Apr 12, 2024
af826ae
Update ReportWelcomeText.tsx
brandonhenry Apr 12, 2024
776962b
fixed jest issues
brandonhenry Apr 12, 2024
eacc2c0
more adjustmenets
brandonhenry Apr 12, 2024
c5a1e75
Update index.ts
brandonhenry Apr 12, 2024
a69844b
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 12, 2024
f9b5b4f
cleaning things up
brandonhenry Apr 15, 2024
2032aa7
more minor adjustments
brandonhenry Apr 15, 2024
ab39d4d
fixed conciergeplaceholder options to be random
brandonhenry Apr 15, 2024
29e3bc5
Update CONST.ts
brandonhenry Apr 15, 2024
7741f2a
Update index.ts
brandonhenry Apr 15, 2024
511dbf0
removed flattenobject to make types simpler
brandonhenry Apr 15, 2024
2e22a78
completely remove flattenobject
brandonhenry Apr 15, 2024
456a7bd
revert type change
brandonhenry Apr 15, 2024
29f4fc1
Reworked phraseParameter only
brandonhenry Apr 16, 2024
319ccd3
Update PhraseParameter to be of type record
brandonhenry Apr 16, 2024
eecadf1
Fixed other declarations of translate
brandonhenry Apr 16, 2024
b0817b6
Update index.ts
brandonhenry Apr 16, 2024
8272097
added new tests for plural translation
brandonhenry Apr 16, 2024
bd9d3c4
More old cleanup
brandonhenry Apr 16, 2024
bdb9d26
prettier run
brandonhenry Apr 16, 2024
316773e
fixed broken tests
brandonhenry Apr 16, 2024
ba63e0a
fixed missing types
brandonhenry Apr 16, 2024
c7b57fa
Removed debugging
brandonhenry Apr 16, 2024
2caafe2
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 16, 2024
f3b5de3
Fix for concierge options
brandonhenry Apr 16, 2024
a1f3801
updated spanish translation for coniergeoptions
brandonhenry Apr 16, 2024
971d0b4
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 18, 2024
938dbad
Fixed incorrect params
brandonhenry Apr 18, 2024
50de665
Merge conflict fix
brandonhenry Apr 18, 2024
3afbea9
prettier
brandonhenry Apr 18, 2024
f5634dd
added example
brandonhenry Apr 19, 2024
e503b89
removed unrelated changed
brandonhenry Apr 22, 2024
924d69f
adjust count, if none, return
brandonhenry Apr 22, 2024
3832e5d
made count required
brandonhenry Apr 23, 2024
6f35c96
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 23, 2024
317f7d9
pass count as a number
brandonhenry Apr 24, 2024
a357113
Remove unnecessary type coercion
brandonhenry Apr 24, 2024
6b57e68
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 24, 2024
a858ef9
updated tests and changed translations
brandonhenry Apr 24, 2024
181dee1
aligned spanish translation file
brandonhenry Apr 25, 2024
04f9dba
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 28, 2024
957fa5a
updated more types
brandonhenry Apr 28, 2024
2349bed
initial fix of typing
brandonhenry Apr 29, 2024
88d0715
mmore reversion
brandonhenry Apr 29, 2024
3d54654
plural rule form change
brandonhenry Apr 29, 2024
f2cfba9
reworked even more
brandonhenry Apr 29, 2024
c2cec38
more alignement
brandonhenry Apr 29, 2024
2bc6da3
even more alignment
brandonhenry Apr 29, 2024
0b0480f
fixed all typing errors
brandonhenry Apr 29, 2024
d08cb2e
fixed all typing errors
brandonhenry Apr 29, 2024
ec7da78
updated tests and example
brandonhenry Apr 29, 2024
b364003
lots of major updates
brandonhenry Apr 30, 2024
b4a52c3
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Apr 30, 2024
15d6163
removed unnecessary push
brandonhenry Apr 30, 2024
17e11aa
Update IOURequestStepCurrency.tsx
brandonhenry Apr 30, 2024
38025a6
Merge branch 'main' into update-translation-pluralization-example
brandonhenry Apr 30, 2024
21b376d
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry May 1, 2024
4d6e482
updated based on review
brandonhenry May 1, 2024
f0c5274
updated typing
brandonhenry May 1, 2024
b8d87af
fixed params
brandonhenry May 1, 2024
65928ae
removed unnecessary param
brandonhenry May 1, 2024
b4a254a
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry May 6, 2024
328843b
add pluralrules polyfill for native
brandonhenry May 7, 2024
eac8f7e
major tweaks
brandonhenry May 10, 2024
de7806e
updated types
brandonhenry May 15, 2024
499d535
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry May 15, 2024
445e063
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry May 31, 2024
17c8998
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 4, 2024
f9d30be
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 4, 2024
4adb3fa
fixed some typing errors
brandonhenry Jun 5, 2024
09459cb
fixed typing to an extent
brandonhenry Jun 5, 2024
abfb399
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 5, 2024
0ca2c65
remove recent updated count additiions
brandonhenry Jun 6, 2024
0b536d2
other minor updates
brandonhenry Jun 6, 2024
d24a3f0
added back in removed by accident items
brandonhenry Jun 6, 2024
37e55db
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 6, 2024
40f0013
fixed weird issues with any and expensify common
brandonhenry Jun 6, 2024
7ff763e
Update types.ts
brandonhenry Jun 6, 2024
5b4584d
prettier
brandonhenry Jun 6, 2024
5b0e488
updated for better example and to adhere to specifications
brandonhenry Jun 6, 2024
69e7b38
Update src/libs/Localize/index.ts
brandonhenry Jun 9, 2024
6d9f704
reversed some changes to typing
brandonhenry Jun 9, 2024
7919574
updated example
brandonhenry Jun 9, 2024
49feb4a
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 11, 2024
d17b401
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 25, 2024
07fe8c3
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 25, 2024
506c42d
Specify phraseParameter typing change
brandonhenry Jun 26, 2024
61b35e4
Prettier and updated searchText calls
brandonhenry Jun 26, 2024
c44803e
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jun 26, 2024
0bb80e9
Merge branch 'main' into update-translation-pluralization-example
brandonhenry Jun 26, 2024
4e25705
Update WorkspacesSettingsUtils.ts
brandonhenry Jun 26, 2024
d713094
Merge branch 'update-translation-pluralization-example' of https://gi…
brandonhenry Jun 26, 2024
5dd00bc
Update WorkspacesSettingsUtils.ts
brandonhenry Jun 26, 2024
2bb579c
Fixed typing es lint
brandonhenry Jun 26, 2024
e912dc7
last fix as we don't need never?
brandonhenry Jun 26, 2024
283e032
fixed type
brandonhenry Jun 26, 2024
59ed551
renamed to be more clear
brandonhenry Jun 26, 2024
6727c0f
Updated use of never fully
brandonhenry Jun 26, 2024
a3753b6
Update index.ts
brandonhenry Jun 27, 2024
f0f0f7b
Update index.ts
brandonhenry Jun 27, 2024
2f96e68
Update index.ts
brandonhenry Jun 27, 2024
317434f
Update index.ts
brandonhenry Jun 27, 2024
27a2991
last updates to make things more efficient
brandonhenry Jul 2, 2024
cb5c485
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jul 2, 2024
8e00b78
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jul 5, 2024
a6bbf3d
prettier
brandonhenry Jul 5, 2024
a7d615a
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jul 5, 2024
958dced
Merge remote-tracking branch 'upstream/main' into update-translation-…
brandonhenry Jul 6, 2024
7c56086
revert accident
brandonhenry Jul 6, 2024
ddaa1fb
reworking again..
brandonhenry Jul 7, 2024
5bd8f0f
more fixes
brandonhenry Jul 7, 2024
feab497
Update en.ts
brandonhenry Jul 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 .github/libs/sanitizeStringForJSONParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const replacer = (str: string): string =>
'\r': '\\r',
'\f': '\\f',
'"': '\\"',
}[str] ?? '');
})[str] ?? '';

/**
* Replace any characters in the string that will break JSON.parse for our Git Log output
Expand Down
2 changes: 1 addition & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function AttachmentModal({
if (canEditReceipt) {
menuItems.push({
icon: Expensicons.Camera,
text: translate('common.replace'),
text: translate('common.replaceText'),
onSelected: () => {
closeModal();
Navigation.navigate(
Expand Down
2 changes: 1 addition & 1 deletion src/components/AvatarWithImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function AvatarWithImagePicker({
<DotIndicatorMessage
style={[styles.mt6]}
// eslint-disable-next-line @typescript-eslint/naming-convention
messages={{0: translate(errorData.validationError, errorData.phraseParam as never)}}
messages={{0: translate(errorData.validationError)}}
type="error"
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CategoryPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function CategoryPicker({selectedCategory, policyCategories, policyRecentlyUsedC
sections={sections}
headerMessage={headerMessage}
textInputValue={searchValue}
textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
textInputLabel={shouldShowTextInput ? translate('common.searchText') : undefined}
onChangeText={setSearchValue}
onSelectRow={onSubmit}
ListItem={RadioListItem}
Expand Down
4 changes: 2 additions & 2 deletions src/components/EmojiPicker/EmojiPickerMenu/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}: EmojiPickerMenuProps, r
<View style={[styles.emojiPickerContainer, StyleUtils.getEmojiPickerStyle(shouldUseNarrowLayout)]}>
<View style={[styles.ph4, styles.pb1, styles.pt2]}>
<TextInput
label={translate('common.search')}
accessibilityLabel={translate('common.search')}
label={translate('common.searchText')}
accessibilityLabel={translate('common.searchText')}
role={CONST.ROLE.PRESENTATION}
onChangeText={filterEmojis}
blurOnSubmit={filteredEmojis.length > 0}
Expand Down
4 changes: 2 additions & 2 deletions src/components/EmojiPicker/EmojiPickerMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}: EmojiPickerMenuProps, r
>
<View style={[styles.ph4, styles.pb3, styles.pt2]}>
<TextInput
label={translate('common.search')}
accessibilityLabel={translate('common.search')}
label={translate('common.searchText')}
accessibilityLabel={translate('common.searchText')}
role={CONST.ROLE.PRESENTATION}
onChangeText={filterEmojis}
defaultValue=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function MoneyRequestPreviewContent({
} else if (isScanning) {
message = translate('common.receipt');
} else if (isBillSplit) {
message = translate('iou.split');
message = translate('iou.splitIOU');
}

if (isSettled && !iouReport?.isCancelledIOU && !isPartialHold) {
Expand Down Expand Up @@ -422,7 +422,7 @@ function MoneyRequestPreviewContent({
onPressOut={() => ControlSelection.unblock()}
onLongPress={showContextMenu}
shouldUseHapticsOnLongPress
accessibilityLabel={isBillSplit ? translate('iou.split') : showCashOrCard}
accessibilityLabel={isBillSplit ? translate('iou.splitIOU') : showCashOrCard}
accessibilityHint={CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency)}
style={[
styles.moneyRequestPreviewBox,
Expand Down
3 changes: 1 addition & 2 deletions src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ function ReportPreview({
return {supportText: formattedMerchant};
}
return {
supportText: translate('iou.expenseCount', {
count: numberOfRequests - numberOfScanningReceipts - numberOfPendingRequests,
supportText: translate('iou.expenseCount', numberOfRequests - numberOfScanningReceipts - numberOfPendingRequests, {
scanningReceipts: numberOfScanningReceipts,
pendingReceipts: numberOfPendingRequests,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/TagPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function TagPicker({selectedTag, tagListName, policyTags, tagListIndex, policyRe
sections={sections}
textInputValue={searchValue}
headerMessage={headerMessage}
textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
textInputLabel={shouldShowTextInput ? translate('common.searchText') : undefined}
isRowMultilineSupported
initiallyFocusedOptionKey={selectedOptionKey}
onChangeText={setSearchValue}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TaxPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function TaxPicker({selectedTaxRate = '', policy, transaction, insets, onSubmit,
sections={sections}
headerMessage={headerMessage}
textInputValue={searchValue}
textInputLabel={shouldShowTextInput ? translate('common.search') : undefined}
textInputLabel={shouldShowTextInput ? translate('common.searchText') : undefined}
onChangeText={setSearchValue}
onSelectRow={handleSelectRow}
ListItem={RadioListItem}
Expand Down
11 changes: 7 additions & 4 deletions src/hooks/useStepFormSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ export default function useStepFormSubmit<T extends keyof OnyxFormValuesMapping>
return useCallback(
(values: FormOnyxValues<T>) => {
if (shouldSaveDraft) {
const stepValues = fieldIds.reduce((acc, key) => {
acc[key] = values[key];
return acc;
}, {} as Record<TupleToUnion<typeof fieldIds>, OnyxValues[T][Exclude<keyof OnyxValues[T], keyof BaseForm>]>);
const stepValues = fieldIds.reduce(
(acc, key) => {
acc[key] = values[key];
return acc;
},
{} as Record<TupleToUnion<typeof fieldIds>, OnyxValues[T][Exclude<keyof OnyxValues[T], keyof BaseForm>]>,
);

FormActions.setDraftValues(formId, stepValues);
}
Expand Down
Loading
Loading