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.

how to localize vanilla activity for wordpress

how to localize vanilla activity for wordpress

i got like this wordpress widject, how can i change this words like "Joined" "Change his Profile pic"

image

sd.jpg 38.1K

Comments

  • Actually the same way you localise vanilla.

    The vanilla widgets work like this, most vanilla controllers have different ways or rendering their content, but are essentially the same. Widget just pull that data, in a cross domain compatible way.

    This will change in future version because they pay more attention to a grammar of different languages but for 2.0 you have these definitions.

    $Definition['%1$s signed in.'] = '%1$s signed in.';
    $Definition['%1$s joined.'] = '%1$s joined.';
    $Definition['%1$s approved %4$s membership application.'] = '%1$s approved %4$s membership application.';
    $Definition['%1$s created an account for %3$s.'] = '%1$s created an account for %3$s.';
    $Definition['%1$s updated %6$s profile.'] = '%1$s updated %6$s profile.';
    $Definition['%1$s wrote on %4$s %5$s.'] = '%1$s wrote on %4$s %5$s.';
    $Definition['%1$s wrote:'] = '%1$s wrote:';
    $Definition['%1$s changed %6$s profile picture.'] = '%1$s changed %6$s profile picture.';
    $Definition['%1$s changed %4$s permissions.'] = '%1$s changed %4$s permissions.';
    $Definition['%1$s commented on %4$s %8$s.'] = '%1$s commented on %4$s %8$s.';
    $Definition['%1$s imported data.'] = '%1$s imported data.';
    $Definition['%1$s accepted %4$s invitation for membership.'] = '%1$s accepted %4$s invitation for membership.';
    $Definition['%1$s banned %3$'] = '%1$s banned %3$';
    $Definition['%1$s un-banned %3$s.'] = '%1$s un-banned %3$s.';
    $Definition['%1$s applied for membership.'] = '%1$s applied for membership.';
    $Definition['%3$s wrote on %2$s %5$s.'] = '%3$s wrote on %2$s %5$s.';
    $Definition['%3$s wrote:'] = '%3$s wrote:';
    

    You what is in the last quotes of each line. But you must keep the funny characters in there.

    the simplest way is to add them top conf/locale.php. However if you can do it properly:
    http://vanillaforums.org/docs/localization

    One advice is to purge the activity table of old data periodically. This will be address in future versions, but the table can get very large. You will get better performance

    grep is your friend.

  • @Andare
    I´m having the same issue as you :-(

    @x00
    After a whole check on all myfiles at /locales/pt-BR the defiitions seem to be translated but the wordpress widget doesn´t seem to catch them at all.

    BTW> looking at conf/locale.php i´ve only fouded only this line:

    <?php if (!defined('APPLICATION')) exit();

    Thanks

  • peregrineperegrine MVP
    edited November 2012

    @wilsoncortez

    you can add the definitions that x00 provided to the conf/locale.php

    it is a stub that you add defintions to.

    also try searching for messages with locale.php
    e.g.

    http://vanillaforums.org/discussion/comment/170443/#Comment_170443

    there are hundreds more.

    http://vanillaforums.org/docs/localization

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

  • Thank you peregrine

    So i should take this as a general ruler?
    If we don´t find a definition at locale/xx-XX/ or in case of "mal function" putting them on conf/locale.php will do the job?

    And sorry about my lack of php skills but do I need to keep this line:
    <?php if (!defined('APPLICATION')) exit();
    and add my definitions after it? Am I correct?

    Thank you

  • yes.

    but I always keep a backup of conf/locale.php

    and call it conf/x-locale.ph

    because locale.php will get overwritten during upgrades.

    you can find pretty much all definitions you may want to add with locale-developer plugin or download some of the locale add-ons to find defintions.

    try clicking awesome or insightful for x00 and others who help you - that is why they have those things - it give people points - if nothing else. Just a nice forum etiquette.

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

  • because locale.php will get overwritten during upgrades.

    I´ll do it :-) thanks

    you can find pretty much all definitions you may want to add with locale-developer plugin or download some of the locale add-ons to find defintions.

    Regarding the locale add-ons in my case they lead me to some confusion:

    The locales are for Brazilian Portuguese, browsing the add-ons i´ve found two different:

    http://vanillaforums.org/addon/pt_br-locale
    http://vanillaforums.org/addon/vf_pt_br-locale

    regarding the last i´ve made a comment here: http://vanillaforums.org/discussion/21869/why-the-portugal-flag#latest with no replies at all

    Still wondering which one is the "official" pack...

    BTW> i´ve signed to transifex in order to help a bit but according to the status of the Portuguese (Brazil) there are only 3 strings left....

    Weird isn´t it?

Sign In or Register to comment.