-
+
{{slotProps.message.detail}}
@@ -180,6 +181,7 @@ const helperApp = Vue.createApp({
helperApp.use(PvConfig);
helperApp.use(PvConfirmationService);
+//helperApp.use(FhcPhrasen);
const helperAppInstance = helperApp.mount(helperAppContainer);
@@ -188,6 +190,9 @@ document.body.appendChild(helperAppContainer);
export default {
install: (app, options) => {
+ if (!app.config.globalProperties.$p)
+ app.use(FhcPhrasen);
+
const $fhcAlert = {
alertSuccess(message) {
if (Array.isArray(message))
@@ -210,6 +215,8 @@ export default {
helperAppInstance.$refs.toast.add({ severity: 'error', summary: 'Achtung', detail: message });
},
alertSystemError(message) {
+ //TODO(Manu) for translation of content of template: restructure in data
+ //and update definitions with translations
if (Array.isArray(message))
return message.forEach(this.alertSystemError);
helperAppInstance.$refs.alert.add({ severity: 'error', summary: 'Systemfehler', detail: message});
@@ -218,11 +225,11 @@ export default {
return new Promise((resolve, reject) => {
helperAppInstance.$confirm.require({
group: 'fhcAlertConfirm',
- header: 'Achtung',
- message: 'Möchten Sie sicher löschen?',
- acceptLabel: 'Löschen',
+ header: Vue.computed(() => app.config.globalProperties.$p.t('alert/attention')),
+ message: Vue.computed(() => app.config.globalProperties.$p.t('alert/confirm_delete')),
+ acceptLabel: Vue.computed(() => app.config.globalProperties.$p.t('ui/loeschen')),
acceptClass: 'p-button-danger',
- rejectLabel: 'Abbrechen',
+ rejectLabel: Vue.computed(() => app.config.globalProperties.$p.t('ui/abbrechen')),
rejectClass: 'p-button-secondary',
accept() {
resolve(true);
@@ -237,11 +244,11 @@ export default {
return new Promise((resolve, reject) => {
helperAppInstance.$confirm.require({
group: options?.group ?? 'fhcAlertConfirm',
- header: options?.header ?? 'Achtung',
+ header: options?.header ?? Vue.computed(() => app.config.globalProperties.$p.t('alert/attention')),
message: options?.message ?? '',
acceptLabel: options?.acceptLabel ?? 'Ok',
acceptClass: options?.acceptClass ?? 'btn btn-primary',
- rejectLabel: options?.rejectLabel ?? 'Abbrechen',
+ rejectLabel: options?.rejectLabel ?? Vue.computed(() => app.config.globalProperties.$p.t('ui/abbrechen')),
rejectClass: options?.rejectClass ?? 'btn btn-outline-secondary',
accept() {
resolve(true);
diff --git a/public/js/plugins/Phrasen.js b/public/js/plugins/Phrasen.js
index 70f4fb64f..303e74358 100644
--- a/public/js/plugins/Phrasen.js
+++ b/public/js/plugins/Phrasen.js
@@ -87,8 +87,10 @@ const phrasen = {
export default {
install(app, options) {
- app.use(OldFhcApi); // TODO(chris): remove at some point
- app.use(PluginsApi);
+ if (!app.config.globalProperties.$fhcApi)
+ app.use(OldFhcApi); // TODO(chris): remove at some point
+ if (!app.config.globalProperties.$api)
+ app.use(PluginsApi);
app.config.globalProperties.$p = {
t: phrasen.t,
loadCategory: cat => phrasen.loadCategory.call(app, cat),
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php
index abe07745e..34180326d 100644
--- a/system/phrasesupdate.php
+++ b/system/phrasesupdate.php
@@ -44414,6 +44414,68 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
+ // FHC-4 Studierendenverwaltung FHC-ALERTS START
+ array(
+ 'app' => 'core',
+ 'category' => 'alert',
+ 'phrase' => 'attention',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Achtung',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Attention',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
+ array(
+ 'app' => 'core',
+ 'category' => 'alert',
+ 'phrase' => 'confirm_delete',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Möchten Sie wirklich löschen?',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Do you really want to delete?',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
+ array(
+ 'app' => 'core',
+ 'category' => 'alert',
+ 'phrase' => 'attention',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Achtung',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Attention',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
+ // FHC-4 Studierendenverwaltung FHC-ALERTS END
);