Skip to content

Commit

Permalink
chore: translate components
Browse files Browse the repository at this point in the history
  • Loading branch information
tankerkiller125 committed Aug 4, 2024
1 parent e000484 commit a0cdb23
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 27 deletions.
12 changes: 5 additions & 7 deletions frontend/components/App/ImportDialog.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<BaseModal v-model="dialog">
<template #title> Import CSV File </template>
<template #title> {{ $t("components.app.import_dialog.title") }} </template>
<p>
Import a CSV file containing your items, labels, and locations. See documentation for more information on the
required format.
{{ $t("components.app.import_dialog.description") }}
</p>
<div class="alert alert-warning shadow-lg mt-4">
<div>
Expand All @@ -21,8 +20,7 @@
/>
</svg>
<span class="text-sm">
Behavior for imports with existing import_refs has changed. If an import_ref is present in the CSV file, the
item will be updated with the values in the CSV file.
{{ $t("components.app.import_dialog.change_warning") }}
</span>
</div>
</div>
Expand All @@ -33,15 +31,15 @@

<BaseButton type="button" @click="uploadCsv">
<MdiUpload class="h-5 w-5 mr-2" />
Upload
{{ $t("components.app.import_dialog.upload") }}
</BaseButton>
<p class="text-center pt-4 -mb-5">
{{ importCsv?.name }}
</p>
</div>

