Skip to content

Commit a83f826

Browse files
authored
[TASK] Drop Event.language (#4271)
1 parent 8b30891 commit a83f826

File tree

8 files changed

+4
-333
lines changed

8 files changed

+4
-333
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
110110

111111
### Removed
112112

113+
- Drop `Event.language` (#4271)
113114
- Drop the event language from the FE list and single view (#4270)
114115
- Drop the country column from the FE list views (#4269)
115116
- Remove the language selector from the selector widget (#4262, #4268)

Classes/BackEnd/TceForms.php

-28
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,6 @@
1515
*/
1616
class TceForms
1717
{
18-
/**
19-
* Creates the values for a language selector in the TCA, using the alpha 2 codes as array keys.
20-
*
21-
* @param array[] $parameters
22-
*/
23-
public function createLanguageSelector(array &$parameters): void
24-
{
25-
$items = [['', '']];
26-
27-
/** @var string[] $language */
28-
foreach (self::findAllLanguages() as $language) {
29-
$items[] = [$language['lg_name_local'], $language['lg_iso_2']];
30-
}
31-
32-
$parameters['items'] = $items;
33-
}
34-
3518
/**
3619
* Creates the values for a country selector in the TCA, using the alpha 2 codes as array keys.
3720
*
@@ -49,17 +32,6 @@ public function createCountrySelector(array &$parameters): void
4932
$parameters['items'] = $items;
5033
}
5134

52-
/**
53-
* @return array<int, array<string, string|int>>
54-
*/
55-
private static function findAllLanguages(): array
56-
{
57-
$table = 'static_languages';
58-
59-
return self::getConnectionForTable($table)
60-
->select(['*'], $table, [], [], ['lg_name_local' => 'ASC'])->fetchAllAssociative();
61-
}
62-
6335
/**
6436
* @return array<int, array<string, string|int>>
6537
*/

Classes/OldModel/LegacyEvent.php

-62
Original file line numberDiff line numberDiff line change
@@ -781,50 +781,6 @@ public function getLanguageKeySuffixForType(string $speakerType): string
781781
return $this->getSpeakerBag($speakerType)->count() > 1 ? $speakerType : ($speakerType . '_single_unknown');
782782
}
783783

784-
public function hasLanguage(): bool
785-
{
786-
return $this->hasRecordPropertyString('language');
787-
}
788-
789-
/**
790-
* Returns the localized name of the language for this event. In the case
791-
* that no language is selected, an empty string will be returned.
792-
*
793-
* @return string the localized name of the language of this event or
794-
* an empty string if no language is set
795-
*/
796-
public function getLanguageName(): string
797-
{
798-
$language = '';
799-
if ($this->hasLanguage()) {
800-
$language = $this->getLanguageNameFromIsoCode(
801-
$this->getRecordPropertyString('language')
802-
);
803-
}
804-
return $language;
805-
}
806-
807-
/**
808-
* Returns the language ISO code for this event. In the case that no
809-
* language is selected, an empty string will be returned.
810-
*
811-
* @return string the ISO code of the language of this event or an empty string if no language is set
812-
*/
813-
public function getLanguage(): string
814-
{
815-
return $this->getRecordPropertyString('language');
816-
}
817-
818-
/**
819-
* Sets the language ISO code for this event.
820-
*
821-
* @param string $language the ISO code of the language for this event to set, may be empty
822-
*/
823-
public function setLanguage(string $language): void
824-
{
825-
$this->setRecordPropertyString('language', $language);
826-
}
827-
828784
/**
829785
* Gets our regular price as a string containing amount and currency. If
830786
* no regular price has been set, this will be "free".
@@ -1175,24 +1131,6 @@ public function getNumberOfPaymentMethods(): int
11751131
return $number;
11761132
}
11771133

1178-
/**
1179-
* Returns the name of the requested language from the static info tables.
1180-
* If no language with this ISO code could not be found in the database,
1181-
* an empty string is returned instead.
1182-
*
1183-
* @param string $isoCode the ISO 639 alpha-2 code of the language
1184-
*
1185-
* @return string the short local name of the language or an empty string if the language could not be found
1186-
*/
1187-
public function getLanguageNameFromIsoCode(string $isoCode): string
1188-
{
1189-
$table = 'static_languages';
1190-
$data = self::getConnectionForTable($table)
1191-
->select(['lg_name_local'], $table, ['lg_iso_2' => $isoCode])->fetchAssociative();
1192-
1193-
return \is_array($data) ? (string)$data['lg_name_local'] : '';
1194-
}
1195-
11961134
/**
11971135
* Returns the type of the record. This is one out of the following values:
11981136
* 0 = single event (and default value of older records)

Configuration/TCA/tx_seminars_seminars.php

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
use OliverKlee\Seminars\BackEnd\TceForms;
43
use OliverKlee\Seminars\Domain\Model\Event\EventDateInterface;
54
use OliverKlee\Seminars\Domain\Model\Event\EventInterface;
65
use OliverKlee\Seminars\Seo\SlugGenerator;
@@ -525,18 +524,6 @@
525524
],
526525
],
527526
],
528-
'language' => [
529-
'exclude' => 1,
530-
'label' => 'LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.language',
531-
'config' => [
532-
'type' => 'select',
533-
'renderType' => 'selectSingle',
534-
'itemsProcFunc' => TceForms::class . '->createLanguageSelector',
535-
'size' => 1,
536-
'minitems' => 0,
537-
'maxitems' => 1,
538-
],
539-
],
540527
'price_regular' => [
541528
'exclude' => 1,
542529
'label' => 'LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.price_regular',
@@ -1038,7 +1025,7 @@
10381025
'types' => [
10391026
EventInterface::TYPE_SINGLE_EVENT => [
10401027
'showitem' =>
1041-
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelGeneral, object_type, title, uid, slug, subtitle, image, categories, teaser, description, event_type, language, accreditation_number, credit_points, details_page, additional_information, checkboxes, uses_terms_2, cancelled, automatic_confirmation_cancelation, notes, ' .
1028+
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelGeneral, object_type, title, uid, slug, subtitle, image, categories, teaser, description, event_type, accreditation_number, credit_points, details_page, additional_information, checkboxes, uses_terms_2, cancelled, automatic_confirmation_cancelation, notes, ' .
10421029
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelPlaceTime, event_format, webinar_url, begin_date, end_date, timeslots, begin_date_registration, deadline_registration, deadline_early_bird, deadline_unregistration, place, room, ' .
10431030
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelSpeakers, speakers, partners, tutors, leaders, ' .
10441031
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelOrganizers, organizers, organizing_partners, event_takes_place_reminder_sent, cancelation_deadline_reminder_sent, ' .
@@ -1058,7 +1045,7 @@
10581045
],
10591046
EventInterface::TYPE_EVENT_DATE => [
10601047
'showitem' =>
1061-
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelGeneral, object_type, title, uid, topic, slug, language, accreditation_number, details_page, cancelled, automatic_confirmation_cancelation, checkboxes, notes, ' .
1048+
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelGeneral, object_type, title, uid, topic, slug, accreditation_number, details_page, cancelled, automatic_confirmation_cancelation, checkboxes, notes, ' .
10621049
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelPlaceTime, event_format, webinar_url, begin_date, end_date, timeslots, begin_date_registration, deadline_registration, deadline_early_bird, deadline_unregistration, expiry, place, room, ' .
10631050
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelSpeakers, speakers, partners, tutors, leaders, ' .
10641051
'--div--;LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_seminars.divLabelOrganizers, organizers, organizing_partners, event_takes_place_reminder_sent, cancelation_deadline_reminder_sent, ' .

Resources/Private/Language/locallang_db.xlf

-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767
<trans-unit id="tx_seminars_seminars.time">
6868
<source>Time</source>
6969
</trans-unit>
70-
<trans-unit id="tx_seminars_seminars.language">
71-
<source>Language</source>
72-
</trans-unit>
7370
<trans-unit id="tx_seminars_seminars.accreditation_number">
7471
<source>Accreditation number</source>
7572
</trans-unit>

0 commit comments

Comments
 (0)