Skip to content

Commit

Permalink
Add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Dec 22, 2023
1 parent 0db1612 commit 792190c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,10 @@ export default {
notFound: 'No workspace found',
description: 'Rooms are a great place to discuss and work with multiple people. To begin collaborating, create or join a workspace',
},
switcher: {
headerTitle: 'Choose a workspace',
everythingSection: 'Everything',
},
new: {
newWorkspace: 'New workspace',
getTheExpensifyCardAndMore: 'Get the Expensify Card and more',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,10 @@ export default {
notFound: 'No se encontró ningún espacio de trabajo',
description: 'Las salas son un gran lugar para discutir y trabajar con varias personas. Para comenzar a colaborar, cree o únase a un espacio de trabajo',
},
switcher: {
headerTitle: 'Elegir un espacio de trabajo',
everythingSection: 'Todo',
},
new: {
newWorkspace: 'Nuevo espacio de trabajo',
getTheExpensifyCardAndMore: 'Consigue la Tarjeta Expensify y más',
Expand Down
24 changes: 7 additions & 17 deletions src/pages/WorkspaceSwitcherPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import SCREENS from '@src/SCREENS';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import Icon from '@components/Icon';
import useLocalize from '@hooks/useLocalize';
import WorkspaceCardCreateAWorkspace from './workspace/card/WorkspaceCardCreateAWorkspace';

const propTypes = {
Expand Down Expand Up @@ -60,6 +61,7 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) {
const [selectedOption, setSelectedOption] = useState();
const [searchTerm, setSearchTerm] = useState('');
const {inputCallbackRef} = useAutoFocusInput();
const {translate} = useLocalize();

const getIndicatorTypeForPolicy = useCallback(
// TO DO: Wait for missing logic to be implemented in other PR
Expand Down Expand Up @@ -147,7 +149,7 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) {
style={styles.label}
color={theme.textSupporting}
>
Everything
{translate('workspace.switcher.everythingSection')}
</Text>
</View>
<View>
Expand All @@ -162,19 +164,7 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) {
</View>
</>
);
}, [
activeWorkspaceID,
getIndicatorTypeForPolicy,
hasUnreadData,
selectPolicy,
styles.alignItemsCenter,
styles.flexRow,
styles.justifyContentBetween,
styles.label,
styles.mb3,
styles.mh4,
theme.textSupporting,
]);
}, [activeWorkspaceID, getIndicatorTypeForPolicy, hasUnreadData, selectPolicy, styles.alignItemsCenter, styles.flexRow, styles.justifyContentBetween, styles.label, styles.mb3, styles.mh4, theme.textSupporting, translate]);

const workspacesSection = useMemo(
() => (
Expand All @@ -186,7 +176,7 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) {
style={[styles.mt3, styles.label]}
color={theme.textSupporting}
>
Workspaces
{translate('common.workspaces')}
</Text>
</View>
<PressableWithFeedback role={CONST.ROLE.BUTTON}>
Expand Down Expand Up @@ -221,7 +211,7 @@ additionalStyles={[styles.buttonDefaultBG, styles.borderRadiusNormal, styles.p2,
/> : <WorkspaceCardCreateAWorkspace/>}
</>
),
[inputCallbackRef, onChangeText, searchTerm, selectPolicy, selectedOption, styles.alignItemsEnd, styles.borderRadiusNormal, styles.buttonDefaultBG, styles.buttonHoveredBG, styles.flexRow, styles.justifyContentBetween, styles.label, styles.mb1, styles.mb3, styles.mh4, styles.mt0, styles.mt2, styles.mt3, styles.p2, styles.pt0, theme.textSupporting, usersWorkspaces.length, usersWorkspacesSectionData],
[inputCallbackRef, onChangeText, searchTerm, selectPolicy, selectedOption, styles.alignItemsEnd, styles.borderRadiusNormal, styles.buttonDefaultBG, styles.buttonHoveredBG, styles.flexRow, styles.justifyContentBetween, styles.label, styles.mb1, styles.mb3, styles.mh4, styles.mt0, styles.mt2, styles.mt3, styles.p2, styles.pt0, theme.textSupporting, translate, usersWorkspaces.length, usersWorkspacesSectionData],
);

useEffect(() => {
Expand All @@ -234,7 +224,7 @@ additionalStyles={[styles.buttonDefaultBG, styles.borderRadiusNormal, styles.p2,

return (
<HeaderPageLayout
title="Choose a workspace"
title={translate('workspace.switcher.headerTitle')}
backgroundColor={theme.PAGE_THEMES[SCREENS.WORKSPACE_SWITCHER.ROOT].backgroundColor}
>
{everythingSection}
Expand Down

0 comments on commit 792190c

Please sign in to comment.