derhansen / sf_event_mgt_extend_demo

A TYPO3 CMS demo extension which shows, how to extend existing tables in sf_event_mgt
Other
3 stars 1 forks source link

Translation not working #12

Closed blackbasket closed 4 years ago

blackbasket commented 4 years ago

I am unable to see any label for my new fields from extend-demo...

i.e. not working: `

                  <e:registration.isRequiredField settings="{settings}" fieldname="hotelRoomNeeded">
                    <span class="event-required">*</span>
                  </e:registration.isRequiredField><br>
                <f:render partial="FormErrors" arguments="{field: 'registration.hotelRoomNeeded'}"/>`

I cannot see the english label as well as the german label translated with the translate_locallang extension.

derhansen commented 4 years ago

When you use <f:translate> in views of the "main" extension, the scope is always within sf_event_mgt. So all localizations are looked up in the translation files of that extension.

So when you extend the extension as shown in this demo extension, you can either add your own/new language labels to the translation files of sf_event_mgt (either by TypoScript or as shown in the FAQ in the documentation of sf_event_mgt) or add them in the extending extension and ensure you set the extensionName in <f:translate> properly as shown below:

<f:translate key="tx_sfeventmgtextenddemo_domain_model_registration.hotel_room_needed" extensionName="sf_event_mgt_extend_demo" />
blackbasket commented 4 years ago

Thank you, it is working now :)