mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-05 17:31:22 +02:00
Localization of steps + taxonomy
This commit is contained in:
@@ -10,6 +10,8 @@ import { useCallback } from 'react';
|
||||
import { MergeIcon } from '../../../components/icons/MergeIcon';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { LinkButton } from '../Common/LinkButton';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ITaxonomyActionsProps {
|
||||
field: string | null;
|
||||
@@ -61,39 +63,47 @@ export const TaxonomyActions: React.FunctionComponent<ITaxonomyActionsProps> = (
|
||||
<div className={`space-x-2`}>
|
||||
{unmapped && (
|
||||
<LinkButton
|
||||
title={`Add ${value} to taxonomy settings`}
|
||||
title={l10n.t(LocalizationKey.dashboardTaxonomyViewButtonAddTitle, value)}
|
||||
onClick={onAdd}>
|
||||
<PlusIcon className={`w-4 h-4`} aria-hidden={true} />
|
||||
<span className="sr-only">Add to settings</span>
|
||||
<span className="sr-only">
|
||||
{l10n.t(LocalizationKey.dashboardTaxonomyViewButtonAddTitle, value)}
|
||||
</span>
|
||||
</LinkButton>
|
||||
)}
|
||||
|
||||
<LinkButton
|
||||
title={`Edit ${value}`}
|
||||
title={l10n.t(LocalizationKey.dashboardTaxonomyViewButtonEditTitle, value)}
|
||||
onClick={onEdit}>
|
||||
<PencilIcon className={`w-4 h-4`} aria-hidden={true} />
|
||||
<span className="sr-only">Edit</span>
|
||||
<span className="sr-only">{l10n.t(LocalizationKey.commonEdit)}</span>
|
||||
</LinkButton>
|
||||
|
||||
<LinkButton
|
||||
title={`Merge ${value}`}
|
||||
title={l10n.t(LocalizationKey.dashboardTaxonomyViewButtonMergeTitle, value)}
|
||||
onClick={onMerge}>
|
||||
<MergeIcon className={`w-4 h-4`} aria-hidden={true} />
|
||||
<span className="sr-only">Merge</span>
|
||||
<span className="sr-only">
|
||||
{l10n.t(LocalizationKey.dashboardTaxonomyViewButtonMergeTitle, value)}
|
||||
</span>
|
||||
</LinkButton>
|
||||
|
||||
<LinkButton
|
||||
title={`Move to another taxonomy type`}
|
||||
title={l10n.t(LocalizationKey.dashboardTaxonomyViewButtonMoveTitle)}
|
||||
onClick={onMove}>
|
||||
<ArrowCircleUpIcon className={`w-4 h-4`} aria-hidden={true} />
|
||||
<span className="sr-only">Move to another taxonomy type</span>
|
||||
<span className="sr-only">
|
||||
{l10n.t(LocalizationKey.dashboardTaxonomyViewButtonMoveTitle)}
|
||||
</span>
|
||||
</LinkButton>
|
||||
|
||||
<LinkButton
|
||||
title={`Delete ${value}`}
|
||||
title={l10n.t(LocalizationKey.dashboardTaxonomyViewButtonDeleteTitle, value)}
|
||||
onClick={onDelete}>
|
||||
<TrashIcon className={`w-4 h-4`} aria-hidden={true} />
|
||||
<span className="sr-only">Delete</span>
|
||||
<span className="sr-only">
|
||||
{l10n.t(LocalizationKey.dashboardTaxonomyViewButtonDeleteTitle, value)}
|
||||
</span>
|
||||
</LinkButton>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -7,6 +7,8 @@ import { getTaxonomyField } from '../../../helpers/getTaxonomyField';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { routePaths } from '../..';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ITaxonomyLookupProps {
|
||||
taxonomy: string | null;
|
||||
@@ -57,7 +59,7 @@ export const TaxonomyLookup: React.FunctionComponent<ITaxonomyLookupProps> = ({
|
||||
return (
|
||||
<button
|
||||
className={total ? `font-bold ${getColors(`text-teal-900 hover:text-teal-600 `, `text-[var(--frontmatter-link)] hover:text-[var(--frontmatter-link-hover)]`)}` : ``}
|
||||
title={total ? `Show contents with ${value} in ${taxonomy}` : ``}
|
||||
title={total ? l10n.t(LocalizationKey.dashboardTaxonomyViewTaxonomyLookupButtonTitle, value, taxonomy) : ``}
|
||||
onClick={onNavigate}
|
||||
>
|
||||
{total || `-`}
|
||||
|
||||
Reference in New Issue
Block a user