How do custom phrases work?

Jaxel

Well-known member
Lets say I make a custom phrase called "edited_by"... then another mod comes along and makes a custom phrase with the same name.

How does the system know which edited_by to use?
 
I'd have to assume when you make the phrase and associate it with the addon that the system is smart enough to determine which is right... but that's an assumption. Good question :-)
 
One overwrites the other. That's why it's important for the phrase name to reflect the text of the phrase. If it happens, it's unlikely to be significant as it would be expected that the text would be the same/very similar.
 
Lets say I make a custom phrase called "edited_by"... then another mod comes along and makes a custom phrase with the same name.

How does the system know which edited_by to use?

That's why you use 8wr_edited_by, just to be sure... :)

On a side note, I wonder why I was redirected to an individual reply page instead of the quick reply...
 
Heh... next question... how do we use phrases inside of classes? For instance...

Code:
<?php

class EWRcarta_Listeners_Wiki
{
	public static function navtabs(array &$extraTabs, $selectedTabId)
	{
		$permsModel = new EWRcarta_Model_Perms();
		$perms = $permsModel->getPermissions();

		$indexModel = new EWRcarta_Model_Lists();
		$index = $indexModel->getIndex();

		$extraTabs['wiki'] = array(
			'title' => 'Wiki',
			'href' => XenForo_Link::buildPublicLink('full:wiki'),
			'selected' => ($selectedTabId == 'wiki'),
			'linksTemplate' => 'EWRcarta_Navtabs',
			'perms' => $perms,
			'index' => $index,
		);
	}
}

I want to repalce 'title' => 'Wiki' to the phrase 'wiki'.
 
One overwrites the other. That's why it's important for the phrase name to reflect the text of the phrase. If it happens, it's unlikely to be significant as it would be expected that the text would be the same/very similar.
But what should we do if for example one phrase can have different translations in one language depending on it's place?
At the moment you have such a phrase. It's called 'Show All'. It's used in the Alerts list and in profile page in the followers block. So in Russian language when you are talking about several people at once you can say 'Show all' like 'Показать всех', but when you are talking about an inanimate thing the phrase will look like 'Показать все'. I don't really know but there should be a topic for such phrases/bugs.
 
Top Bottom