Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

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

liyasthomasead1f3954f31
diff --git a/packages/hoppscotch-app/components/collections/graphql/index.vue b/packages/hoppscotch-app/components/collections/graphql/index.vue
index 3ff25792f..0305f0102 100644
--- a/packages/hoppscotch-app/components/collections/graphql/index.vue
+++ b/packages/hoppscotch-app/components/collections/graphql/index.vue
@@ -291,7 +291,7 @@ export default defineComponent({
duplicateRequest({ folderPath, request }) {
saveGraphqlRequestAs(folderPath, {
...request,
- name: request.name + " - Copy",
+ name: `${request.name} - ${this.$t("action.duplicate")}`,
})
},
},
diff --git a/packages/hoppscotch-app/components/collections/index.vue b/packages/hoppscotch-app/components/collections/index.vue
index b50d96ed3..e410afbac 100644
--- a/packages/hoppscotch-app/components/collections/index.vue
+++ b/packages/hoppscotch-app/components/collections/index.vue
@@ -689,7 +689,7 @@ export default defineComponent({
duplicateRequest({ folderPath, request }) {
saveRESTRequestAs(folderPath, {
...request,
- name: request.name + " - Copy",
+ name: `${request.name} - ${this.$t("action.duplicate")}`,
})
},
},
diff --git a/packages/hoppscotch-app/components/environments/Environment.vue b/packages/hoppscotch-app/components/environments/Environment.vue
index 311431e1d..a7f83d8da 100644
--- a/packages/hoppscotch-app/components/environments/Environment.vue
+++ b/packages/hoppscotch-app/components/environments/Environment.vue
@@ -108,7 +108,7 @@ export default defineComponent({
},
duplicateEnvironment() {
if (this.environmentIndex === "Global") {
- createEnvironment("Global-Copy")
+ createEnvironment(`Global - ${this.$t("action.duplicate")}`)
setEnvironmentVariables(
environmentsStore.value.environments.length - 1,
getGlobalVariables().reduce((gVars, gVar) => {
diff --git a/packages/hoppscotch-app/newstore/environments.ts b/packages/hoppscotch-app/newstore/environments.ts
index 003828878..fdba6d5cb 100644
--- a/packages/hoppscotch-app/newstore/environments.ts
+++ b/packages/hoppscotch-app/newstore/environments.ts
@@ -87,14 +87,12 @@ const dispatchers = defineDispatchers({
environments,
}
}
- const index =
- environments.filter((env) => env.name === newEnvironment.name).length + 1
return {
environments: [
...environments,
{
...cloneDeep(newEnvironment),
- name: `${newEnvironment.name} ${index}`,
+ name: `${newEnvironment.name} - Duplicate`,
},
],
}