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>

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

@@ -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>

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

@@ -33,7 +33,7 @@
</template>
<SmartItem
icon="assignment_returned"
:label="$t('import_from_gist')"
:label="$t('import.from_gist')"
@click.native="
readCollectionGist
$refs.options.tippy().hide()
@@ -43,9 +43,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="
@@ -56,7 +56,7 @@
: false
"
icon="assignment_turned_in"
:label="$t('create_secret_gist')"
:label="$t('export.create_secret_gist')"
@click.native="
createCollectionGist
$refs.options.tippy().hide()
@@ -87,7 +87,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
@@ -103,14 +103,14 @@
v-tippy="{ theme: 'tooltip' }"
:title="$t('preserve_current')"
icon="folder_shared"
:label="$t('import_from_my_collections')"
:label="$t('import.from_my_collections')"
@click.native="mode = 'import_from_my_collections'"
/>
<SmartItem
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>
@@ -155,7 +155,7 @@
<ButtonPrimary
:disabled="mySelectedCollectionID == undefined"
icon="create_new_folder"
:label="$t('import')"
:label="$t('import.title')"
@click.native="importFromMyCollections"
/>
</span>
@@ -213,7 +213,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)
@@ -226,7 +226,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()}`, {
@@ -413,7 +413,7 @@ export default {
})
},
failedImport() {
this.$toast.error(this.$t("import_failed"), {
this.$toast.error(this.$t("import.failed"), {
icon: "error",
})
},

View File

@@ -103,7 +103,7 @@ export default defineComponent({
},
saveRequestAs() {
if (this.picked == null) {
this.$toast.error(this.$t("select_collection"), {
this.$toast.error(this.$t("collection.select"), {
icon: "error",
})
return

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)"
/>

View File

@@ -43,7 +43,7 @@
v-tippy="{ theme: 'tooltip' }"
disabled
icon="add"
:title="$t('disable_new_collection')"
:title="$t('team.no_access')"
:label="$t('new')"
/>
<ButtonSecondary
@@ -60,7 +60,7 @@
collectionsType.selectedTeam == undefined
"
icon="import_export"
:title="$t('import_export')"
:title="$t('modal.import_export')"
@click.native="displayModalImportExport(true)"
/>
</div>
@@ -101,7 +101,7 @@
>
<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
v-if="
@@ -111,14 +111,14 @@
"
v-tippy="{ theme: 'tooltip' }"
disabled
:title="$t('disable_new_collection')"
:label="$t('add_new')"
:title="$t('team.no_access')"
:label="$t('add.new')"
outline
/>
<ButtonSecondary
v-else
outline
:label="$t('add_new')"
:label="$t('add.new')"
@click.native="displayModalAdd(true)"
/>
</div>
@@ -313,7 +313,7 @@ export default {
// Intented to be called by the CollectionAdd modal submit event
addNewRootCollection(name) {
if (!name) {
this.$toast.info(this.$t("invalid_collection_name"))
this.$toast.info(this.$t("collection.invalid_name"))
return
}
if (this.collectionsType.type === "my-collections") {
@@ -333,7 +333,7 @@ export default {
this.collectionsType.selectedTeam.id
)
.then(() => {
this.$toast.success(this.$t("collection_added"), {
this.$toast.success(this.$t("collection.created"), {
icon: "done",
})
})
@@ -349,7 +349,7 @@ export default {
// Intented to be called by CollectionEdit modal submit event
updateEditingCollection(newName) {
if (!newName) {
this.$toast.info(this.$t("invalid_collection_name"))
this.$toast.info(this.$t("collection.invalid_name"))
return
}
if (this.collectionsType.type === "my-collections") {
@@ -392,7 +392,7 @@ export default {
.renameCollection(this.$apollo, name, this.editingFolder.id)
.then(() => {
// Result
this.$toast.success(this.$t("folder_renamed"), {
this.$toast.success(this.$t("folder.renamed"), {
icon: "done",
})
})
@@ -507,7 +507,7 @@ export default {
})
.then(() => {
// Result
this.$toast.success(this.$t("folder_added"), {
this.$toast.success(this.$t("folder.created"), {
icon: "done",
})
this.$emit("update-team-collections")

View File

@@ -36,7 +36,7 @@
<ButtonSecondary
v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }"
:title="$t('import')"
:title="$t('import.title')"
icon="check_box_outline_blank"
color="green"
@click.native="$emit('select-collection')"
@@ -53,7 +53,7 @@
v-if="!doc"
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', {
@@ -79,7 +79,7 @@
</template>
<SmartItem
icon="create_new_folder"
:label="$t('new_folder')"
:label="$t('folder.new')"
@click.native="
$emit('add-folder', {
folder: collection,
@@ -163,13 +163,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

@@ -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()
@@ -146,13 +146,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

@@ -100,7 +100,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

@@ -28,7 +28,7 @@
<ButtonSecondary
v-if="doc && !selected"
v-tippy="{ theme: 'tooltip' }"
:title="$t('import')"
:title="$t('import.title')"
icon="check_box_outline_blank"
color="green"
@click.native="$emit('select-collection')"
@@ -45,7 +45,7 @@
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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', {
@@ -73,7 +73,7 @@
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
:label="$t('folder.new')"
@click.native="
$emit('add-folder', {
folder: collection,
@@ -159,13 +159,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

@@ -31,7 +31,7 @@
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
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 })"
/>
@@ -54,7 +54,7 @@
<SmartItem
v-if="collectionsType.selectedTeam.myRole !== 'VIEWER'"
icon="create_new_folder"
:label="$t('new_folder')"
:label="$t('folder.new')"
@click.native="
$emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
@@ -141,13 +141,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

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