Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How do I change the label names

edited August 2010 in Vanilla 2.0 - 2.8
I would like to change the button "Start a new discussion" to "Ask a Question". There are other labels I need to change to. Where are these?

Comments

  • Options
    JeffDunneJeffDunne New
    edited August 2010
    The description is set in the applications\vanilla\views\modules\newdiscussion.php file.

    Best not to change it there though as you'll overwrite it whenever you update the base software, better to create a new theme and make the changes there.

    To create a new theme:

    1. copy the "default" sub-directory in the theme directory and rename it.
    2. edit the about.php file in the directory created, changing the 'default' values to match your folder name
    3. Either edit the conf\config.php file and change the $Configuration['Garden']['Theme'] to equal your new theme name, or switch to this theme using the dashboard.
    4. create a sub-directory in your theme folder (created in 1) called "views"
    5. Copy the "applications\vanilla\views\modules" directory to the views directory created in 3.
    6. Edit the newly created newdiscussion.php file in this directory.

  • Options
    An easier solution is to simply change the names in the /vanilla/applications/vanilla/locale/en-CA/definitions.php file. Navigate to this file and add this code. I also included other changeable values as well.

    <?php if (!defined('APPLICATION')) exit(); /* Change "Bookmarks" to be "Follows", and other fun translation changes. */ // Discussion / Question $Definition['Start a New Discussion'] = 'Ask a Question'; $Definition['Discussions'] = 'Tickets'; $Definition['All Discussions'] = 'All Tickets'; $Definition['My Discussions'] = 'My Tickets'; $Definition['Delete Discussion'] = 'Delete Ticket'; $Definition['No discussions were found.'] = 'No Tickets were found.'; $Definition['Discussion Title'] = 'Ticket Title'; $Definition['In this Discussion'] = 'In this Ticket'; $Definition['Categories'] = 'Tickets'; $Definition['Follows'] = 'To Do'; $Definition['Closed'] = 'Resolved'; $Definition['Close'] = 'Mark as Resolved'; $Definition['Announce'] = 'Make Sticky'; $Definition['Announcement'] = 'New Ticket Alert'; $Definition['Unannounce'] = 'Remove Sticky'; $Definition['Post Discussion'] = 'Post Issue'; $Definition['%1$s started a %8$s.'] = '%1$s asked a %8$s.'; $Definition['%1$s commented on %4$s %8$s.'] = '%1$s commented on %4$s %8$s.'; $Definition['discussion'] = 'Issue'; // Bookmark / Follow $Definition['Bookmarked Discussions'] = 'My To Do List'; $Definition['My Bookmarks'] = 'To Do List'; // Comment / Answer $Definition['Write Comment'] = 'Write Comment'; $Definition['Post Comment'] = 'Post Comment'; $Definition['%1$s more comments'] = '%s more'; $Definition['%1$s older comments'] = '%1$s older'; $Definition['Comment'] = 'Thread'; $Definition['Comments'] = 'Threads';

    hope this helps, this way your not actually altering the view file.
  • Options
    TimTim Operations Vanilla Staff
    Nice work @jbrown :)

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Options
    Can I ask, what is wrong with altering the view? Isn't that the point of having views & themes?

    No doubt translating the default view works and is a simple solution. However the reason I use vanilla is that it acts as the engine. If you're stylizing the front end then it would make sense to me to simply change the view.

    Not saying your solution is wrong jbrown, just thought the last comment strange considering I thought that was the whole point in using Vanilla over other forum software.
  • Options
    jbrown you are awesome. That did the trick. Thanks for all the responses.
  • Options
    TimTim Operations Vanilla Staff
    @JeffDunne You're right that Vanilla is very extensible and we try hard to make it easy to customize. The decision you face here is whether to modify core files, or to use an already-existing system to make your changes without branching the code for no reason. If you use our translation system, your vanilla remains 'virgin', thereby allowing you to update your software with ease.

    When faced with this kind of choice, I would always pick the least invasive approach.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Options
    MarkMark Vanilla Staff
    edited February 2011
    Here's a blog post about how to implement text changes:

    http://vanillaforums.com/blog/developers/howdy-stranger/
  • Options
    @Mark, the link to the Howdy Stranger blog isn't working. Any reason why it's gone?
  • Options
    Maybe blog categories changed at between August and December.
    See Edit Right Panel - Vanilla Forums.

    http://vanillaforums.com/blog/developers/howdy-stranger/

  • Options
    LincLinc Detroit Admin
    I edited Mark's link above as well. I believe it did indeed change during a site restructure. Thanks, @yu_tang
  • Options

    @jbbrown, @Lincoln, @vincent2 .... I did changed the labels through the method given by jbrown. But when I post a question and no comment has been given, still then it shows '1 comment' below the post's link on the home page. Can anyone tell me what is the problem with it and how to rectify it ?

Sign In or Register to comment.