<div class="modal-action">
<BaseButton type="submit" :disabled="!importCsv"> Submit </BaseButton>
<BaseButton type="submit" :disabled="!importCsv"> {{ $t("global.submit") }} </BaseButton>
</div>
</form>
</BaseModal>
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/Item/CreateModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseModal v-model="modal">
<template #title> Create Item </template>
<template #title> {{ $t("components.item.create_modal.title") }} </template>
<form @submit.prevent="create()">
<LocationSelector v-model="form.location" />
<FormTextField ref="nameInput" v-model="form.name" :trigger-focus="focused" :autofocus="true" label="Item Name" />
Expand All @@ -13,15 +13,15 @@
<MdiPackageVariant class="swap-off h-5 w-5" />
<MdiPackageVariantClosed class="swap-on h-5 w-5" />
</template>
Create
{{ $t("global.create") }}
</BaseButton>
<div class="dropdown dropdown-top">
<label tabindex="0" class="btn rounded-l-none rounded-r-xl">
<MdiChevronDown class="h-5 w-5" name="mdi-chevron-down" />
</label>
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-64 right-0">
<li>
<button type="button" @click="create(false)">Create and Add Another</button>
<button type="button" @click="create(false)">{{ $t("global.create_and_add") }}</button>
</li>
</ul>
</div>
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/Item/View/Selectable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<template>
<section>
<BaseSectionHeader class="mb-2 flex justify-between items-center">
Items
{{ $t("components.item.view.selectable.items") }}
<template #description>
<div v-if="!viewSet" class="dropdown dropdown-hover dropdown-left">
<label tabindex="0" class="btn btn-ghost m-1">
Expand All @@ -39,13 +39,13 @@
<li>
<button @click="setViewPreference('card')">
<MdiCardTextOutline class="h-5 w-5" />
Card
{{ $t("components.item.view.selectable.card") }}
</button>
</li>
<li>
<button @click="setViewPreference('table')">
<MdiTable class="h-5 w-5" />
Table
{{ $t("components.item.view.selectable.table") }}
</button>
</li>
</ul>
Expand All @@ -59,7 +59,7 @@
<template v-else>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
<ItemCard v-for="item in items" :key="item.id" :item="item" />
<div class="first:block hidden text-lg">No Items to Display</div>
<div class="first:block hidden text-lg">{{ $t("components.item.view.selectable.no_items") }}</div>
</div>
</template>
</section>
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/Label/CreateModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseModal v-model="modal">
<template #title> Create Label </template>
<template #title>{{ $t("components.label.create_modal.title") }}</template>
<form @submit.prevent="create()">
<FormTextField
ref="locationNameRef"
Expand All @@ -12,14 +12,14 @@
<FormTextArea v-model="form.description" label="Label Description" />
<div class="modal-action">
<div class="flex justify-center">
<BaseButton class="rounded-r-none" :loading="loading" type="submit"> Create </BaseButton>
<BaseButton class="rounded-r-none" :loading="loading" type="submit"> {{ $t("global.create") }} </BaseButton>
<div class="dropdown dropdown-top">
<label tabindex="0" class="btn rounded-l-none rounded-r-xl">
<MdiChevronDown class="h-5 w-5" />
</label>
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-64 right-0">
<li>
<button type="button" @click="create(false)">Create and Add Another</button>
<button type="button" @click="create(false)">{{ $t("global.create_and_add") }}</button>
</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/Location/CreateModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseModal v-model="modal">
<template #title> Create Location </template>
<template #title>{{ $t("components.location.create_modal.title") }}</template>
<form @submit.prevent="create()">
<FormTextField
ref="locationNameRef"
Expand All @@ -13,14 +13,14 @@
<LocationSelector v-model="form.parent" />
<div class="modal-action">
<div class="flex justify-center">
<BaseButton class="rounded-r-none" type="submit" :loading="loading"> Create </BaseButton>
<BaseButton class="rounded-r-none" type="submit" :loading="loading">{{ $t("global.create") }}</BaseButton>
<div class="dropdown dropdown-top">
<label tabindex="0" class="btn rounded-l-none rounded-r-xl">
<MdiChevronDown class="h-5 w-5" />
</label>
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-64 right-0">
<li>
<button type="button" @click="create(false)">Create and Add Another</button>
<button type="button" @click="create(false)">{{ $t("global.create_and_add") }}</button>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/ModalConfirm.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<BaseModal v-model="isRevealed" readonly @cancel="cancel(false)">
<template #title> Confirm </template>
<template #title> {{ $t("global.confirm") }} </template>
<div>
<p>{{ text }}</p>
</div>
<div class="modal-action">
<BaseButton type="submit" @click="confirm(true)"> Confirm </BaseButton>
<BaseButton type="submit" @click="confirm(true)"> {{ $t("global.confirm") }} </BaseButton>
</div>
</BaseModal>
</template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/global/PageQRCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</slot>
<div tabindex="0" class="card compact dropdown-content shadow-lg bg-base-100 rounded-box w-64">
<div class="card-body">
<h2 class="text-center">Page URL</h2>
<h2 class="text-center">{{ $t("components.global.page_qr_code.page_url") }}</h2>
<img :src="getQRCodeUrl()" />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/global/PasswordScore.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="py-4">
<p class="text-sm">{{ $t("components.password_score.password_strength") }}: {{ message }}</p>
<p class="text-sm">{{ $t("components.global.password_score.password_strength") }}: {{ message }}</p>
<progress
class="progress w-full progress-bar"
:value="score"
Expand Down
46 changes: 43 additions & 3 deletions frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"follow_dev": "Follow the Developer",
"read_docs": "Read the Docs",
"password": "Password",
"email": "Email"
"email": "Email",
"submit": "Submit",
"confirm": "Confirm",
"create": "Create",
"create_and_add": "Create and Add Another"
},
"index": {
"tagline": "Track, Organize, and Manage your Things.",
Expand All @@ -22,8 +26,44 @@
"dont_join_group": "Don't want to join a group?"
},
"components": {
"password_score": {
"password_strength": "Password Strength"
"global": {
"password_score": {
"password_strength": "Password Strength"
},
"page_qr_code": {
"page_url": "Page URL"
}
},
"app": {
"import_dialog": {
"title": "Import CSV File",
"description": "Import a CSV file containing your items, labels, and locations. See documentation for more information on the\n required format.",
"change_warning": "Behavior for imports with existing import_refs has changed. If an import_ref is present in the CSV file, the\n item will be updated with the values in the CSV file.",
"upload": "Upload"
}
},
"item": {
"create_modal": {
"title": "Create Item"
},
"view": {
"selectable": {
"items": "Items",
"card": "Card",
"table": "Table",
"no_items": "No Items to Display"
}
}
},
"label": {
"create_modal": {
"title": "Create Label"
}
},
"location": {
"create_modal": {
"title": "Create Location"
}
}
}
}

0 comments on commit a0cdb23

Please sign in to comment.