Skip to content

Commit

Permalink
Texte durch Sprog-Keys austauschen
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed Aug 30, 2024
1 parent b78e93d commit 5c1e664
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 5 deletions.
5 changes: 5 additions & 0 deletions lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,8 @@ wenns_sein_muss_demo_import = Demo-Daten imporiteren (ohne jegliche Gewähr, pro
wenns_sein_muss_demo = Demo-Daten importieren
wenns_sein_muss_demo_warning = Achtung, jetzt wird's ernst! Alle bisher gewählten Drittanbieter-Gruppen und Einstellungen gehen verloren. Wirklich fortfahren?
wenns_sein_muss_demo_imported = Alle Demo-Daten wurden importiert. Als nächstes Demo-Daten anpassen!

wenns_sein_muss_sprog_import = Sprog verwenden
wenns_sein_muss_sprog = Sprog-Keys erstellen
wenns_sein_muss_sprog_warning = Achtung, jetzt wird's ernst! Alle Texte aus den Einstellungen werden durch Sprog-Keys ersetzt. Wirklich fortfahren?
wenns_sein_muss_sprog_imported = Alle Texte wurden durch Sprog-Keys ausgetauscht. Als nächstes Sprog-Texte anpassen!
47 changes: 42 additions & 5 deletions package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ supportpage: https://github.com/alexplusde/wenns_sein_muss

requires:
php:
version: '^8'
redaxo: ^5.14
version: '>=8.2,<9'
redaxo: ^5.17
packages:
yform: "^4.1"
yform/manager: "^4.1"

page:
title: translate:wenns_sein_muss_title
Expand Down Expand Up @@ -74,7 +75,7 @@ pages:

default_config:
#settings page: basic
revision: 0
revision: 1
auto_lang: 1
iframemanager: 1
disable_page_interaction: 0
Expand All @@ -95,9 +96,8 @@ default_config:
consent_settings_open: Einstellungen öffnen

# settings page: text

consent_settings_title: Einstellungen
consent_settings_save: speichern
consent_settings_save: Speichern
consent_settings_accept_all: Alle akzeptieren
consent_settings_reject_all: Alle ablehnen
consent_settings_close: Schließen
Expand All @@ -120,3 +120,40 @@ default_config:
iframe_notice_more: Weitere Informationen
iframe_load_btn: Diesmal anzeigen
iframe_load_all_btn: Immer anzeigen

sprog_config:
# settings page: consent
consent_modal_title: true
consent_modal_description: true
consent_modal_settings: true
consent_modal_accept_all: true
consent_modal_accept_necessary: true

consent_modal_open: true
consent_settings_open: true

# settings page: text
consent_settings_title: true
consent_settings_save: true
consent_settings_accept_all: true
consent_settings_reject_all: true
consent_settings_close: true
consent_settings_service_counter_badge: true

consent_settings_cookie_table_headers_col1: true
consent_settings_cookie_table_headers_col2: true
consent_settings_cookie_table_headers_col3: true
consent_settings_cookie_table_headers_col4: true

consent_info_domain: true
consent_info_uuid: true
consent_info_unknown: true
consent_info_datestamp: true
consent_info_update_datestamp: true
consent_info_more: true

# settings page: iframe
iframe_notice: true
iframe_notice_more: true
iframe_load_btn: true
iframe_load_all_btn: true
26 changes: 26 additions & 0 deletions pages/settings.demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@
rex_sql_util::importDump($file);
echo rex_view::success(rex_i18n::msg('wenns_sein_muss_demo_imported'));
}
if ($func === 'sprog') {
$package = rex_package::get('wenns_sein_muss');
$sprog_config = $package->getProperty('sprog_config');
foreach($sprog_config as $key) {
rex_config::set('wenns_sein_muss', $key, Sprog\Wildcard::getOpenTag() . $key .Sprog\Wildcard::getCloseTag());
}
}

}
}

/* Demo-Daten importieren */

$content = "";
$content .= '<p>'.rex_i18n::msg('wenns_sein_muss_demo_import').'</p>';
$content .= '<p><a class="btn btn-primary" href="'.rex_url::currentBackendPage(['func' => 'setup'] + $csrf->getUrlParams()).'" data-confirm="'.rex_i18n::msg('wenns_sein_muss_demo_warning').'">'.rex_i18n::msg('wenns_sein_muss_demo').'</a></p>';
Expand All @@ -24,3 +35,18 @@
$fragment->setVar('title', rex_i18n::msg('wenns_sein_muss_demo'), false);
$fragment->setVar('body', $content, false);
echo $fragment->parse('core/page/section.php');

/* Config mit Sprog-Keys überschreiben */

if(rex_addon::get('sprog')->isAvailable()) {
$content = "";
$content .= '<p>'.rex_i18n::msg('wenns_sein_muss_sprog_import').'</p>';
$content .= '<p><a class="btn btn-primary" href="'.rex_url::currentBackendPage(['func' => 'sprog'] + $csrf->getUrlParams()).'" data-confirm="'.rex_i18n::msg('wenns_sein_muss_sprog_warning').'">'.rex_i18n::msg('wenns_sein_muss_sprog').'</a></p>';


$fragment = new rex_fragment();
$fragment->setVar('class', 'danger', false);
$fragment->setVar('title', rex_i18n::msg('wenns_sein_muss_sprog'), false);
$fragment->setVar('body', $content, false);
echo $fragment->parse('core/page/section.php');
}

0 comments on commit 5c1e664

Please sign in to comment.