Skip to content

Commit

Permalink
feat(task): i18n updates after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpetty committed Mar 19, 2024
1 parent 38c9a10 commit 9e4647c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
10 changes: 2 additions & 8 deletions packages/sanity/src/tasks/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
'buttons.create.text': 'Create Task',
/** The label for the button to discard changes */
'buttons.discard.text': 'Discard',
/** The label for the button to open the draft */
'buttons.draft.text': 'Draft',
/** The label for the button to create a new task */
'buttons.new.text': 'New task',
/** The label for the button that will navigate to the next task */
Expand Down Expand Up @@ -87,14 +89,6 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
'panel.comment.placeholder': 'Add a comment...',
/** The title used in the task panel when showing the create task form */
'panel.create.title': 'Create',
/** The help text used in the draft menu*/
'panel.drafts.helptext': 'continue working on your drafts',
/** The title of a draft task in the draft pulldown */
'panel.drafts.item.title': '{{title}}',
/** The title of a draft task in the draft pulldown that is currrently being edited */
'panel.drafts.item.title_editing': '(editing) {{title}}',
/** The default title of a draft task */
'panel.drafts.item.untitled': 'Untitled',
/** The title used in the drafts pulldown */
'panel.drafts.title': 'Drafts',
/** The tooltip for the task navigation component */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export function TasksActivityLog(props: TasksActivityLogProps) {
<Flex align="center">
<Box flex={1}>
<Text size={2} weight="semibold">
{t('tasks.panel.activity.title')}
{t('panel.activity.title')}
</Text>
</Box>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function TasksActiveTabNavigation(props: TasksActiveTabNavigationProps) {
</Box>
</Tooltip>
<Button
tooltipProps={{content: t('buttons.previous.tooltip')}}
tooltipProps={{content: t('buttons.next.tooltip')}}
mode="bleed"
icon={ChevronRightIcon}
onClick={goToNextTask}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {useCurrentUser, useTranslation} from 'sanity'
import styled from 'styled-components'

import {Button, MenuButton, type MenuButtonProps, MenuItem} from '../../../../../ui-components'
import {tasksLocaleNamespace} from '../../../../i18n'
import {useTasks, useTasksNavigation} from '../../context'
import {type TaskDocument} from '../../types'
import {tasksLocaleNamespace} from '../../../../i18n'

const MENU_BUTTON_POPOVER_PROPS: MenuButtonProps['popover'] = {
constrainSize: true,
Expand Down Expand Up @@ -79,7 +79,7 @@ export function TasksHeaderDraftsMenu() {

return (
<MenuButton
button={<Button text="Drafts" mode="ghost" iconRight={ChevronDownIcon} />}
button={<Button text={t('buttons.draft.text')} mode="ghost" iconRight={ChevronDownIcon} />}
id="edit-task-menu"
menu={
<StyledMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ export function TasksSidebarHeader(props: TasksSidebarHeaderProps) {
{viewMode === 'list' ? (
<Box padding={2}>
<Text size={2} weight="semibold">
{t('tasks.panel.title')}
{t('panel.title')}
</Text>
</Box>
) : (
<>
<UIButton mode="bleed" space={2} padding={2} onClick={handleGoBack}>
<Text size={1}>{t('tasks.panel.title')}</Text>
<Text size={1}>{t('panel.title')}</Text>
</UIButton>
<ChevronRightIcon />
<Box paddingX={2}>
<Text size={1} weight="semibold" style={{textTransform: 'capitalize'}}>
{viewMode === 'create' || viewMode === 'draft' ? t('panel.create.title') : activeTabId}
{viewMode === 'create' || viewMode === 'draft'
? t('panel.create.title')
: activeTabId}
</Text>
</Box>
</>
Expand All @@ -67,7 +69,12 @@ export function TasksSidebarHeader(props: TasksSidebarHeaderProps) {
{viewMode === 'edit' && <TasksActiveTabNavigation items={allItems} />}
<Flex gap={1}>
{viewMode === 'list' && (
<Button icon={AddIcon} onClick={handleTaskCreate} mode="bleed" text={t('buttons.new.text')} />
<Button
icon={AddIcon}
onClick={handleTaskCreate}
mode="bleed"
text={t('buttons.new.text')}
/>
)}

<Button
Expand Down

0 comments on commit 9e4647c

Please sign in to comment.