Jump to content


Issue information

  • #035789

  • Fixed

  • 3.3.0 Beta 1

  • 3.3.0 Beta 1

  • 0 - None Assigned


Issue Confirmations

  • Yes (1)No (0)
Photo

Hook doesn't parse language file

Posted by Adriano Faria on 09 February 2012 - 06:09 AM

3.3.0 Alpha relesead yesterday.

My construct function:

	public function __construct()
	{
		$this->registry   =  ipsRegistry::instance();
		$this->memberData =& $this->registry->member()->fetchMemberData();
		$this->settings   =& $this->registry->fetchSettings();
		$this->DB		 =  $this->registry->DB();
		$this->lang		  =  $this->registry->getClass('class_localization');
		$this->cache	  =& $this->registry->cache()->fetchCaches();
		$this->request	=& $this->registry->fetchRequest();
		
		$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
	}

Example, in some part of getOutput function:

$text = $this->lang->words['my_language_bit'].' '.$times;

Template:

{$text}

or even:

{$this->lang->words['my_language_bit']} {$times}

Prints only my variable ($times); no text from language file.

changed status to: Not a Bug
changed status to: Awaiting Feedback

Try:

	public function __construct()
	{
		$this->registry   =  ipsRegistry::instance();
		$this->memberData =& $this->registry->member()->fetchMemberData();
		$this->settings   =& $this->registry->fetchSettings();
		$this->DB				=  $this->registry->DB();
		$this->lang		  =  $this->registry->getClass('class_localization');
		$this->cache	  =& $this->registry->cache()->fetchCaches();
		$this->request	=& $this->registry->fetchRequest();

		$this->lang->loadLanguageFile( array( 'public_topic' ), 'forums' );
	}


Nope, the same. See the imagem:

Posted Image

Should have a text between brackets and the hint printed only data.


simply confirming... doesn't matter which hook... none are working lang-wise.
lang issue.png


changed status to: Unconfirmed

changed status to: Cannot Reproduce

Can you provide the hook? All of ours are working fine.


http://community.inv...on-board-index/
frontend one...
http://community.inv...nt-fields-pack/
backend.
.... maybe yours all work because they are not added via the hook import, but are application-spec langs at install?


eg... for sanities sake... add a language string to a pack native... then try to use it within that application... whether you manually load the language pack or not.. it does not show the string.


View PostMarcher Technologies, on 14 February 2012 - 06:49 AM, said:

eg... for sanities sake... add a language string to a pack native... then try to use it within that application... whether you manually load the language pack or not.. it does not show the string.
through the ACP manage languages of course ^^.


http://community.inv...-ignore-topics/

That one adds 2 bits to forums_public_topic. They didn't appear on topic view.


changed status to: Unconfirmed

FYI: issue remains on Alpah Phase II.


changed status to: Cannot Reproduce

Posted Image

Your hook installed fine and the language bits show for me... you haven't accidentally left the software in developer's mode, have you?


I can't reproduce either and we haven't changed anything on how hooks load languages so I'm quite lost there.


No, it is not in DEV mode and it is happening in any hook I try.. same happens to Marcher.


View PostAdriano Faria, on 15 February 2012 - 12:08 PM, said:

No, it is not in DEV mode and it is happening in any hook I try.. same happens to Marcher.
nods.
what ive found is this.. the language string is inserted(DEV mode off all the way) into the desired language pack.
but it is not actually a part of the ipsRegistry::getClass('class_localization')->words array either front-end or back.
eg,
$this->lang->words['my_key']
is not present within $words of class_localization.


clear as one can possibly make it.
this is in the acp of content.
vid ^^
the lang pack is present already is the confusing bit... and no, I am not IN_DEV.
http://screencast.com/t/ui16qirHEED


eg, the report is mislabeled.
Hook parses language file just fine. :rofl:
Hook adding language string has issues, lang string is in the desired lang pack, but it is not in the compiled ipsRegistry::class_localization->words array for that pack. :logik:


changed status to: Unconfirmed

and here's the rub... I'm not finding a way for it to add the string.... 0-o whats changed regarding added strings being parsed?
http://screencast.com/t/KkjxQjizvfJh


if it helps any.... not even calling
ipsRegistry::getClass('class_localization')->rebuildLanguagesCache();
in the code before printing out the words resolves it.... this ones eerie. :baby:


nor does
ipsRegistry::getClass('class_localization')->load_from_db = true;
..... so, class_localization seems to have been changed... as no trick one can pull will allow that string to parse, even though it is in the lang packs.
it is not in the application xml files. :rofl:







0 user(s) are reading this issue

0 members, 0 guests, 0 anonymous users