[TYPO3-mvc] [SPAM FortiMail] Re: eID and Translations

Stephan Schuler Stephan.Schuler at netlogix.de
Wed Oct 29 18:20:45 CET 2014


Hey there.


I really suggest you to *not* do such hacky things.

As soon as you reach either the translation situation or the fe_user situation, that's usually exactly where you should stop inflating the eID request and start using a proper TYPO3 default endpoint script.
And now you did both: You hit the translation wall and tried to overcome it with sessions, which is part of fe_user.

Kick the eID *now* and use a page type for that.

In a page type you have both, a nicely initialized fe_user, properly loaded TypoScript (which is based on an fe_user) as well as language things. You even have nice URLs if you map your page type somehow and ontop of that you can create your ajax URLs either right inside of a fluid template or with pure TypoScript, but in both situations by using TypoLink.

My bet would be the next thing you're realizing is eID having no default cache. That's an additional thing a page type gives you, coming along with valid cHashes for even ajax urls. There's only one thing you should not do: Adjust GET arguments in JavaScript but use PUT or POST.

If your ajax things are tied to extbase and you're using a namespaced TYPO3 version, then you clearly want to take a look at Helmut Hummels "typo3script_rendering" extension.
http://typo3.helmut-hummel.de/post/90365109335/out-of-bound-typoscript-rendering

Believe me: As soon as you try to start fe_users and language in eID, you're running into some desperate trouble and finally come to only one conclusion: Damn, now the whole thing has grown to a second TYPO3 startup script booting up nearly complete TYPO3 instance, but having a view minor glitches like really poor performance due to some unexplainable race conditions burning the cache.


Regards,
Stephan.



Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de



----------------------------
Citrix Solution Seminar am 27. November 2014
Machen Sie Ihre Infrastruktur mit Citrix Networking-Lösungen fit für die Zukunft. http://it-training.netlogix.de/leistungen-angebote/events/citrix-solution-seminar-2014

netlogix-Sicherheitscheck: mit Sicherheit mehr Sicherheit im Netzwerk!
Gewinnen Sie einen halben Tag mit unserem Sicherheitsexperten. http://www.netlogix.de/sicherheitscheck
----------------------------




netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Chris Wolff - AERTiCKET AG
Gesendet: Mittwoch, 29. Oktober 2014 09:31
An: TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] [SPAM FortiMail] Re: eID and Translations

Hi,
the Language configuration is done in Typoscript Setup therefore you need to initalize the Typoscript setup for a given Page.
But i this would take a lot of time. I would rather send another parameter along the ajax request with the language key

AJAX URL : ?eID=tx_myext&key=my_key_for_translation&lang=de

*** PHP **'
$lang = substr($lang,0,2); // shortening the given language code to 2 chars as this is what typo3 uses.
// make shure wie have a a string that looks like a language code. (eg letters only lowercase) If(!preg_match('^[a-z]{2}$ ',$lang ){die('invalid language'); tslib_eidtools::initLanguage($lang);

*** /php ***

this would eleminate the case statment. And it would be future proof as all typo3 languages are supported.

Now your javascript frontend needs to now which language it runs in.
But this should be easy to get. As you send this information already along in the html tag as lang attribute.

<html lang="de_DE" />

Regards chris


-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von g4-lisz at tonarchiv.ch
Gesendet: Dienstag, 28. Oktober 2014 19:06
An: Gion Koch; TYPO3 v4 MVC project
Betreff: [SPAM FortiMail] Re: [TYPO3-mvc] eID and Translations

On 10/28/2014 05:29 PM, Gion Koch wrote:
> Greetings,
>
>
> Currently I'm stuck with getting a translated message from an Ajax
> Request via eID. Everything works as it should, but not the
> translation part.
> I stumbled already several times over this issue.
> As a workaround I used an ugly hack:
> - including the sys_language_uid as hidden field
> - send it along with every ajax call
> - having a translation key for the default language with the
> sys_language_uid for every language as last part of the key. i.E.
> translation.key.0
>
> I would be eager to know, if there is clean way for handling this issue.
>
>
> Greetings
> Gion
>
Same here... I couldn't find an elegant solution. We get the "lang" from the session:


    $lang = $TSFE->getKey("ses", "lang");
    switch($lang) {
        case 0: tslib_eidtools::initLanguage('de'); break;
        case 1: tslib_eidtools::initLanguage('fr'); break;
        case 2: tslib_eidtools::initLanguage('it'); break;
        default: tslib_eidtools::initLanguage('de');
    }
    $GLOBALS['LANG']->includeLLFile(PATH_site .
'typo3conf/ext/hplusinfo/Resources/Private/Language/locallang.xml');

 $txt_more = $GLOBALS['LANG']->getLL('fe_search.showmore_txt')


Cheers,
Till
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list