Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Add translation keys for Environment Indicator component (#136)
Browse files Browse the repository at this point in the history
* Begin Work

* Finish work
  • Loading branch information
Mysterious-Dev authored Nov 13, 2023
1 parent a60b771 commit ba159e1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
42 changes: 35 additions & 7 deletions lib/components/base/EnvironmentIndicator.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<span v-if="typeOnly" class="environment">
<InfoIcon aria-hidden="true" />
A {{ type }}
{{ formatMessage(messages.typeLabel, { type: type }) }}
</span>
<span
v-else-if="
Expand All @@ -13,11 +13,11 @@
>
<template v-if="clientSide === 'optional' && serverSide === 'optional'">
<GlobeIcon aria-hidden="true" />
Client or server
{{ formatMessage(messages.clientOrServerLabel) }}
</template>
<template v-else-if="clientSide === 'required' && serverSide === 'required'">
<GlobeIcon aria-hidden="true" />
Client and server
{{ formatMessage(messages.clientAndServerLabel) }}
</template>
<template
v-else-if="
Expand All @@ -26,7 +26,7 @@
"
>
<ClientIcon aria-hidden="true" />
Client
{{ formatMessage(messages.clientLabel) }}
</template>
<template
v-else-if="
Expand All @@ -35,20 +35,48 @@
"
>
<ServerIcon aria-hidden="true" />
Server
{{ formatMessage(messages.serverLabel) }}
</template>
<template v-else-if="serverSide === 'unsupported' && clientSide === 'unsupported'">
<GlobeIcon aria-hidden="true" />
Unsupported
{{ formatMessage(messages.unsupportedLabel) }}
</template>
<template v-else-if="alwaysShow">
<InfoIcon aria-hidden="true" />
A {{ type }}
{{ formatMessage(messages.typeLabel, { type: type }) }}
</template>
</span>
</template>
<script setup>
import { GlobeIcon, ClientIcon, ServerIcon, InfoIcon } from '@'
import { useVIntl, defineMessages } from '@vintl/vintl'
const messages = defineMessages({
clientLabel: {
id: 'omorphia.component.environment-indicator.label.client',
defaultMessage: 'Client',
},
clientAndServerLabel: {
id: 'omorphia.component.environment-indicator.label.client-and-server',
defaultMessage: 'Client and server',
},
clientOrServerLabel: {
id: 'omorphia.component.environment-indicator.label.client-or-server',
defaultMessage: 'Client or server',
},
serverLabel: {
id: 'omorphia.component.environment-indicator.label.server',
defaultMessage: 'Server',
},
typeLabel: {
id: 'omorphia.component.environment-indicator.label.type',
defaultMessage: 'A {type}',
},
unsupportedLabel: {
id: 'omorphia.component.environment-indicator.label.unsupported',
defaultMessage: 'Unsupported',
},
})
const { formatMessage } = useVIntl()
</script>
<script>
import { defineComponent } from 'vue'
Expand Down
18 changes: 18 additions & 0 deletions locales/en-US/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,23 @@
},
"omorphia.component.copy.action.copy": {
"defaultMessage": "Copy code to clipboard"
},
"omorphia.component.environment-indicator.label.client": {
"defaultMessage": "Client"
},
"omorphia.component.environment-indicator.label.client-and-server": {
"defaultMessage": "Client and server"
},
"omorphia.component.environment-indicator.label.client-or-server": {
"defaultMessage": "Client or server"
},
"omorphia.component.environment-indicator.label.server": {
"defaultMessage": "Server"
},
"omorphia.component.environment-indicator.label.type": {
"defaultMessage": "A {type}"
},
"omorphia.component.environment-indicator.label.unsupported": {
"defaultMessage": "Unsupported"
}
}

0 comments on commit ba159e1

Please sign in to comment.