bihor / fp_newsletter

TYPO3 plugin for newsletter subscription and unsubscription. Used table: tt_address. A log is written.
https://extensions.typo3.org/extension/fp_newsletter/
GNU General Public License v3.0
7 stars 18 forks source link

[BUGFIX] Move Gender in Translation Files #64

Closed linawolf closed 1 year ago

linawolf commented 2 years ago

resolves https://github.com/bihor/fp_newsletter/issues/63

sonarcloud[bot] commented 2 years ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 54 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

bihor commented 2 years ago

Well, I don´t want to remove an old feature. I have added a new setting: settings.preferXlfFile The gender will then come from an function:

    public function getGenders(bool $useXlf, array $settings, bool $please = true): array
    {
        if ($useXlf) {
            $pleaseText = ($please) ? LocalizationUtility::translate('tx_fpnewsletter_domain_model_log.gender.please', 'fp_newsletter') : '';
            return [
                "0" => $pleaseText,
                "1" => LocalizationUtility::translate('tx_fpnewsletter_domain_model_log.gender.mrs', 'fp_newsletter'),
                "2" => LocalizationUtility::translate('tx_fpnewsletter_domain_model_log.gender.mr', 'fp_newsletter'),
                "3" => LocalizationUtility::translate('tx_fpnewsletter_domain_model_log.gender.divers', 'fp_newsletter')
            ];
        } else {
            $pleaseText = ($please) ? $settings['please'] : '';
            return [
                "0" => $pleaseText,
                "1" => $settings['mrs'],
                "2" => $settings['mr'],
                "3" => $settings['divers'],
            ];
        }
    }

This will be added to version 3.3.0 or 4.0.0.

bihor commented 1 year ago

Version 4.0.0 with the above changes is now online. Please test it.