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.

Help with how-to-change wording guide (trying to change 'views' and 'comments' labels)

I've tried a couple of things to change the 'views' and 'comments' labels that appear underneath a discussion title.

My locale's captured.php file already has entries for:

$Definition['%s comment'] = '%s comentário'; $Definition['%s comments'] = '%s comentários';

so the locale file already has this, and follows the suggestion from the how-to

but the labels still appear in english, for example:

90 views 34 comments

The how-to also mentions searching for "Plural(" and indeed I do see

Plural($CountCheckedComments, '%s comment', '%s comments')

so my assumption is the Definitions should work. Maybe the labels displayed underneath a discussion's title uses a different string? All I know is that whatever I put in the locale file isn't getting reflected.

I also tried just for testing

$Definition['%s comment'] = '%s test'; $Definition['%s comments'] = '%s test';

And even tried the below to "get rid of" the count label

$Definition['%s comment'] = ''; $Definition['%s comments'] = '';

but nothing changes, I still see the count and "comments" label

Comments

  • r0obertr0obert
    edited June 2014

    @rmkleemann
    Put this into public_html/conf/locale.php

    $Definition['Views'] = "Whatever";

    $Definition['Comments'] = "Whatever";

  • edited June 2014

    This would be under the root for vanilla?

    for example /public_html/conf/locale.php?

    I tried creating that with no effect.

    I'm also very intrigued why using the standard locale's captured.php doesn't work.

    This is mainly because what I see on my page is this for example:

    90 views 34 comments Mais recente por Rodrigo_Medina

    what that means is that the "More recent by" was correctly replaced, but certainly not the "views" or "comments".

    So in my locale's captured.php I have:

    $Definition['Most recent by %1$s'] = 'Mais recente por %1$s';

    which works.

    And I have also:

    $Definition['%s comment'] = '%s test'; $Definition['%s comments'] = '%s test'; $Definition['%s view'] = '%s test'; $Definition['%s views'] = '%s test';

    which don't work. Somehow one translation is picked up but not the others. It must be that something else is overriding? I did try your suggestion of the public_html/conf/locale.php as well

  • peregrineperegrine MVP
    edited June 2014

    almost every answer to your questions is here.

    http://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale

    see:

    http://vanillaforums.org/discussion/comment/209158/#Comment_209158

    how come you don't download the spanish transifex.

    apparently no one ever updated many of the transifexes to update things and no user offered to add the needed definitions.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I must be missing something or not reading it properly or just not understanding. It is this how-to which I mentioned and I tried to follow.

    Here's what I've done:

    1. deleted /cache/locale_map.ini
    2. created a /conf/locale.php
    3. made entries in /conf/locale.php and also have the same entries in /locales/pt_BR/captured.php
    4. I know that /conf/locale.php works because I am able to make $Definition changes in it and they take effect
    5. For example, I am able to modify /conf/locale.php to change $Definition['Most recent by %1$s'] and the change works
    6. On the same note, if I modify /conf/locale.php to attempt a change to $Definition['%s comments'] it unfortunately does not work
    7. I attempted also making the suggested change in /conf/locale.php, setting $Definition['Comments'] = "Whatever"; - but this did not effect any change to the "comments" label
    8. Just in case I also added $Definition['comments'] = "Whatever"; (assuming we have case-sensitive substitution)
    9. I deleted the locale_map.ini again just in case
    10. As an additional test of the /conf/locale.php I added another Definition string, this time to modify "Start a New Discussion", and yes that works
    11. I have double checked the file precedence. The conf/locale.php is last in the chain since there are no other locale files under conf
    12. I am still not able to change the labels for "comments" and "views", however other strings work.

    Here is the conf/locale.php - it works for the strings with the exception of "comments" and "views"

    <?php if (!defined('APPLICATION')) exit(); $Definition['%s view'] = '%s leitura'; $Definition['%s views'] = '%s leituras'; $Definition['%s comment'] = '%s post'; $Definition['%s comments'] = '%s posts'; $Definition['Most recent by %1$s'] = 'Mais recente por %1$s'; $Definition['Comments'] = "Whatever"; $Definition['comments'] = "Whatever"; $Definition['views'] = "Whatever"; $Definition['Start a New Discussion'] = 'Iniciar Post';

    There must be something simple and dumb that I'm missing in that how-to, I'm trying to figure out what, since certainly the locale.php is being read and working for the other strings.

  • r0obertr0obert
    edited June 2014

    @rmkleemann try using 'Whatever' instead of "Whatever".

    $Definition['Comments'] = 'Whatever';

    Just saying. :)

  • peregrineperegrine MVP
    edited June 2014

    @r0obert said:
    rmkleemann try using 'Whatever' instead of "Whatever".

    $Definition['Comments'] = 'Whatever';

    Just saying. :)

    single or double quotes doesn't make a difference in this context

    @rmkleemann

    post a screenshot of exactly what you want to change with it circled in red

    so I can see exactly what "label" you are referring to in context.

    and use the default theme to test.

    if you are using a different theme - what theme are you using.>

    and what version of vanilla are you using?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited June 2014

    vanilla 2.1 bittersweet theme - table view.

    $Definition['Replies'] = "myReplies";

    $Definition['Views'] = "mtViews";

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I'm using the latest Vanilla 2.1 downloaded last week.

    I'm using the default Vanilla theme but with a customized css

    The locale is set to pt_BR

    The screenshot is from within one of the categories

    I've circled where it shows one label "Mais recente por" is translated but the "views" and "comments" aren't.

  • peregrineperegrine MVP
    edited June 2014

    try the suggestion in the tutorial, one of the later comments.

    thought that was mentioned several places. it is in the tutorial as well.

    http://vanillaforums.org/discussion/comment/209158/#Comment_209158

    if you still don't see it in the tutorial. which it is!

    here is an example.

    http://vanillaforums.org/discussion/comment/209158/#Comment_209158

    if you have trouble with 
    
    $Definition['%s view'] = '%s leitura';
    $Definition['%s views'] = '%s leituras';
    $Definition['%s comment'] = '%s post';
    $Definition['%s comments'] = '%s posts';
    
    
    
    Comment and View headings vs comment and view count.
    
        $Definition['%s view html'] = '%s leitura '; // view count
        $Definition['%s views html'] = '%s leitura';
        $Definition['%s comment html'] = '%s posts';  //comment counts
        $Definition['%s comments html'] = '%s posts';
        $Definition['Views'] = "mylittleviews"; //view heading
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Up until yesterday sometime, this tutorial which I had been following:

    http://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale

    this did not have your very helpful suggestion above (about adding 'html' to the $Definitions). Yesterday I was referencing the tutorial and given that I didn't refresh it to get the latest postings (frankly, it didn't even cross my mind to have to refresh it), I never saw this particular suggestion in the later comments.

    So I appreciate your help, once again... but since I was looking at the tutorial prior to the "later comments" being posted there was no way that I could follow that suggestion.

  • peregrineperegrine MVP
    edited June 2014

    I found one of the 5 or six places I posted the same thing in the forum as well as github.

    e.g within the discussion in the announcement message in the top of this forum

    http://vanillaforums.org/discussion/26685/vanilla-2-1-stable-released/p1

    specifically comment:
    http://vanillaforums.org/discussion/comment/207060/#Comment_207060

    Granted, its hard finding things but it does pay to read the comments in the discussions that are announcements on this forum or messages to help people. You would have found your answer sooner.

    Just as it is a good idea to peruse all the comments relating to an add-on before even installing or enabling an add-on. more work - yes, safer -yes, less time-consuming in the long run - yes.

    also here:

    http://vanillaforums.org/discussion/24272/views-comments-date-not-translating
    http://vanillaforums.org/discussion/24297/for-2-1b1-views-comments-not-translating-check-here
    http://vanillaforums.org/discussion/comment/187835/#Comment_187835

    in the mean time you could update the transifex for your language and it would help future people.
    http://vanillaforums.org/discussion/20639/attention-translators-you-can-now-help-translate-vanilla-online

    http://vanillaforums.org/discussion/comment/187853/#Comment_187853

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.