chore: use i18n 'duplicate' instead of 'copy'

This commit is contained in:
liyasthomas
2021-11-10 19:53:44 +05:30
parent 0ac84b58e3
commit ead1f3954f
4 changed files with 4 additions and 6 deletions

View File

@@ -291,7 +291,7 @@ export default defineComponent({
duplicateRequest({ folderPath, request }) { duplicateRequest({ folderPath, request }) {
saveGraphqlRequestAs(folderPath, { saveGraphqlRequestAs(folderPath, {
...request, ...request,
name: request.name + " - Copy", name: `${request.name} - ${this.$t("action.duplicate")}`,
}) })
}, },
}, },

View File

@@ -689,7 +689,7 @@ export default defineComponent({
duplicateRequest({ folderPath, request }) { duplicateRequest({ folderPath, request }) {
saveRESTRequestAs(folderPath, { saveRESTRequestAs(folderPath, {
...request, ...request,
name: request.name + " - Copy", name: `${request.name} - ${this.$t("action.duplicate")}`,
}) })
}, },
}, },

View File

@@ -108,7 +108,7 @@ export default defineComponent({
}, },
duplicateEnvironment() { duplicateEnvironment() {
if (this.environmentIndex === "Global") { if (this.environmentIndex === "Global") {
createEnvironment("Global-Copy") createEnvironment(`Global - ${this.$t("action.duplicate")}`)
setEnvironmentVariables( setEnvironmentVariables(
environmentsStore.value.environments.length - 1, environmentsStore.value.environments.length - 1,
getGlobalVariables().reduce((gVars, gVar) => { getGlobalVariables().reduce((gVars, gVar) => {

View File

@@ -87,14 +87,12 @@ const dispatchers = defineDispatchers({
environments, environments,
} }
} }
const index =
environments.filter((env) => env.name === newEnvironment.name).length + 1
return { return {
environments: [ environments: [
...environments, ...environments,
{ {
...cloneDeep(newEnvironment), ...cloneDeep(newEnvironment),
name: `${newEnvironment.name} ${index}`, name: `${newEnvironment.name} - Duplicate`,
}, },
], ],
} }