feat: init new i18n format

This commit is contained in:
liyasthomas
2021-08-02 20:57:18 +05:30
parent 8a268ee6de
commit b615fe7529
66 changed files with 476 additions and 428 deletions

View File

@@ -1,7 +1,7 @@
<template>
<SmartModal v-if="show" @close="hideModal">
<template #header>
<h3 class="heading">{{ $t("new_collection") }}</h3>
<h3 class="heading">{{ $t("collection.new") }}</h3>
<ButtonSecondary icon="close" @click.native="hideModal" />
</template>
<template #body>
@@ -14,7 +14,7 @@
v-model="name"
class="input"
type="text"
:placeholder="$t('my_new_collection')"
:placeholder="$t('collection.name')"
@keyup.enter="addNewCollection"
/>
</div>
@@ -44,7 +44,7 @@ export default Vue.extend({
methods: {
addNewCollection() {
if (!this.name) {
this.$toast.info(this.$t("invalid_collection_name").toString())
this.$toast.info(this.$t("collection.invalid_name").toString())
return
}

View File

@@ -16,7 +16,7 @@
v-model="name"
class="input"
type="text"
:placeholder="$t('my_new_folder')"
:placeholder="$t('folder.new')"
@keyup.enter="addFolder"
/>
</div>

View File

@@ -36,7 +36,7 @@
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
icon="create_new_folder"
:title="$t('new_folder')"
:title="$t('folder.new')"
class="group-hover:inline-flex hidden"
@click.native="
$emit('add-folder', {
@@ -61,7 +61,7 @@
</template>
<SmartItem
icon="create_new_folder"
:label="$t('new_folder')"
:label="$t('folder.new')"
@click.native="
$emit('add-folder', {
path: `${collectionIndex}`,
@@ -138,13 +138,13 @@
>
<i class="opacity-75 pb-2 material-icons">folder_open</i>
<span class="text-center">
{{ $t("collection_empty") }}
{{ $t("empty.collection") }}
</span>
</div>
</div>
<SmartConfirmModal
:show="confirmRemove"
:title="$t('are_you_sure_remove_collection')"
:title="$t('confirm.remove_collection')"
@hide-modal="confirmRemove = false"
@resolve="removeCollection"
/>

View File

@@ -1,7 +1,7 @@
<template>
<SmartModal v-if="show" @close="hideModal">
<template #header>
<h3 class="heading">{{ $t("edit_collection") }}</h3>
<h3 class="heading">{{ $t("collection.edit") }}</h3>
<div>
<ButtonSecondary icon="close" @click.native="hideModal" />
</div>
@@ -48,7 +48,7 @@ export default Vue.extend({
methods: {
saveCollection() {
if (!this.name) {
this.$toast.info(this.$t("invalid_collection_name").toString())
this.$toast.info(this.$t("collection.invalid_name").toString())
return
}
const collectionUpdated = {

View File

@@ -1,7 +1,7 @@
<template>
<SmartModal v-if="show" @close="$emit('hide-modal')">
<template #header>
<h3 class="heading">{{ $t("edit_folder") }}</h3>
<h3 class="heading">{{ $t("folder.edit") }}</h3>
<div>
<ButtonSecondary icon="close" @click.native="hideModal" />
</div>

View File

@@ -38,7 +38,7 @@
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
icon="create_new_folder"
:title="$t('new_folder')"
:title="$t('folder.new')"
class="group-hover:inline-flex hidden"
@click.native="$emit('add-folder', { folder, path: folderPath })"
/>
@@ -59,7 +59,7 @@
</template>
<SmartItem
icon="create_new_folder"
:label="$t('new_folder')"
:label="$t('folder.new')"
@click.native="
$emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
@@ -137,13 +137,13 @@
>
<i class="opacity-75 pb-2 material-icons">folder_open</i>
<span class="text-center">
{{ $t("folder_empty") }}
{{ $t("empty.folder") }}
</span>
</div>
</div>
<SmartConfirmModal
:show="confirmRemove"
:title="$t('are_you_sure_remove_folder')"
:title="$t('confirm.remove_folder')"
@hide-modal="confirmRemove = false"
@resolve="removeFolder"
/>

View File

@@ -20,7 +20,7 @@
</template>
<SmartItem
icon="assignment_returned"
:label="$t('import_from_gist')"
:label="$t('import.from_gist')"
@click.native="
readCollectionGist
$refs.options.tippy().hide()
@@ -30,9 +30,9 @@
v-tippy="{ theme: 'tooltip' }"
:title="
!currentUser
? $t('login_with_github_to') + $t('create_secret_gist')
? $t('export.require_github')
: currentUser.provider !== 'github.com'
? $t('login_with_github_to') + $t('create_secret_gist')
? $t('export.require_github')
: null
"
:disabled="
@@ -43,7 +43,7 @@
: false
"
icon="assignment_turned_in"
:label="$t('create_secret_gist')"
:label="$t('export.create_secret_gist')"
@click.native="
createCollectionGist
$refs.options.tippy().hide()
@@ -74,7 +74,7 @@
v-tippy="{ theme: 'tooltip' }"
:title="$t('preserve_current')"
icon="create_new_folder"
:label="$t('import_json')"
:label="$t('import.json')"
@click.native="openDialogChooseFileToImportFrom"
/>
<input
@@ -89,7 +89,7 @@
v-tippy="{ theme: 'tooltip' }"
:title="$t('download_file')"
icon="drive_file_move"
:label="$t('export_as_json')"
:label="$t('export.as_json')"
@click.native="exportJSON"
/>
</div>
@@ -140,7 +140,7 @@ export default {
}
)
.then((res) => {
this.$toast.success(this.$t("gist_created"), {
this.$toast.success(this.$t("export.gist_created"), {
icon: "done",
})
window.open(res.html_url)
@@ -153,7 +153,7 @@ export default {
})
},
async readCollectionGist() {
const gist = prompt(this.$t("enter_gist_url"))
const gist = prompt(this.$t("import.gist_url"))
if (!gist) return
await this.$axios
.$get(`https://api.github.com/gists/${gist.split("/").pop()}`, {
@@ -266,7 +266,7 @@ export default {
})
},
failedImport() {
this.$toast.error(this.$t("import_failed"), {
this.$toast.error(this.$t("import.failed"), {
icon: "error",
})
},

View File

@@ -89,7 +89,7 @@
</div>
<SmartConfirmModal
:show="confirmRemove"
:title="$t('are_you_sure_remove_request')"
:title="$t('confirm.remove_request')"
@hide-modal="confirmRemove = false"
@resolve="removeRequest"
/>

View File

@@ -35,7 +35,7 @@
<ButtonSecondary
v-if="showCollActions"
v-tippy="{ theme: 'tooltip' }"
:title="$t('import_export')"
:title="$t('modal.import_export')"
icon="import_export"
@click.native="displayModalImportExport(true)"
/>
@@ -66,10 +66,10 @@
>
<i class="opacity-75 pb-2 material-icons">create_new_folder</i>
<span class="text-center pb-4">
{{ $t("collections_empty") }}
{{ $t("empty.collections") }}
</span>
<ButtonSecondary
:label="$t('add_new')"
:label="$t('add.new')"
outline
@click.native="displayModalAdd(true)"
/>