Skip to content

Commit

Permalink
Merge pull request #25782 from Expensify/arosiclair-cleanup-tab-selec…
Browse files Browse the repository at this point in the history
…tor-translations

Cleanup tab selector translations
  • Loading branch information
techievivek authored Aug 28, 2023
2 parents 8fdb052 + b94d5b4 commit 64ff471
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function MoneyRequestPreview(props) {

const getPreviewHeaderText = () => {
if (isDistanceRequest) {
return props.translate('tabSelector.distance');
return props.translate('common.distance');
}

if (isScanning) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function MoneyRequestView({report, parentReport, shouldShowHorizontalRule, trans
</OfflineWithFeedback>
<OfflineWithFeedback pendingAction={lodashGet(transaction, 'pendingFields.merchant') || lodashGet(transaction, 'pendingAction')}>
<MenuItemWithTopDescription
description={isDistanceRequest ? translate('tabSelector.distance') : translate('common.merchant')}
description={isDistanceRequest ? translate('common.distance') : translate('common.merchant')}
title={transactionMerchant}
disabled={isSettled || !canEdit}
shouldShowRightIcon={canEdit}
Expand Down
13 changes: 12 additions & 1 deletion src/components/TabSelector/TabSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ const getIcon = (route) => {
}
};

const getTitle = (route, translate) => {
switch (route) {
case CONST.TAB.SCAN:
return translate('tabSelector.scan');
case CONST.TAB.DISTANCE:
return translate('common.distance');
default:
return translate('tabSelector.manual');
}
};

function TabSelector({state, navigation, onTabPress}) {
const {translate} = useLocalize();
return (
Expand All @@ -64,7 +75,7 @@ function TabSelector({state, navigation, onTabPress}) {
<TabSelectorItem
isSelected={isFocused}
key={route.name}
title={translate(`tabSelector.${route.name}`)}
title={getTitle(route.name, translate)}
icon={getIcon(route.name)}
onPress={onPress}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export default {
category: 'Category',
receipt: 'Receipt',
replace: 'Replace',
distance: 'Distance',
},
anonymousReportFooter: {
logoTagline: 'Join the discussion.',
Expand Down Expand Up @@ -375,7 +376,6 @@ export default {
tabSelector: {
manual: 'Manual',
scan: 'Scan',
distance: 'Distance',
},
receipt: {
upload: 'Upload receipt',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export default {
category: 'Categoría',
receipt: 'Recibo',
replace: 'Sustituir',
distance: 'Distancia',
},
anonymousReportFooter: {
logoTagline: 'Únete a la discusión.',
Expand Down Expand Up @@ -374,7 +375,6 @@ export default {
tabSelector: {
manual: 'Manual',
scan: 'Escanear',
distance: 'Distancia',
},
receipt: {
upload: 'Subir recibo',
Expand Down

0 comments on commit 64ff471

Please sign in to comment.