Replaced hard-coded strings with localizable strings

Added en locale as localization fallback
This commit is contained in:
Alec Ananian
2020-01-14 07:43:41 -08:00
parent 119eb321ec
commit 8690d18695
23 changed files with 452 additions and 298 deletions

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">New Collection</h3>
<h3 class="title">{{ $t("new_collection") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -17,7 +17,7 @@
<div slot="body">
<ul>
<li>
<input type="text" v-model="name" placeholder="My New Collection" />
<input type="text" v-model="name" :placeholder="$t('my_new_collection')" />
</li>
</ul>
</div>
@@ -26,10 +26,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="addNewCollection">
Save
{{ $t("save") }}
</button>
</span>
</div>

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">New Folder</h3>
<h3 class="title">{{ $t("new_folder") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -17,7 +17,7 @@
<div slot="body">
<ul>
<li>
<input type="text" v-model="name" placeholder="My New Folder" />
<input type="text" v-model="name" :placeholder="$t('my_new_folder')" />
</li>
</ul>
</div>
@@ -26,10 +26,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="addNewFolder">
Save
{{ $t("save") }}
</button>
</span>
</div>

View File

@@ -10,14 +10,14 @@
</button>
</div>
<v-popover>
<button class="tooltip-target icon" v-tooltip="'More'">
<button class="tooltip-target icon" v-tooltip="$t('more')">
<i class="material-icons">more_vert</i>
</button>
<template slot="popover">
<div>
<button class="icon" @click="$emit('add-folder')" v-close-popover>
<i class="material-icons">create_new_folder</i>
<span>New folder</span>
<span>{{ $t("new_folder") }}</span>
</button>
</div>
<div>
@@ -27,13 +27,13 @@
v-close-popover
>
<i class="material-icons">create</i>
<span>Edit</span>
<span>{{ $t("edit") }}</span>
</button>
</div>
<div>
<button class="icon" @click="removeCollection" v-close-popover>
<i class="material-icons">delete</i>
<span>Delete</span>
<span>{{ $t("delete") }}</span>
</button>
</div>
</template>
@@ -56,7 +56,7 @@
collection.folders.length === 0 && collection.requests.length === 0
"
>
<label>Collection is empty</label>
<label>{{ $t("collection_empty") }}</label>
</li>
</ul>
<ul>

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">Edit Collection</h3>
<h3 class="title">{{ $t("edit_collection") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -31,10 +31,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="saveCollection">
Save
{{ $t("save") }}
</button>
</span>
</div>

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">Edit Folder</h3>
<h3 class="title">{{ $t("edit_folder") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -31,10 +31,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="editFolder">
Save
{{ $t("save") }}
</button>
</span>
</div>

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">Edit Request</h3>
<h3 class="title">{{ $t("edit_request") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -17,7 +17,7 @@
<div slot="body">
<ul>
<li>
<label for="selectLabel">Label</label>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
@@ -25,7 +25,7 @@
@keyup.enter="saveRequest"
:placeholder="request.name"
/>
<label for="selectCollection">Collection</label>
<label for="selectCollection">{{ $t("collection") }}</label>
<span class="select-wrapper">
<select
type="text"
@@ -38,7 +38,7 @@
hidden
disabled
selected
>Current Collection</option
>{{ $t("current_collection") }}</option
>
<option
v-for="(collection, index) in $store.state.postwoman
@@ -50,7 +50,7 @@
</option>
</select>
</span>
<label for="selectFolder">Folder</label>
<label for="selectFolder">{{ $t("folder") }}</label>
<span class="select-wrapper">
<select
type="text"
@@ -75,10 +75,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="saveRequest">
Save
{{ $t("save") }}
</button>
</span>
</div>

View File

@@ -10,20 +10,20 @@
</button>
</div>
<v-popover>
<button class="tooltip-target icon" v-tooltip="'More'">
<button class="tooltip-target icon" v-tooltip="$t('more')">
<i class="material-icons">more_vert</i>
</button>
<template slot="popover">
<div>
<button class="icon" @click="editFolder" v-close-popover>
<i class="material-icons">edit</i>
<span>Edit</span>
<span>{{ $t("edit") }}</span>
</button>
</div>
<div>
<button class="icon" @click="removeFolder" v-close-popover>
<i class="material-icons">delete</i>
<span>Delete</span>
<span>{{ $t("delete") }}</span>
</button>
</div>
</template>
@@ -49,7 +49,7 @@
/>
</li>
<li v-if="folder.requests.length === 0">
<label>Folder is empty</label>
<label>{{ $t("folder_empty") }}</label>
</li>
</ul>
</div>

View File

@@ -23,10 +23,10 @@
<button
class="icon"
@click="openDialogChooseFileToReplaceWith"
v-tooltip="'Replace current'"
v-tooltip="$t('replace_current')"
>
<i class="material-icons">create_new_folder</i>
<span>Replace with JSON</span>
<span>{{ $t("replace_json") }}</span>
<input
type="file"
@change="replaceWithJSON"
@@ -37,10 +37,10 @@
<button
class="icon"
@click="openDialogChooseFileToImportFrom"
v-tooltip="'Preserve current'"
v-tooltip="$t('preserve_current')"
>
<i class="material-icons">folder_shared</i>
<span>Import from JSON</span>
<span>{{ $t("import_json") }}</span>
<input
type="file"
@change="importFromJSON"
@@ -55,14 +55,14 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button
class="icon primary"
@click="exportJSON"
v-tooltip="'Download file'"
v-tooltip="$t('download_file')"
>
Export
{{ $t("export") }}
</button>
</span>
</div>

View File

@@ -43,14 +43,14 @@ TODO:
<div>
<button class="icon" @click="displayModalAdd(true)">
<i class="material-icons">add</i>
<span>New</span>
<span>{{ $t("new") }}</span>
</button>
</div>
<div>
<button
class="icon"
@click="displayModalImportExport(true)"
v-tooltip="'Import / Export'"
v-tooltip="$t('import_export')"
>
<i class="material-icons">import_export</i>
</button>

View File

@@ -1,26 +1,26 @@
<template>
<div class="flex-wrap">
<div>
<button class="icon" @click="selectRequest()" v-tooltip="'Use request'">
<button class="icon" @click="selectRequest()" v-tooltip="$t('use_request')">
<i class="material-icons">insert_drive_file</i>
<span>{{ request.name }}</span>
</button>
</div>
<v-popover>
<button class="tooltip-target icon" v-tooltip="'More'">
<button class="tooltip-target icon" v-tooltip="$t('more')">
<i class="material-icons">more_vert</i>
</button>
<template slot="popover">
<div>
<button class="icon" @click="$emit('edit-request')" v-close-popover>
<i class="material-icons">edit</i>
<span>Edit</span>
<span>{{ $t("edit") }}</span>
</button>
</div>
<div>
<button class="icon" @click="removeRequest" v-close-popover>
<i class="material-icons">delete</i>
<span>Delete</span>
<span>{{ $t("delete") }}</span>
</button>
</div>
</template>

View File

@@ -4,7 +4,7 @@
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">Save Request As</h3>
<h3 class="title">{{ $t("save_request_as") }}</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
@@ -17,7 +17,7 @@
<div slot="body">
<ul>
<li>
<label for="selectLabel">Label</label>
<label for="selectLabel">{{ $t("label") }}</label>
<input
type="text"
id="selectLabel"
@@ -25,7 +25,7 @@
:placeholder="defaultRequestName"
@keyup.enter="saveRequestAs"
/>
<label for="selectCollection">Collection</label>
<label for="selectCollection">{{ $t("collection") }}</label>
<span class="select-wrapper">
<select
type="text"
@@ -38,7 +38,7 @@
hidden
disabled
selected
>Select a Collection</option
>{{ $t("select_collection") }}</option
>
<option
v-for="(collection, index) in $store.state.postwoman
@@ -50,7 +50,7 @@
</option>
</select>
</span>
<label for="selectFolder">Folder</label>
<label for="selectFolder">{{ $t("folder") }}</label>
<span class="select-wrapper">
<select
type="text"
@@ -67,7 +67,7 @@
</option>
</select>
</span>
<label for="selectRequest">Request</label>
<label for="selectRequest">{{ $t("request") }}</label>
<span class="select-wrapper">
<select
type="text"
@@ -92,10 +92,10 @@
<span></span>
<span>
<button class="icon" @click="hideModal">
Cancel
{{ $t("cancel") }}
</button>
<button class="icon primary" @click="saveRequestAs">
Save
{{ $t("save") }}
</button>
</span>
</div>
@@ -184,7 +184,7 @@ export default {
const userDidntSpecifyCollection =
this.$data.requestData.collectionIndex === undefined;
if (userDidntSpecifyCollection) {
this.$toast.error("Select a Collection", {
this.$toast.error(this.$t("select_collection"), {
icon: "error"
});
return;