dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxLanguageVariants_test.php File Reference

Go to the source code of this file.

Variables

 $moduleRoot = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'modules'
 Strukturtest für übersetzbare dbxApp-Templates und Sprach-DDs.
 $errors = array()
 $candidates = array()
 $extensions = array('htm', 'html', 'tpl', 'txt', 'svg')
 $germanPattern
 $iterator
foreach($iterator as $file) $extract
 $markerPattern
 $placeholderPattern
 $tagPattern = '/<\/?\s*([A-Za-z][A-Za-z0-9:-]*)\b/'
 $urlPattern = '/\b(?:href|src|action)\s*=\s*([\'"])(.*?)\1/is'
 $moduleBlockPattern = '/(\‍[(modul)\b[^\‍]]*\‍])(.*?)(\‍[\/\2\‍])/is'
 $normalizedModuleBlocks
 $checked = 0
foreach($candidates as $candidate) $languageDdCount = 0
foreach( $iterator=new RecursiveIteratorIterator(new RecursiveDirectoryIterator( $moduleRoot, FilesystemIterator::SKIP_DOTS)) as $file) if($checked===0) if( $languageDdCount===0) if ( $errors)

Variable Documentation

◆ $candidates

$candidates = array()

Definition at line 13 of file dbxLanguageVariants_test.php.

Referenced by dbxBrowser\get_ip().

◆ $checked

$checked = 0

Definition at line 86 of file dbxLanguageVariants_test.php.

◆ $errors

$errors = array()

Definition at line 12 of file dbxLanguageVariants_test.php.

◆ $extensions

$extensions = array('htm', 'html', 'tpl', 'txt', 'svg')

◆ $extract

foreach ( $iterator as $file) $extract
Initial value:
= static function (string $pattern, string $content, int $group = 0): array {
preg_match_all($pattern, $content, $matches);
return $matches[$group] ?? array();
}

Definition at line 62 of file dbxLanguageVariants_test.php.

◆ $germanPattern

$germanPattern
Initial value:
= '/[äöüÄÖÜß]'
. '|(?:benutzer|registrier|speicher|lösch|loesch|bearbeit|beschreib|'
. 'bezeichn|einstell|erstell|aktualis|auswähl|auswaehl|datei|deutsch|'
. 'daten|druck|ausdruck|eintrag|erfolg|fehlermeld|formular|hinweis|'
. 'kontaktanfrag|kontaktdaten|userdaten|zugangsdaten|hinzufüg|'
. 'hinzufueg|einfueg|öffnen|oeffnen|workflow\s+abgeschlossen)'
. '|\b(?:aber|abbrechen|alle|anzeigen|artikel|auswahl|bearbeiten|'
. 'beschreibung|bitte|der|die|ein|eine|einstellungen|fehler|felder|'
. 'für|fuer|gruppe|hilfe|ihre|inhalt|kein|keine|keiner|löschen|'
. 'loeschen|menü|menue|neu|neue|neuer|neues|nicht|oder|ordner|seite|'
. 'seiten|speichern|suche|suchen|titel|über|ueber|und|wählen|waehlen|'
. 'weiter|wird|zurück|zurueck)\b/iu'

Definition at line 15 of file dbxLanguageVariants_test.php.

◆ $iterator

$iterator
Initial value:
= new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($moduleRoot, FilesystemIterator::SKIP_DOTS)
)

Definition at line 27 of file dbxLanguageVariants_test.php.

◆ $languageDdCount

foreach ( $candidates as $candidate) $languageDdCount = 0

Definition at line 131 of file dbxLanguageVariants_test.php.

◆ $markerPattern

$markerPattern
Initial value:
= '/\‍[(?:\/?(?:modul|inc)\b[^\‍]]*|tpl[^\‍]]*|'
. '(?:dbx|rpt|cms):[^\‍]]+)\‍]/i'

Definition at line 66 of file dbxLanguageVariants_test.php.

◆ $moduleBlockPattern

$moduleBlockPattern = '/(\‍[(modul)\b[^\‍]]*\‍])(.*?)(\‍[\/\2\‍])/is'

Definition at line 72 of file dbxLanguageVariants_test.php.

◆ $moduleRoot

$moduleRoot = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'modules'

Strukturtest für übersetzbare dbxApp-Templates und Sprach-DDs.

Sichtbarer Text darf sich zwischen den Sprachen ändern. Technische Template-/Modulmarker, Platzhalter, HTML-Tagfolge und URL-Attribute müssen dagegen identisch bleiben.

Definition at line 11 of file dbxLanguageVariants_test.php.

◆ $normalizedModuleBlocks

$normalizedModuleBlocks
Initial value:
= static function (string $content) use ($moduleBlockPattern): array {
preg_match_all($moduleBlockPattern, $content, $matches, PREG_SET_ORDER);
$blocks = array();
foreach ($matches as $match) {
$body = preg_replace(
'/((?:^|&)label=)[^&]*/i',
'$1{translated-label}',
$match[3]
);
$blocks[] = $match[1] . $body . $match[4];
}
return $blocks;
}

Definition at line 73 of file dbxLanguageVariants_test.php.

◆ $placeholderPattern

$placeholderPattern
Initial value:
= '/\{\{[A-Za-z_][A-Za-z0-9_]*\}[A-Za-z0-9_]*'
. '|\{(?:[A-Za-z_][A-Za-z0-9_.:-]*|\$ref:[^{}]+)\}/'

Definition at line 68 of file dbxLanguageVariants_test.php.

◆ $tagPattern

$tagPattern = '/<\/?\s*([A-Za-z][A-Za-z0-9:-]*)\b/'

Definition at line 70 of file dbxLanguageVariants_test.php.

◆ $urlPattern

$urlPattern = '/\b(?:href|src|action)\s*=\s*([\'"])(.*?)\1/is'

Definition at line 71 of file dbxLanguageVariants_test.php.

◆ if

foreach($iterator=new RecursiveIteratorIterator(new RecursiveDirectoryIterator($moduleRoot, FilesystemIterator::SKIP_DOTS)) as $file) if( $checked===0) if($languageDdCount===0) if($errors) ( $errors)

Definition at line 164 of file dbxLanguageVariants_test.php.