A continuation of HomeBox the inventory and organization system built for the Home User
chore: translate items page
Matt Kilgore0a4c5fbb2874
diff --git a/frontend/locales/en.json b/frontend/locales/en.jsonindex e7460589..51be6602 100644--- a/frontend/locales/en.json+++ b/frontend/locales/en.json@@ -1,97 +1,127 @@{+ "components": {+ "app": {+ "import_dialog": {+ "change_warning": "Behavior for imports with existing import_refs has changed. If an import_ref is present in the CSV file, the \nitem will be updated with the values in the CSV file.",+ "description": "Import a CSV file containing your items, labels, and locations. See documentation for more information on the \nrequired format.",+ "title": "Import CSV File",+ "upload": "Upload"+ }+ },"global": {- "build": "Build: { build }",- "version": "Version: { version }",- "github": "GitHub Project",- "join_discord": "Join the Discord",- "follow_dev": "Follow the Developer",- "read_docs": "Read the Docs",- "password": "Password",- "email": "Email",- "submit": "Submit",- "confirm": "Confirm",- "create": "Create",- "created": "Created",- "create_and_add": "Create and Add Another",- "welcome": "Welcome, { username }",- "sign_out": "Sign Out"+ "page_qr_code": {+ "page_url": "Page URL"+ },+ "password_score": {+ "password_strength": "Password Strength"+ }},- "index": {- "tagline": "Track, Organize, and Manage your Things.",- "disabled_registration": "Registration Disabled",- "login": "Login",- "register": "Register",- "remember_me": "Remember Me",- "set_email": "What's your email?",- "set_password": "Set your password",- "set_name": "What's your name?",- "joining_group": "You're Joining an Existing Group!",- "dont_join_group": "Don't want to join a group?"+ "item": {+ "create_modal": {+ "title": "Create Item"+ },+ "view": {+ "selectable": {+ "card": "Card",+ "items": "Items",+ "no_items": "No Items to Display",+ "table": "Table"+ }+ }},- "profile": {- "change_password": "Change Password",- "current_password": "Current Password",- "new_password": "New Password",- "notifier_modal": "{ type, select, true {Edit} false {Create} other {Other}} Notifier",- "notifiers": "Notifiers",- "notifiers_sub": "Get notifications for upcoming maintenance reminders",- "name": "Name",- "url": "URL",- "enabled": "Enabled",- "test": "Test",- "gen_invite": "Generate Invite Link",- "user_profile": "User Profile",- "user_profile_sub": "Invite users, and manage your account.",- "active": "Active",- "inactive": "Inactive",- "group_settings": "Group Settings",- "group_settings_sub": "Shared Group Settings. You may need to refresh your browser for some settings to apply.",- "currency_format": "Currency Format",- "update_group": "Update Group",- "theme_settings": "Theme Settings",- "theme_settings_sub": "Theme settings are stored in your browser's local storage. You can change the theme at any time. If you're\n having trouble setting your theme try refreshing your browser.",- "delete_account": "Delete Account",- "delete_account_sub": "Delete your account and all its associated data. This can not be undone."+ "label": {+ "create_modal": {+ "title": "Create Label"+ }},- "components": {- "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 \nrequired format.",- "change_warning": "Behavior for imports with existing import_refs has changed. If an import_ref is present in the CSV file, the \nitem 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"- }- }+ "location": {+ "create_modal": {+ "title": "Create Location"+ }}-}+ },+ "global": {+ "build": "Build: { build }",+ "confirm": "Confirm",+ "create": "Create",+ "create_and_add": "Create and Add Another",+ "created": "Created",+ "email": "Email",+ "follow_dev": "Follow the Developer",+ "github": "GitHub Project",+ "join_discord": "Join the Discord",+ "labels": "Labels",+ "locations": "Locations",+ "name": "Name",+ "password": "Password",+ "read_docs": "Read the Docs",+ "search": "Search",+ "sign_out": "Sign Out",+ "submit": "Submit",+ "version": "Version: { version }",+ "welcome": "Welcome, { username }",+ "items": "Items"+ },+ "index": {+ "disabled_registration": "Registration Disabled",+ "dont_join_group": "Don't want to join a group?",+ "joining_group": "You're Joining an Existing Group!",+ "login": "Login",+ "register": "Register",+ "remember_me": "Remember Me",+ "set_email": "What's your email?",+ "set_name": "What's your name?",+ "set_password": "Set your password",+ "tagline": "Track, Organize, and Manage your Things."+ },+ "items": {+ "created_at": "Created At",+ "field_selector": "Field Selector",+ "include_archive": "Include Archived Items",+ "negate_labels": "Negate Selected Labels",+ "options": "Options",+ "order_by": "Order By",+ "query_id": "Querying Asset ID Number: { id }",+ "reset_search": "Reset Search",+ "tip_1": "Location and label filters use the 'OR' operation. If more than one is selected only one will be\n required for a match.",+ "tip_2": "Searches prefixed with '#'' will query for a asset ID (example '#000-001')",+ "tip_3": "Field filters use the 'OR' operation. If more than one is selected only one will be required for a\n match.",+ "tips": "Tips",+ "tips_sub": "Search Tips",+ "updated_at": "Updated At",+ "field_value": "Field Value",+ "custom_fields": "Custom Fields",+ "add": "Add",+ "results": "{ total } Results",+ "pages": "Page { page } of { totalPages }",+ "no_results": "No Items Found",+ "prev_page": "Previous Page",+ "next_page": "Next Page",+ "first": "First",+ "last": "Last"+ },+ "profile": {+ "active": "Active",+ "change_password": "Change Password",+ "currency_format": "Currency Format",+ "current_password": "Current Password",+ "delete_account": "Delete Account",+ "delete_account_sub": "Delete your account and all its associated data. This can not be undone.",+ "enabled": "Enabled",+ "gen_invite": "Generate Invite Link",+ "group_settings": "Group Settings",+ "group_settings_sub": "Shared Group Settings. You may need to refresh your browser for some settings to apply.",+ "inactive": "Inactive",+ "new_password": "New Password",+ "notifier_modal": "{ type, select, true {Edit} false {Create} other {Other}} Notifier",+ "notifiers": "Notifiers",+ "notifiers_sub": "Get notifications for upcoming maintenance reminders",+ "test": "Test",+ "theme_settings": "Theme Settings",+ "theme_settings_sub": "Theme settings are stored in your browser's local storage. You can change the theme at any time. If you're\n having trouble setting your theme try refreshing your browser.",+ "update_group": "Update Group",+ "url": "URL",+ "user_profile": "User Profile",+ "user_profile_sub": "Invite users, and manage your account."+ }+}\ No newline at end of filediff --git a/frontend/pages/items.vue b/frontend/pages/items.vueindex 734b1abb..722dc83c 100644--- a/frontend/pages/items.vue+++ b/frontend/pages/items.vue@@ -338,9 +338,9 @@<div v-if="locations && labels"><div class="flex flex-wrap md:flex-nowrap gap-4 items-end"><div class="w-full">- <FormTextField v-model="query" placeholder="Search" />+ <FormTextField v-model="query" :placeholder="$t('global.search')" /><div v-if="byAssetId" class="text-sm pl-2 pt-2">- <p>Querying Asset ID Number: {{ parsedAssetId }}</p>+ <p>{{ $t("items.query_id", { id: parsedAssetId }) }}</p></div></div><BaseButton class="btn-block md:w-auto" @click.prevent="submit">@@ -348,12 +348,12 @@<MdiLoading v-if="loading" class="animate-spin" /><MdiMagnify v-else /></template>- Search+ {{ $t("global.search") }}</BaseButton></div><div class="flex flex-wrap md:flex-nowrap gap-2 w-full py-2">- <SearchFilter v-model="selectedLocations" label="Locations" :options="locationFlatTree">+ <SearchFilter v-model="selectedLocations" :label="$t('global.locations')" :options="locationFlatTree"><template #display="{ item }"><div><div class="flex w-full">@@ -365,60 +365,60 @@</div></template></SearchFilter>- <SearchFilter v-model="selectedLabels" label="Labels" :options="labels" />+ <SearchFilter v-model="selectedLabels" :label="$t('global.labels')" :options="labels" /><div class="dropdown">- <label tabindex="0" class="btn btn-xs">Options</label>+ <label tabindex="0" class="btn btn-xs">{{ $t("items.options") }}</label><divtabindex="0"class="dropdown-content mt-1 max-h-72 p-4 w-64 overflow-auto shadow bg-base-100 rounded-md -translate-x-24"><label class="label cursor-pointer mr-auto"><input v-model="includeArchived" type="checkbox" class="toggle toggle-sm toggle-primary" />- <span class="label-text ml-4"> Include Archived Items </span>+ <span class="label-text ml-4"> {{ $t("items.include_archive") }} </span></label><label class="label cursor-pointer mr-auto"><input v-model="fieldSelector" type="checkbox" class="toggle toggle-sm toggle-primary" />- <span class="label-text ml-4"> Field Selector </span>+ <span class="label-text ml-4"> {{ $t("items.field_selector") }} </span></label><label class="label cursor-pointer mr-auto"><input v-model="negateLabels" type="checkbox" class="toggle toggle-sm toggle-primary" />- <span class="label-text ml-4"> Negate selected labels </span>+ <span class="label-text ml-4"> {{ $t("items.negate_labels") }} </span></label><label class="label cursor-pointer mr-auto"><select v-model="orderBy" class="select select-bordered select-sm">- <option value="name" selected>Name</option>- <option value="createdAt">Created At</option>- <option value="updatedAt">Updated At</option>+ <option value="name" selected>{{ $t("global.name") }}</option>+ <option value="createdAt">{{ $t("items.created_at") }}</option>+ <option value="updatedAt">{{ $t("items.updated_at") }}</option></select>- <span class="label-text ml-4"> Order By </span>+ <span class="label-text ml-4"> {{ $t("items.order_by") }} </span></label><hr class="my-2" />- <BaseButton class="btn-block btn-sm" @click="reset"> Reset Search</BaseButton>+ <BaseButton class="btn-block btn-sm" @click="reset"> {{ $t("items.reset_search") }} </BaseButton></div></div><div class="dropdown ml-auto dropdown-end">- <label tabindex="0" class="btn btn-xs">Tips</label>+ <label tabindex="0" class="btn btn-xs">{{ $t("items.tips") }}</label><divtabindex="0"class="dropdown-content mt-1 p-4 w-[325px] text-sm overflow-auto shadow bg-base-100 rounded-md">- <p class="text-base">Search Tips</p>+ <p class="text-base">{{ $t("items.tips_sub") }}</p><ul class="mt-1 list-disc pl-6"><li>- Location and label filters use the 'OR' operation. If more than one is selected only one will be- required for a match.+ {{ $t("items.tip_1") }}</li>- <li>Searches prefixed with '#'' will query for a asset ID (example '#000-001')</li><li>- Field filters use the 'OR' operation. If more than one is selected only one will be required for a- match.+ {{ $t("items.tip_2") }}+ </li>+ <li>+ {{ $t("items.tip_3") }}</li></ul></div></div></div><div v-if="fieldSelector" class="py-4 space-y-2">- <p>Custom Fields</p>+ <p>{{ $t("items.custom_fields") }}</p><div v-for="(f, idx) in fieldTuples" :key="idx" class="flex flex-wrap gap-2"><div class="form-control w-full max-w-xs"><label class="label">@@ -435,7 +435,7 @@</div><div class="form-control w-full max-w-xs"><label class="label">- <span class="label-text">Field Value</span>+ <span class="label-text">{{ $t("items.field_value") }}</span></label><select v-model="fieldTuples[idx][1]" class="select-bordered select" :items="fieldValuesCache[f[0]]"><option v-for="v in fieldValuesCache[f[0]]" :key="v" :value="v">{{ v }}</option>@@ -449,38 +449,42 @@<MdiDelete class="w-5 h-5" /></button></div>- <BaseButton type="button" class="btn-sm mt-2" @click="() => fieldTuples.push(['', ''])"> Add</BaseButton>+ <BaseButton type="button" class="btn-sm mt-2" @click="() => fieldTuples.push(['', ''])">+ {{ $t("items.add") }}+ </BaseButton></div></div><section class="mt-10">- <BaseSectionHeader ref="itemsTitle"> Items </BaseSectionHeader>+ <BaseSectionHeader ref="itemsTitle"> {{ $t("global.items") }} </BaseSectionHeader><p class="text-base font-medium flex items-center">- {{ total }} Results- <span class="text-base ml-auto"> Page {{ page }} of {{ totalPages }}</span>+ {{ $t("items.results", { total: total }) }}+ <span class="text-base ml-auto"> {{ $t("items.pages", { page: page, totalPages: totalPages }) }} </span></p><div ref="cardgrid" class="grid mt-4 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="hidden first:inline text-xl">No Items Found</div>+ <div class="hidden first:inline text-xl">{{ $t("items.no_results") }}</div></div><div v-if="items.length > 0 && (hasNext || hasPrev)" class="mt-10 flex gap-2 flex-col items-center"><div class="flex"><div class="btn-group"><button :disabled="!hasPrev" class="btn text-no-transform" @click="prev"><MdiChevronLeft class="mr-1 h-6 w-6" name="mdi-chevron-left" />- Prev+ {{ $t("items.prev_page") }}+ </button>+ <button v-if="hasPrev" class="btn text-no-transform" @click="page = 1">{{ $t("items.first") }}</button>+ <button v-if="hasNext" class="btn text-no-transform" @click="page = totalPages">+ {{ $t("items.last") }}</button>- <button v-if="hasPrev" class="btn text-no-transform" @click="page = 1">First</button>- <button v-if="hasNext" class="btn text-no-transform" @click="page = totalPages">Last</button><button :disabled="!hasNext" class="btn text-no-transform" @click="next">- Next+ {{ $t("items.next_page") }}<MdiChevronRight class="ml-1 h-6 w-6" name="mdi-chevron-right" /></button></div></div>- <p class="text-sm font-bold">Page {{ page }} of {{ totalPages }}</p>+ <p class="text-sm font-bold">{{ $t("items.pages", { page: page, totalPages: totalPages }) }}</p></div></section></BaseContainer>diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vueindex edd758e6..f76cf056 100644--- a/frontend/pages/profile.vue+++ b/frontend/pages/profile.vue@@ -323,7 +323,7 @@<form @submit.prevent="createNotifier"><template v-if="notifier">- <FormTextField v-model="notifier.name" :label="$t('profile.name')" />+ <FormTextField v-model="notifier.name" :label="$t('global.name')" /><FormTextField v-model="notifier.url" :label="$t('profile.url')" /><div class="max-w-[100px]"><FormCheckbox v-model="notifier.isActive" :label="$t('profile.enabled')" />