Skip to content

Commit

Permalink
Add UI translations
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Jun 10, 2024
1 parent f02573c commit 96bb9ff
Show file tree
Hide file tree
Showing 23 changed files with 1,512 additions and 68 deletions.
4 changes: 2 additions & 2 deletions source/renderer/components/vault/AddEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const AddEntry = ({ disabled }) => {
key={entryType.type}
text={t(`entry-type.title.${entryType.type}`)}
icon={entryType.icon}
label={entryType.default ? t("entry-type.default-label") : undefined}
label={entryType.default ? t("vault-ui.entry-type.default-label") : undefined}
onClick={() => onAddEntry(entryType.type || defaultEntryType)}
/>
))}
Expand All @@ -25,7 +25,7 @@ const AddEntry = ({ disabled }) => {
<ButtonGroup fill>
<Button
icon="plus"
text={t("new-entry.cta")}
text={t("vault-ui.new-entry.cta")}
onClick={() => onAddEntry(defaultEntryType)}
disabled={disabled}
fill
Expand Down
2 changes: 1 addition & 1 deletion source/renderer/components/vault/ConfirmButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function ConfirmButton(
<H5>{title}</H5>
<p>{description}</p>
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
<Button text={t("cancel")} className={Classes.POPOVER_DISMISS} disabled={disabled} />
<Button text={t("vault-ui.cancel")} className={Classes.POPOVER_DISMISS} disabled={disabled} />
<Button
text={primaryAction}
onClick={onClick}
Expand Down
10 changes: 5 additions & 5 deletions source/renderer/components/vault/EntriesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const EntriesList = ({ className }: EntriesListProps) => {
return (
<PaneContainer className={className}>
<PaneHeader
title={trashSelected ? t("entries-list.trash") : t("entries-list.documents")}
title={trashSelected ? t("vault-ui.entries-list.trash") : t("vault-ui.entries-list.documents")}
count={entries.length}
filter={filters}
onTermChange={term => onEntriesFilterTermChange(term)}
Expand All @@ -96,15 +96,15 @@ export const EntriesList = ({ className }: EntriesListProps) => {
</HotKeys>
)}
{entries.length === 0 && filters.term !== "" && (
<NonIdealState title={t("entries-list.filters-no-matches")} />
<NonIdealState title={t("vault-ui.entries-list.filters-no-matches")} />
)}
{entries.length === 0 && trashSelected && (
<NonIdealState title={t("entries-list.trash-empty")} icon="trash" />
<NonIdealState title={t("vault-ui.entries-list.trash-empty")} icon="trash" />
)}
{entries.length === 0 && filters.term && !trashSelected && (
<NonIdealState
title={t("entries-list.no-entries")}
description={t("entries-list.create-one-cta")}
title={t("vault-ui.entries-list.no-entries")}
description={t("vault-ui.entries-list.create-one-cta")}
icon="id-number"
/>
)}
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/components/vault/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ export function Entry({ entry, selected, onClick, innerRef, ...props }) {
setContextMenuVisibility(true);
ContextMenu.show(
<Menu>
<MenuItem text={t("entry-menu.move-to")} icon="add-to-folder">
<MenuItem text={t("vault-ui.entry-menu.move-to")} icon="add-to-folder">
{renderGroupsMenu(groups)}
</MenuItem>
{entry.parentID !== trashID && (
<MenuItem
text={t("entry-menu.move-to-trash")}
text={t("vault-ui.entry-menu.move-to-trash")}
icon="trash"
onClick={() => onMoveEntryToTrash(entry.id)}
disabled={readOnly}
Expand Down
62 changes: 31 additions & 31 deletions source/renderer/components/vault/EntryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const Attachments = ({
<AttachmentsContainer>
{attachments.length === 0 && (
<AttachmentDropInstruction>
{t("attachments.drop-instruction")}
{t("vault-ui.attachments.drop-instruction")}
</AttachmentDropInstruction>
)}
{attachments.map(attachment => {
Expand Down Expand Up @@ -422,18 +422,18 @@ const Attachments = ({
<Button
intent={Intent.PRIMARY}
onClick={() => onDownloadAttachment(previewingAttachment)}
title={t("attachments.download-title")}
title={t("vault-ui.attachments.download-title")}
>
{t("attachments.download")}
{t("vault-ui.attachments.download")}
</Button>
&nbsp;
<Button
intent={Intent.DANGER}
onClick={() => setDeletingAttachment(previewingAttachment)}
title={t("attachments.delete-title")}
title={t("vault-ui.attachments.delete-title")}
disabled={readOnly}
>
{t("attachments.delete")}
{t("vault-ui.attachments.delete")}
</Button>
</div>
</Fragment>
Expand All @@ -448,8 +448,8 @@ const Attachments = ({
})}
</div>
<div className={Classes.DIALOG_BODY}>
{t("attachments.confirm.delete-prompt")
.split("\n")
{t("vault-ui.attachments.confirm.delete-prompt")
.split("vault-ui.\n")
.map(line => (
<p>{line}</p>
))}
Expand All @@ -464,16 +464,16 @@ const Attachments = ({
setPreviewingAttachment(null);
attachmentItem && onDeleteAttachment(attachmentItem);
}}
title={t("attachments.confirm.delete-title")}
title={t("vault-ui.attachments.confirm.delete-title")}
disabled={readOnly}
>
{t("attachments.confirm.delete")}
{t("vault-ui.attachments.confirm.delete")}
</Button>
<Button
onClick={() => setDeletingAttachment(null)}
title={t("attachments.confirm.cancel-title")}
title={t("vault-ui.attachments.confirm.cancel-title")}
>
{t("attachments.confirm.cancel")}
{t("vault-ui.attachments.confirm.cancel")}
</Button>
</div>
</div>
Expand Down Expand Up @@ -533,8 +533,8 @@ const FieldText = ({ entryFacade, field }) => {
<Button
text={
visible
? t("entry.field-controls.password.hide")
: t("entry.field-controls.password.reveal")
? t("vault-ui.entry.field-controls.password.hide")
: t("vault-ui.entry.field-controls.password.reveal")
}
small
onClick={() => toggleVisibility(!visible)}
Expand Down Expand Up @@ -644,7 +644,7 @@ const FieldRow = ({
const label =
editing && field.removeable ? (
<EditableText
placeholder={t("entry.click-to-edit")}
placeholder={t("vault-ui.entry.click-to-edit")}
value={field.property}
onChange={value => {
onFieldNameUpdate(field, value);
Expand All @@ -663,7 +663,7 @@ const FieldRow = ({
{FIELD_TYPE_OPTIONS.map(fieldTypeOption => (
<MenuItem
key={fieldTypeOption.type}
text={`${t("custom-fields.change-type")} ${t(fieldTypeOption.i18nKey)}`}
text={`${t("vault-ui.custom-fields.change-type")} ${t(fieldTypeOption.i18nKey)}`}
icon={fieldTypeOption.icon}
labelElement={
field.valueType === fieldTypeOption.type ? <Icon icon="small-tick" /> : undefined
Expand All @@ -675,7 +675,7 @@ const FieldRow = ({
))}
<MenuDivider />
<MenuItem
text={t("custom-fields.delete-field")}
text={t("vault-ui.custom-fields.delete-field")}
icon="trash"
onClick={() => onRemoveField(field)}
/>
Expand Down Expand Up @@ -833,7 +833,7 @@ const EntryDetailsContent = () => {
return (
<>
<PaneHeader
title={editing ? t("entry.edit-document") : title(entry, t("entry.untitled"))}
title={editing ? t("vault-ui.entry.edit-document") : title(entry, t("vault-ui.entry.untitled"))}
/>
<PaneContent>
{entry?.type === EntryType.CreditCard && (
Expand All @@ -855,7 +855,7 @@ const EntryDetailsContent = () => {
</FormContainer>
{editing || removeableFields.length > 0 && (
<CustomFieldsHeading>
<span>{t("entry.custom-fields")}</span>
<span>{t("vault-ui.entry.custom-fields")}</span>
</CustomFieldsHeading>
)}
{removeableFields.length > 0 && (
Expand All @@ -877,14 +877,14 @@ const EntryDetailsContent = () => {
{editing && (
<Button
onClick={onAddField}
text={t("entry.add-custom-field-btn")}
text={t("vault-ui.entry.add-custom-field-btn")}
icon="small-plus"
/>
)}
{!editing && supportsAttachments && (
<Fragment>
<CustomFieldsHeading>
<span>{t("entry.attachments")}</span>
<span>{t("vault-ui.entry.attachments")}</span>
</CustomFieldsHeading>
{entry && (
<Attachments
Expand Down Expand Up @@ -913,7 +913,7 @@ const EntryDetailsContent = () => {
icon="edit"
disabled={readOnly || entry.parentID === trashID}
>
{t("entry.edit")}
{t("vault-ui.entry.edit")}
</Button>
)}
{editing && (
Expand All @@ -926,25 +926,25 @@ const EntryDetailsContent = () => {
onClick={onSaveEdit}
title={
readOnly
? t("entry.save-disabled-title.readonly")
? t("vault-ui.entry.save-disabled-title.readonly")
: hasUntitledFields
? t("entry.save-disabled-title.untitled")
? t("vault-ui.entry.save-disabled-title.untitled")
: undefined
}
>
{t("entry.save")}
{t("vault-ui.entry.save")}
</Button>
<Button onClick={onCancelEdit}>{t("entry.cancel-edit")}</Button>
<Button onClick={onCancelEdit}>{t("vault-ui.entry.cancel-edit")}</Button>
</div>
{entry && !entry.isNew && (
<ConfirmButton
danger
description={t("entry.trash-move.message")}
description={t("vault-ui.entry.trash-move.message")}
disabled={readOnly}
icon="trash"
onClick={() => onMoveEntryToTrash(entry.id)}
primaryAction={t("entry.trash-move.trash-btn")}
title={t("entry.trash-move.title")}
primaryAction={t("vault-ui.entry.trash-move.trash-btn")}
title={t("vault-ui.entry.trash-move.title")}
/>
)}
</Fragment>
Expand Down Expand Up @@ -977,7 +977,7 @@ export const EntryDetails = () => {
<Fragment>
<AttachmentDropZone visible={isDragActive && !readOnly}>
<Icon icon="compressed" iconSize={30} />
<span>{t("attachments.drop-files")}</span>
<span>{t("vault-ui.attachments.drop-files")}</span>
</AttachmentDropZone>
<input {...getInputProps()} />
</Fragment>
Expand All @@ -988,8 +988,8 @@ export const EntryDetails = () => {
<PaneContent>
<NonIdealState
icon="document"
title={t("entry.none-selected.title")}
description={t("entry.none-selected.message")}
title={t("vault-ui.entry.none-selected.title")}
description={t("vault-ui.entry.none-selected.message")}
/>
</PaneContent>
)}
Expand Down
Loading

0 comments on commit 96bb9ff

Please sign in to comment.