Commit 06d6db5e authored by Zack Cuddy's avatar Zack Cuddy

Geo Node Status 2.0 - i18n Cleanup

This change properly scopes the
translations for the geo_nodes_beta
scope.

This change also moves all component
translations to the $options.
parent 3ca18ac9
<script> <script>
import { GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui'; import { GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui';
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import { s__, __ } from '~/locale';
import { GEO_INFO_URL } from '../constants'; import { GEO_INFO_URL } from '../constants';
import GeoNodes from './geo_nodes.vue'; import GeoNodes from './geo_nodes.vue';
import GeoNodesEmptyState from './geo_nodes_empty_state.vue'; import GeoNodesEmptyState from './geo_nodes_empty_state.vue';
export default { export default {
name: 'GeoNodesBetaApp', name: 'GeoNodesBetaApp',
i18n: {
geoSites: s__('Geo|Geo sites'),
helpText: s__(
'Geo|With GitLab Geo, you can install a special read-only and replicated instance anywhere.',
),
learnMore: __('Learn more'),
addSite: s__('Geo|Add site'),
},
components: { components: {
GlLink, GlLink,
GlButton, GlButton,
...@@ -42,18 +51,14 @@ export default { ...@@ -42,18 +51,14 @@ export default {
<template> <template>
<section> <section>
<h3>{{ s__('Geo|Geo sites') }}</h3> <h3>{{ $options.i18n.geoSites }}</h3>
<div <div
class="gl-display-flex gl-flex-direction-column gl-md-flex-direction-row gl-md-align-items-center gl-pb-5 gl-border-b-1 gl-border-b-solid gl-border-b-gray-100" class="gl-display-flex gl-flex-direction-column gl-md-flex-direction-row gl-md-align-items-center gl-pb-5 gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
> >
<div class="gl-mr-5"> <div class="gl-mr-5">
<span>{{ <span>{{ $options.i18n.helpText }}</span>
s__(
'Geo|With GitLab Geo, you can install a special read-only and replicated instance anywhere.',
)
}}</span>
<gl-link class="gl-ml-2" :href="$options.GEO_INFO_URL" target="_blank">{{ <gl-link class="gl-ml-2" :href="$options.GEO_INFO_URL" target="_blank">{{
__('Learn more') $options.i18n.learnMore
}}</gl-link> }}</gl-link>
</div> </div>
<gl-button <gl-button
...@@ -62,7 +67,7 @@ export default { ...@@ -62,7 +67,7 @@ export default {
variant="confirm" variant="confirm"
:href="newNodeUrl" :href="newNodeUrl"
target="_blank" target="_blank"
>{{ s__('Geo|Add site') }} >{{ $options.i18n.addSite }}
</gl-button> </gl-button>
</div> </div>
<gl-loading-icon v-if="isLoading" size="xl" class="gl-mt-5" /> <gl-loading-icon v-if="isLoading" size="xl" class="gl-mt-5" />
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
url: __('URL'), url: __('URL'),
internalUrl: s__('Geo|Internal URL'), internalUrl: s__('Geo|Internal URL'),
gitlabVersion: __('GitLab version'), gitlabVersion: __('GitLab version'),
unknown: __('Unknown'),
}, },
components: { components: {
GlLink, GlLink,
...@@ -24,7 +25,7 @@ export default { ...@@ -24,7 +25,7 @@ export default {
...mapState(['primaryVersion', 'primaryRevision']), ...mapState(['primaryVersion', 'primaryRevision']),
nodeVersion() { nodeVersion() {
if (!this.node.version || !this.node.revision) { if (!this.node.version || !this.node.revision) {
return __('Unknown'); return this.$options.i18n.unknown;
} }
return `${this.node.version} (${this.node.revision})`; return `${this.node.version} (${this.node.revision})`;
}, },
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
i18n: { i18n: {
otherInformation: __('Other information'), otherInformation: __('Other information'),
replicationSlotWAL: s__('Geo|Replication slot WAL'), replicationSlotWAL: s__('Geo|Replication slot WAL'),
replicationSlots: s__('Geo|Replication slots'),
}, },
components: { components: {
GlCard, GlCard,
...@@ -26,7 +27,7 @@ export default { ...@@ -26,7 +27,7 @@ export default {
}, },
replicationSlots() { replicationSlots() {
return { return {
title: s__('Geo|Replication slots'), title: this.$options.i18n.replicationSlots,
values: { values: {
total: this.node.replicationSlotsCount || 0, total: this.node.replicationSlotsCount || 0,
success: this.node.replicationSlotsUsedCount || 0, success: this.node.replicationSlotsUsedCount || 0,
......
...@@ -5,6 +5,10 @@ import GeoNodeHeader from './header/geo_node_header.vue'; ...@@ -5,6 +5,10 @@ import GeoNodeHeader from './header/geo_node_header.vue';
export default { export default {
name: 'GeoNodes', name: 'GeoNodes',
i18n: {
primarySite: s__('Geo|Primary site'),
secondarySite: s__('Geo|Secondary site'),
},
components: { components: {
GeoNodeHeader, GeoNodeHeader,
GeoNodeDetails, GeoNodeDetails,
...@@ -24,7 +28,7 @@ export default { ...@@ -24,7 +28,7 @@ export default {
}, },
computed: { computed: {
siteTitle() { siteTitle() {
return this.node.primary ? s__('Geo|Primary site') : s__('Geo|Secondary site'); return this.node.primary ? this.$options.i18n.primarySite : this.$options.i18n.secondarySite;
}, },
}, },
methods: { methods: {
......
<script> <script>
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import { s__ } from '~/locale';
import { GEO_FEATURE_URL } from '../constants'; import { GEO_FEATURE_URL } from '../constants';
export default { export default {
name: 'GeoNodesEmptyState', name: 'GeoNodesEmptyState',
i18n: {
emptyStateTitle: s__('Geo|Discover GitLab Geo'),
emptyStateDescription: s__(
'Geo|Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos.',
),
emptyStateButton: s__('Geo|Learn more about Geo'),
},
components: { components: {
GlEmptyState, GlEmptyState,
}, },
...@@ -19,14 +27,10 @@ export default { ...@@ -19,14 +27,10 @@ export default {
<template> <template>
<gl-empty-state <gl-empty-state
:title="s__('Geo|Discover GitLab Geo')" :title="$options.i18n.emptyStateTitle"
:svg-path="svgPath" :svg-path="svgPath"
:description=" :description="$options.i18n.emptyStateDescription"
s__(
'Geo|Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos.',
)
"
:primary-button-link="$options.GEO_FEATURE_URL" :primary-button-link="$options.GEO_FEATURE_URL"
:primary-button-text="s__('Geo|Learn more about Geo')" :primary-button-text="$options.i18n.emptyStateButton"
/> />
</template> </template>
...@@ -9,6 +9,8 @@ export default { ...@@ -9,6 +9,8 @@ export default {
name: 'GeoNodeHeader', name: 'GeoNodeHeader',
i18n: { i18n: {
currentNodeLabel: __('Current'), currentNodeLabel: __('Current'),
expand: __('Expand'),
collapse: __('Collapse'),
}, },
components: { components: {
GlButton, GlButton,
...@@ -33,7 +35,7 @@ export default { ...@@ -33,7 +35,7 @@ export default {
return this.collapsed ? 'chevron-right' : 'chevron-down'; return this.collapsed ? 'chevron-right' : 'chevron-down';
}, },
chevronLabel() { chevronLabel() {
return this.collapsed ? __('Expand') : __('Collapse'); return this.collapsed ? this.$options.i18n.expand : this.$options.i18n.collapse;
}, },
statusCheckTimestamp() { statusCheckTimestamp() {
return this.node.lastSuccessfulStatusCheckTimestamp * 1000; return this.node.lastSuccessfulStatusCheckTimestamp * 1000;
......
...@@ -10,6 +10,12 @@ import timeAgoMixin from '~/vue_shared/mixins/timeago'; ...@@ -10,6 +10,12 @@ import timeAgoMixin from '~/vue_shared/mixins/timeago';
export default { export default {
name: 'GeoNodeLastUpdated', name: 'GeoNodeLastUpdated',
i18n: {
troubleshootText: s__('Geo|Consult Geo troubleshooting information'),
learnMoreText: s__('Geo|Learn more about Geo node statuses'),
timeAgoMainText: s__('Geo|Updated %{timeAgo}'),
timeAgoPopoverText: s__(`Geo|Node's status was updated %{timeAgo}.`),
},
components: { components: {
GlPopover, GlPopover,
GlLink, GlLink,
...@@ -30,13 +36,13 @@ export default { ...@@ -30,13 +36,13 @@ export default {
syncHelp() { syncHelp() {
if (this.isSyncStale) { if (this.isSyncStale) {
return { return {
text: s__('GeoNodes|Consult Geo troubleshooting information'), text: this.$options.i18n.troubleshootText,
link: GEO_TROUBLESHOOTING_URL, link: GEO_TROUBLESHOOTING_URL,
}; };
} }
return { return {
text: s__('GeoNodes|Learn more about Geo node statuses'), text: this.$options.i18n.learnMoreText,
link: HELP_NODE_HEALTH_URL, link: HELP_NODE_HEALTH_URL,
}; };
}, },
...@@ -44,8 +50,8 @@ export default { ...@@ -44,8 +50,8 @@ export default {
const timeAgo = this.timeFormatted(this.statusCheckTimestamp); const timeAgo = this.timeFormatted(this.statusCheckTimestamp);
return { return {
mainText: sprintf(s__('GeoNodes|Updated %{timeAgo}'), { timeAgo }), mainText: sprintf(this.$options.i18n.timeAgoMainText, { timeAgo }),
popoverText: sprintf(s__("GeoNodes|Node's status was updated %{timeAgo}."), { timeAgo }), popoverText: sprintf(this.$options.i18n.timeAgoPopoverText, { timeAgo }),
}; };
}, },
}, },
......
import Api from 'ee/api'; import Api from 'ee/api';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { __ } from '~/locale'; import { s__ } from '~/locale';
import * as types from './mutation_types'; import * as types from './mutation_types';
export const fetchNodes = ({ commit }) => { export const fetchNodes = ({ commit }) => {
...@@ -21,7 +21,7 @@ export const fetchNodes = ({ commit }) => { ...@@ -21,7 +21,7 @@ export const fetchNodes = ({ commit }) => {
commit(types.RECEIVE_NODES_SUCCESS, inflatedNodes); commit(types.RECEIVE_NODES_SUCCESS, inflatedNodes);
}) })
.catch(() => { .catch(() => {
createFlash({ message: __('There was an error fetching the Geo Nodes') }); createFlash({ message: s__('Geo|There was an error fetching the Geo Nodes') });
commit(types.RECEIVE_NODES_ERROR); commit(types.RECEIVE_NODES_ERROR);
}); });
}; };
...@@ -14425,6 +14425,9 @@ msgstr "" ...@@ -14425,6 +14425,9 @@ msgstr ""
msgid "Geo|Connection timeout should be between 1-120" msgid "Geo|Connection timeout should be between 1-120"
msgstr "" msgstr ""
msgid "Geo|Consult Geo troubleshooting information"
msgstr ""
msgid "Geo|Could not remove tracking entry for an existing project." msgid "Geo|Could not remove tracking entry for an existing project."
msgstr "" msgstr ""
...@@ -14497,6 +14500,9 @@ msgstr "" ...@@ -14497,6 +14500,9 @@ msgstr ""
msgid "Geo|Learn more about Geo" msgid "Geo|Learn more about Geo"
msgstr "" msgstr ""
msgid "Geo|Learn more about Geo node statuses"
msgstr ""
msgid "Geo|Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos." msgid "Geo|Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos."
msgstr "" msgstr ""
...@@ -14512,6 +14518,9 @@ msgstr "" ...@@ -14512,6 +14518,9 @@ msgstr ""
msgid "Geo|Node name should be between 1 and 255 characters" msgid "Geo|Node name should be between 1 and 255 characters"
msgstr "" msgstr ""
msgid "Geo|Node's status was updated %{timeAgo}."
msgstr ""
msgid "Geo|Not synced yet" msgid "Geo|Not synced yet"
msgstr "" msgstr ""
...@@ -14650,6 +14659,9 @@ msgstr "" ...@@ -14650,6 +14659,9 @@ msgstr ""
msgid "Geo|There are no %{replicable_type} to show" msgid "Geo|There are no %{replicable_type} to show"
msgstr "" msgstr ""
msgid "Geo|There was an error fetching the Geo Nodes"
msgstr ""
msgid "Geo|Tracking database entry will be removed. Are you sure?" msgid "Geo|Tracking database entry will be removed. Are you sure?"
msgstr "" msgstr ""
...@@ -14671,6 +14683,9 @@ msgstr "" ...@@ -14671,6 +14683,9 @@ msgstr ""
msgid "Geo|Unknown state" msgid "Geo|Unknown state"
msgstr "" msgstr ""
msgid "Geo|Updated %{timeAgo}"
msgstr ""
msgid "Geo|Verification" msgid "Geo|Verification"
msgstr "" msgstr ""
...@@ -32022,9 +32037,6 @@ msgstr "" ...@@ -32022,9 +32037,6 @@ msgstr ""
msgid "There was an error fetching the %{replicableType}" msgid "There was an error fetching the %{replicableType}"
msgstr "" msgstr ""
msgid "There was an error fetching the Geo Nodes"
msgstr ""
msgid "There was an error fetching the Geo Settings" msgid "There was an error fetching the Geo Settings"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment