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

Cleanup tab selector translations #25782

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/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 @@ -166,7 +166,7 @@ function MoneyRequestView({report, parentReport, shouldShowHorizontalRule, polic
</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}
shouldShowRightIcon={false}
/>
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 @@ -157,6 +157,7 @@ export default {
merchant: 'Merchant',
receipt: 'Receipt',
replace: 'Replace',
distance: 'Distance',
},
anonymousReportFooter: {
logoTagline: 'Join in on the discussion.',
Expand Down Expand Up @@ -369,7 +370,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 @@ -156,6 +156,7 @@ export default {
merchant: 'Comerciante',
receipt: 'Recibo',
replace: 'Sustituir',
distance: 'Distancia',
},
anonymousReportFooter: {
logoTagline: 'Únete a la discussion.',
Expand Down Expand Up @@ -368,7 +369,6 @@ export default {
tabSelector: {
manual: 'Manual',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arosiclair Manual is not translated. Do we want to fix this part of this PR?
Should be a simple change IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Manual" is the translation 😄 . It's the same in English and Spanish

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOPS, didn't know that. Seems i am pretty weak in translations 🫣.
Code is working fine AFAIK. I will finish this review in couple of hours.

scan: 'Escanear',
distance: 'Distancia',
},
receipt: {
upload: 'Subir recibo',
Expand Down
Loading