1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do custom phrases work?

Discussion in 'XenForo Development Discussions' started by Jaxel, Nov 2, 2010.

  1. Jaxel

    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?
  2. CurveGotti

    CurveGotti Active Member

    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 :)
  3. Mike

    Mike XenForo Developer Staff Member

    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.
    CurveGotti likes this.
  4. Jeremy

    Jeremy Well-Known Member

    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...
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Or even 8wr_nameofmod_edited_by to be doubly sure :)
  6. Jaxel

    Jaxel Well-Known Member

    Heh... next question... how do we use phrases inside of classes? For instance...

    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'.
  7. Shadab

    Shadab Well-Known Member

    Jeremy likes this.
  8. CyberAP

    CyberAP Well-Known Member

    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.

Share This Page