Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: [intlify] Not found parent scope. use the global scope (#17992)

p0ny02b4bcc84a0e
diff --git a/frontend/src/components/EditEnvironmentDrawer.vue b/frontend/src/components/EditEnvironmentDrawer.vue
index 91866d6611..cb92cdb7f0 100644
--- a/frontend/src/components/EditEnvironmentDrawer.vue
+++ b/frontend/src/components/EditEnvironmentDrawer.vue
@@ -1,7 +1,7 @@
<template>
<Drawer :show="show" @close="$emit('dismiss')">
<DrawerContent
- :title="$t('database.edit-environment')"
+ :title="t('database.edit-environment')"
class="w-96 max-w-[100vw]"
>
<EnvironmentSelect
@@ -14,10 +14,10 @@
<div class="w-full flex justify-between items-center">
<div class="w-full flex justify-end items-center gap-x-3">
<NButton @click.prevent="$emit('dismiss')">
- {{ $t("common.cancel") }}
+ {{ t("common.cancel") }}
</NButton>
<NButton :disabled="!allowSave" type="primary" @click="onSave">
- {{ $t("common.save") }}
+ {{ t("common.save") }}
</NButton>
</div>
</div>
@@ -29,8 +29,11 @@
<script lang="ts" setup>
import { NButton } from "naive-ui";
import { computed, ref } from "vue";
+import { useI18n } from "vue-i18n";
import { Drawer, DrawerContent, EnvironmentSelect } from "@/components/v2";
+const { t } = useI18n();
+
defineProps<{
show: boolean;
}>();
diff --git a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
index 62091a7e39..121a2ddd7d 100644
--- a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
+++ b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
@@ -2,7 +2,7 @@
<div class="flex flex-col gap-y-2">
<div class="font-medium flex items-center space-x-2">
<label>
- {{ $t("environment.access-control.title") }}
+ {{ t("environment.access-control.title") }}
</label>
</div>
<div>
@@ -13,7 +13,7 @@
:disabled="!allowUpdatePolicy || !hasRestrictCopyingDataFeature"
/>
<span class="textlabel">{{
- $t("environment.access-control.disable-copy-data-from-sql-editor")
+ t("environment.access-control.disable-copy-data-from-sql-editor")
}}</span>
<FeatureBadge :feature="PlanFeature.FEATURE_RESTRICT_COPYING_DATA" />
</div>
@@ -26,7 +26,7 @@
@update:value="switchDataSourceQueryPolicyEnabled"
/>
<span class="textlabel">{{
- $t("environment.access-control.restrict-admin-connection.self")
+ t("environment.access-control.restrict-admin-connection.self")
}}</span>
<FeatureBadge :feature="PlanFeature.FEATURE_QUERY_POLICY" />
</div>
@@ -42,7 +42,7 @@
:value="DataSourceQueryPolicy_Restriction.DISALLOW"
>
{{
- $t(
+ t(
"environment.access-control.restrict-admin-connection.disallow"
)
}}
@@ -52,7 +52,7 @@
:value="DataSourceQueryPolicy_Restriction.FALLBACK"
>
{{
- $t(
+ t(
"environment.access-control.restrict-admin-connection.fallback"
)
}}
@@ -68,7 +68,7 @@
>
<div class="font-medium flex items-center space-x-2">
<label>
- {{ $t("environment.statement-execution.title") }}
+ {{ t("environment.statement-execution.title") }}
</label>
<FeatureBadge :feature="PlanFeature.FEATURE_QUERY_POLICY" />
</div>
@@ -80,7 +80,7 @@
:disabled="!allowUpdatePolicy || !hasRestrictDDLDMLFeature"
/>
<span class="textlabel">
- {{ $t("environment.statement-execution.disallow-ddl") }}
+ {{ t("environment.statement-execution.disallow-ddl") }}
</span>
</div>
<div class="w-full inline-flex items-center gap-x-2">
@@ -90,7 +90,7 @@
:disabled="!allowUpdatePolicy || !hasRestrictDDLDMLFeature"
/>
<span class="textlabel">
- {{ $t("environment.statement-execution.disallow-dml") }}
+ {{ t("environment.statement-execution.disallow-dml") }}
</span>
</div>
</div>
@@ -102,6 +102,7 @@ import { create as createProto } from "@bufbuild/protobuf";
import { cloneDeep, isEqual } from "lodash-es";
import { NRadio, NRadioGroup } from "naive-ui";
import { computed, reactive, watchEffect } from "vue";
+import { useI18n } from "vue-i18n";
import { hasFeature, usePolicyV1Store } from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
import type {
@@ -119,6 +120,8 @@ import { hasWorkspacePermissionV2 } from "@/utils";
import { FeatureBadge } from "../FeatureGuard";
import { Switch } from "../v2";
+const { t } = useI18n();
+
interface LocalState {
queryDataPolicy: QueryDataPolicy;
dataSourceQueryPolicy: DataSourceQueryPolicy;
diff --git a/frontend/src/components/EnvironmentForm/Buttons.vue b/frontend/src/components/EnvironmentForm/Buttons.vue
index 7cdba90e9c..e9b253cb7f 100644
--- a/frontend/src/components/EnvironmentForm/Buttons.vue
+++ b/frontend/src/components/EnvironmentForm/Buttons.vue
@@ -5,14 +5,14 @@
v-bind="$attrs"
>
<NButton @click.prevent="events.emit('cancel')">
- {{ $t("common.cancel") }}
+ {{ t("common.cancel") }}
</NButton>
<NButton
type="primary"
:disabled="!allowCreate"
@click.prevent="createEnvironment"
>
- {{ $t("common.create") }}
+ {{ t("common.create") }}
</NButton>
</div>
@@ -22,10 +22,10 @@
v-bind="$attrs"
>
<NButton @click.prevent="revertEnvironment">
- {{ $t("common.cancel") }}
+ {{ t("common.cancel") }}
</NButton>
<NButton type="primary" @click.prevent="updateEnvironment">
- {{ $t("common.confirm-and-update") }}
+ {{ t("common.confirm-and-update") }}
</NButton>
</div>
</template>
diff --git a/frontend/src/components/EnvironmentForm/Form.vue b/frontend/src/components/EnvironmentForm/Form.vue
index 0c8797940f..d26722d3bc 100644
--- a/frontend/src/components/EnvironmentForm/Form.vue
+++ b/frontend/src/components/EnvironmentForm/Form.vue
@@ -7,7 +7,7 @@
<component :is="renderColorPicker()" />
</div>
<span for="name" class="font-medium">
- {{ $t("common.environment-name") }}
+ {{ t("common.environment-name") }}
<RequiredStar />
</span>
</div>
@@ -36,7 +36,7 @@
<div v-if="features.includes('TIER')" class="flex flex-col gap-y-2">
<div class="gap-y-1">
<label class="font-medium flex items-center">
- {{ $t("policy.environment-tier.name") }}
+ {{ t("policy.environment-tier.name") }}
<FeatureBadge :feature="PlanFeature.FEATURE_ENVIRONMENT_TIERS" />
</label>
<p class="text-sm text-gray-600">
@@ -60,7 +60,7 @@
}
"
>
- {{ $t("policy.environment-tier.mark-env-as-production") }}
+ {{ t("policy.environment-tier.mark-env-as-production") }}
</NCheckbox>
</div>
@@ -71,19 +71,17 @@
<div class="gap-y-1">
<div class="flex items-baseline space-x-2">
<label class="font-medium">
- {{ $t("policy.rollout.name") }}
+ {{ t("policy.rollout.name") }}
</label>
<span
v-show="!create && valueChanged('rolloutPolicy')"
class="textlabeltip"
>
- {{ $t("policy.rollout.tip") }}
+ {{ t("policy.rollout.tip") }}
</span>
</div>
<div class="textinfolabel">
- {{
- $t("policy.rollout.info", { permission: "bb.taskRuns.create" })
- }}
+ {{ t("policy.rollout.info", { permission: "bb.taskRuns.create" }) }}
<LearnMoreLink
class="ml-1"
url="https://docs.bytebase.com/change-database/environment-policy/rollout-policy/?source=console"
@@ -118,10 +116,10 @@
<BBButtonConfirm
v-if="allowArchive"
:type="'DELETE'"
- :button-text="$t('environment.delete')"
- :ok-text="$t('common.delete')"
+ :button-text="t('environment.delete')"
+ :ok-text="t('common.delete')"
:confirm-title="
- $t('environment.delete') + ` '${state.environment.title}'?`
+ t('environment.delete') + ` '${state.environment.title}'?`
"
:positive-button-props="{
disabled: existRelatedResource ? !confirmDelete : false,
@@ -138,8 +136,8 @@
<span>
{{
existRelatedResource
- ? $t("environment.delete-description")
- : $t("common.cannot-undo-this-action")
+ ? t("environment.delete-description")
+ : t("common.cannot-undo-this-action")
}}
</span>
</div>
diff --git a/frontend/src/components/EnvironmentForm/RolloutPolicyConfig.vue b/frontend/src/components/EnvironmentForm/RolloutPolicyConfig.vue
index 969c44641c..2f3f7db5d5 100644
--- a/frontend/src/components/EnvironmentForm/RolloutPolicyConfig.vue
+++ b/frontend/src/components/EnvironmentForm/RolloutPolicyConfig.vue
@@ -18,10 +18,10 @@
/>
<div class="flex flex-col">
<span class="textlabel">
- {{ $t("policy.rollout.auto") }}
+ {{ t("policy.rollout.auto") }}
</span>
<div class="textinfolabel">
- {{ $t("policy.rollout.auto-info") }}
+ {{ t("policy.rollout.auto-info") }}
</div>
</div>
</div>
@@ -30,7 +30,7 @@
<!-- Requirements Section -->
<div class="flex flex-col gap-y-2">
<div class="textlabel font-medium">
- {{ $t("policy.rollout.checkers.self") }}
+ {{ t("policy.rollout.checkers.self") }}
</div>
<!-- Required Issue Approval -->
@@ -43,11 +43,11 @@
/>
<div class="flex flex-col">
<span class="textlabel">
- {{ $t("policy.rollout.checkers.required-issue-approval.self") }}
+ {{ t("policy.rollout.checkers.required-issue-approval.self") }}
</span>
<div class="textinfolabel">
{{
- $t("policy.rollout.checkers.required-issue-approval.description")
+ t("policy.rollout.checkers.required-issue-approval.description")
}}
</div>
</div>
@@ -63,11 +63,11 @@
/>
<div class="flex flex-col">
<span class="textlabel">
- {{ $t("policy.rollout.checkers.plan-check-enforcement.self") }}
+ {{ t("policy.rollout.checkers.plan-check-enforcement.self") }}
</span>
<div class="textinfolabel">
{{
- $t("policy.rollout.checkers.plan-check-enforcement.description")
+ t("policy.rollout.checkers.plan-check-enforcement.description")
}}
</div>
</div>
@@ -90,14 +90,14 @@
<div class="flex flex-col">
<div>
{{
- $t(
+ t(
"policy.rollout.checkers.plan-check-enforcement.error-only.self"
)
}}
</div>
<div class="textinfolabel">
{{
- $t(
+ t(
"policy.rollout.checkers.plan-check-enforcement.error-only.description"
)
}}
@@ -108,14 +108,14 @@
<div class="flex flex-col">
<div>
{{
- $t(
+ t(
"policy.rollout.checkers.plan-check-enforcement.strict.self"
)
}}
</div>
<div class="textinfolabel">
{{
- $t(
+ t(
"policy.rollout.checkers.plan-check-enforcement.strict.description"
)
}}
@@ -134,6 +134,7 @@ import { create } from "@bufbuild/protobuf";
import { cloneDeep } from "lodash-es";
import { NRadioGroup, NRadio } from "naive-ui";
import { ref, watch, computed } from "vue";
+import { useI18n } from "vue-i18n";
import type {
Policy,
RolloutPolicy,
@@ -146,6 +147,8 @@ import {
} from "@/types/proto-es/v1/org_policy_service_pb";
import { RoleSelect, Switch } from "../v2";
+const { t } = useI18n();
+
const props = defineProps<{
policy: Policy;
disabled?: boolean;
diff --git a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
index fd3f7b706c..a21b4695b2 100644
--- a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
+++ b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
@@ -8,17 +8,20 @@
/>
</template>
- <span>{{ $t("environment.production-environment") }}</span>
+ <span>{{ t("environment.production-environment") }}</span>
</NTooltip>
</template>
<script lang="ts" setup>
import { NTooltip } from "naive-ui";
import { computed } from "vue";
+import { useI18n } from "vue-i18n";
import { featureToRef } from "@/store";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import type { Environment } from "@/types/v1/environment";
+const { t } = useI18n();
+
const props = withDefaults(
defineProps<{
environment: Environment;
diff --git a/frontend/src/components/v2/Select/EnvironmentSelect.vue b/frontend/src/components/v2/Select/EnvironmentSelect.vue
index cf64f47251..ab3177daa4 100644
--- a/frontend/src/components/v2/Select/EnvironmentSelect.vue
+++ b/frontend/src/components/v2/Select/EnvironmentSelect.vue
@@ -1,7 +1,7 @@
<template>
<ResourceSelect
v-bind="$attrs"
- :placeholder="$t('environment.select')"
+ :placeholder="t('environment.select')"
:multiple="multiple"
:value="environmentName"
:values="environmentNames"
@@ -15,12 +15,15 @@
<script lang="tsx" setup>
import { computed } from "vue";
+import { useI18n } from "vue-i18n";
import { useEnvironmentV1Store } from "@/store";
import { formatEnvironmentName } from "@/types";
import type { Environment } from "@/types/v1/environment";
import { EnvironmentV1Name } from "../Model";
import ResourceSelect from "./ResourceSelect.vue";
+const { t } = useI18n();
+
const props = withDefaults(
defineProps<{
environmentName?: string | undefined;
diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vue
index 5ff28146fb..42ae1cb286 100644
--- a/frontend/src/views/EnvironmentDashboard.vue
+++ b/frontend/src/views/EnvironmentDashboard.vue
@@ -35,7 +35,7 @@
<template #icon>
<ListOrderedIcon class="h-4 w-4" />
</template>
- {{ $t("common.reorder") }}
+ {{ t("common.reorder") }}
</NButton>
<NButton
v-if="hasWorkspacePermissionV2('bb.settings.set')"
@@ -45,7 +45,7 @@
<template #icon>
<PlusIcon class="h-4 w-4" />
</template>
- {{ $t("environment.create") }}
+ {{ t("environment.create") }}
</NButton>
</div>
</template>
@@ -61,7 +61,7 @@
@cancel="state.showCreateModal = false"
>
<DrawerContent
- :title="$t('environment.create')"
+ :title="t('environment.create')"
class="w-xl max-w-[100vw]"
>
<EnvironmentFormBody />
@@ -73,10 +73,7 @@
</Drawer>
<Drawer v-model:show="state.reorder" :close-on-esc="true">
- <DrawerContent
- :title="$t('environment.reorder')"
- class="w-120 max-w-[90vw]"
- >
+ <DrawerContent :title="t('environment.reorder')" class="w-120 max-w-[90vw]">
<div>
<Draggable
v-model="state.reorderedEnvironmentList"
@@ -101,9 +98,9 @@
</div>
<template #footer>
<div class="flex items-center justify-end gap-x-2">
- <NButton @click="discardReorder">{{ $t("common.cancel") }}</NButton>
+ <NButton @click="discardReorder">{{ t("common.cancel") }}</NButton>
<NButton type="primary" :disabled="!orderChanged" @click="doReorder">
- {{ $t("common.confirm") }}
+ {{ t("common.confirm") }}
</NButton>
</div>
</template>