Skip to content

Commit

Permalink
Merge pull request #23256 from Expensify/vit-fixLinter2
Browse files Browse the repository at this point in the history
[NoQA] Fix the usage of localize
  • Loading branch information
Beamanator authored Jul 20, 2023
2 parents 82fd2f9 + 8ba21ac commit be0b186
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const defaultProps = {
};

function OptionRowLHN(props) {
const localize = useLocalize();
const {translate} = useLocalize();

const optionItem = props.optionItem;
const [isContextMenuActive, setIsContextMenuActive] = useState(false);
Expand Down Expand Up @@ -156,7 +156,7 @@ function OptionRowLHN(props) {
(hovered || isContextMenuActive) && !props.isFocused ? props.hoverStyle : null,
]}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
accessibilityLabel={localize.translate('accessibilityHints.navigatesToChat')}
accessibilityLabel={translate('accessibilityHints.navigatesToChat')}
>
<View style={sidebarInnerRowStyle}>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
Expand Down Expand Up @@ -184,7 +184,7 @@ function OptionRowLHN(props) {
<View style={contentContainerStyles}>
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mw100, styles.overflowHidden]}>
<DisplayNames
accessibilityLabel={localize.translate('accessibilityHints.chatUserDisplayNames')}
accessibilityLabel={translate('accessibilityHints.chatUserDisplayNames')}
fullTitle={optionItem.text}
displayNamesWithTooltips={optionItem.displayNamesWithTooltips}
tooltipEnabled
Expand All @@ -199,9 +199,9 @@ function OptionRowLHN(props) {
<Text
style={alternateTextStyle}
numberOfLines={1}
accessibilityLabel={localize.translate('accessibilityHints.lastChatMessagePreview')}
accessibilityLabel={translate('accessibilityHints.lastChatMessagePreview')}
>
{optionItem.isLastMessageDeletedParentAction ? props.translate('parentReportAction.deletedMessage') : optionItem.alternateText}
{optionItem.isLastMessageDeletedParentAction ? translate('parentReportAction.deletedMessage') : optionItem.alternateText}
</Text>
) : null}
</View>
Expand Down Expand Up @@ -233,15 +233,15 @@ function OptionRowLHN(props) {
{optionItem.hasDraftComment && (
<View
style={styles.ml2}
accessibilityLabel={localize.translate('sidebarScreen.draftedMessage')}
accessibilityLabel={translate('sidebarScreen.draftedMessage')}
>
<Icon src={Expensicons.Pencil} />
</View>
)}
{!shouldShowGreenDotIndicator && optionItem.isPinned && (
<View
style={styles.ml2}
accessibilityLabel={localize.translate('sidebarScreen.chatPinned')}
accessibilityLabel={translate('sidebarScreen.chatPinned')}
>
<Icon src={Expensicons.Pin} />
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/components/UserDetailsTooltip/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as LocalePhoneNumber from '../../libs/LocalePhoneNumber';
import useLocalize from '../../hooks/useLocalize';

function UserDetailsTooltip(props) {
const localize = useLocalize();
const {translate} = useLocalize();

const userDetails = lodashGet(props.personalDetailsList, props.accountID, props.fallbackUserDetails);
let userDisplayName = userDetails.displayName ? userDetails.displayName.trim() : '';
Expand All @@ -28,7 +28,7 @@ function UserDetailsTooltip(props) {
if (props.delegateAccountID) {
const delegateUserDetails = lodashGet(props.personalDetailsList, props.delegateAccountID, {});
const delegateUserDisplayName = delegateUserDetails.displayName ? delegateUserDetails.displayName.trim() : '';
userDisplayName = `${delegateUserDisplayName} (${localize.translate('reportAction.asCopilot')} ${userDisplayName})`;
userDisplayName = `${delegateUserDisplayName} (${translate('reportAction.asCopilot')} ${userDisplayName})`;
userLogin = delegateUserDetails.login;
userAvatar = delegateUserDetails.avatar;
userAccountID = props.delegateAccountID;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/sidebar/SidebarLinksData.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const defaultProps = {
};

function SidebarLinksData({isFocused, allReportActions, betas, chatReports, currentReportID, insets, isPersonalDetailsLoading, isSmallScreenWidth, onLinkClick, policies, priorityMode}) {
const localize = useLocalize();
const {translate} = useLocalize();

const reportIDsRef = useRef([]);
const optionListItems = useMemo(() => {
Expand All @@ -82,7 +82,7 @@ function SidebarLinksData({isFocused, allReportActions, betas, chatReports, curr
return (
<View
accessibilityElementsHidden={!isFocused}
accessibilityLabel={localize.translate('sidebarScreen.listOfChats')}
accessibilityLabel={translate('sidebarScreen.listOfChats')}
style={[styles.flex1, styles.h100]}
>
<SidebarLinks
Expand Down

0 comments on commit be0b186

Please sign in to comment.