Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ui/src/i18n/en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Plugin-local translations merged into the host i18n store at install
// time. Keep keys flat (dot-separated) to match the host's existing
// convention.
export default {
'user.deleteConfirmBefore': 'Are you sure you want to delete ',
'user.deleteConfirmAfter': '?',
'group.deleteConfirmBefore': 'Are you sure you want to delete ',
'group.deleteConfirmAfter': '?',
'company.deleteConfirmBefore': 'Are you sure you want to delete ',
'company.deleteConfirmAfter': '?',
}
11 changes: 11 additions & 0 deletions ui/src/i18n/fr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Plugin-local translations merged into the host i18n store at install
// time. Keep keys flat (dot-separated) to match the host's existing
// convention.
export default {
'user.deleteConfirmBefore': 'Êtes-vous certain de supprimer ',
'user.deleteConfirmAfter': ' ?',
'group.deleteConfirmBefore': 'Êtes-vous certain de supprimer ',
'group.deleteConfirmAfter': ' ?',
'company.deleteConfirmBefore': 'Êtes-vous certain de supprimer ',
'company.deleteConfirmAfter': ' ?',
}
7 changes: 7 additions & 0 deletions ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if (typeof document !== 'undefined') {
* Shared host surface (stores, composables) is imported from `@ligoj/host`,
* kept external at build so plugin and host share the same instances.
*/
import { useI18nStore } from '@ligoj/host'
import IdPlugin from './IdPlugin.vue'
import UserListView from './views/UserListView.vue'
import UserEditView from './views/UserEditView.vue'
Expand All @@ -43,6 +44,8 @@ import CompanyEditView from './views/CompanyEditView.vue'
import DelegateListView from './views/DelegateListView.vue'
import DelegateEditView from './views/DelegateEditView.vue'
import ContainerScopeView from './views/ContainerScopeView.vue'
import enMessages from './i18n/en.js'
import frMessages from './i18n/fr.js'
import service from './service.js'

const features = {
Expand Down Expand Up @@ -76,6 +79,10 @@ export default {
for (const route of routes) {
router.addRoute(route)
}
// Register plugin-local translations into the host i18n store
const i18n = useI18nStore()
i18n.merge(enMessages, 'en')
i18n.merge(frMessages, 'fr')
},
feature(action, ...args) {
const fn = features[action]
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/CompanyEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<v-card>
<v-card-title>{{ t('company.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('company.deleteConfirm', { name: form.name }) }}
{{ t('company.deleteConfirmBefore') }}<strong class="text-error">{{ form.name }}</strong>{{ t('company.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/CompanyListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<v-card>
<v-card-title>{{ t('company.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('company.deleteConfirm', { name: deleteTarget?.name }) }}
{{ t('company.deleteConfirmBefore') }}<strong class="text-error">{{ deleteTarget?.name }}</strong>{{ t('company.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/GroupEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<v-card>
<v-card-title>{{ t('group.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('group.deleteConfirm', { name: form.name }) }}
{{ t('group.deleteConfirmBefore') }}<strong class="text-error">{{ form.name }}</strong>{{ t('group.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/GroupListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<v-card>
<v-card-title>{{ t('group.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('group.deleteConfirm', { name: deleteTarget?.name }) }}
{{ t('group.deleteConfirmBefore') }}<strong class="text-error">{{ deleteTarget?.name }}</strong>{{ t('group.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/UserEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<v-card>
<v-card-title>{{ t('user.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('user.deleteConfirm', { id: form.id }) }}
{{ t('user.deleteConfirmBefore') }}<strong class="text-error">{{ form.id }}</strong>{{ t('user.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/UserListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<v-card>
<v-card-title>{{ t('user.deleteTitle') }}</v-card-title>
<v-card-text>
{{ t('user.deleteConfirm', { id: deleteTarget?.id }) }}
{{ t('user.deleteConfirmBefore') }}<strong class="text-error">{{ deleteTarget?.id }}</strong>{{ t('user.deleteConfirmAfter') }}
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
Loading