LaCollision Posted February 10, 2015 Posted February 10, 2015 Hi there, I'm packaging the IPS app in a regular news website. I've managed to get the Member logged info with: \IPS\Dispatcher\Front::i(); $member = \IPS\Member::loggedIn(); Now, on my website homepage, I'm calling some IPS templates, like the user menu bar: echo \IPS\Theme::i()->getTemplate('global', 'core', 'front')->userBar(); Everything works fine, except the fact I don't manage to get the words translations. For each word I want to display, I'm using : echo \IPS\Member::loggedIn()->language()->addToStack('my_word_id'); But instead of the words, I only get their key, like, for instance, 959aaed7297a15e5aaaaf4f13d7d1a26. => How can I initialize the language words outside the IPS framework ? I thought it was done with: \IPS\Member::loggedIn()->language() … but apparently not. Thanks for your help
LaCollision Posted February 10, 2015 Author Posted February 10, 2015 Oh my god, I just saw the output is globally translated with that method: \IPS\Member::loggedIn()->language()->parseOutputForDisplay( &$output ) So, for EACH word I want to translate outside the IPS framework, do I need to use that: $myWord = \IPS\Member::loggedIn()->language()->addToStack('my_word_key'); \IPS\Member::loggedIn()->language()->parseOutputForDisplay($myWord); echo $myWord; … ? That looks super heavy Can I call this code for each word of my page? Isn't it too heavy for the server, as I may have dozens or hundreds of words in each page? I must say I'm confused Thanks for your help!
LaCollision Posted February 10, 2015 Author Posted February 10, 2015 Moreover, the parseOutputForDisplay() method seems to make a Database call each time!It looks like I can't call that method several time in my page…
Recommended Posts
Archived
This topic is now archived and is closed to further replies.