HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Here is how to Internationalize the Peregrine LeaderBoard Plugin.

peregrineperegrine MVP
edited March 2013 in Feedback

create a file if it doesn't exist called config/locale.php or just add the definitions to your config/locale.php if it exists.

cut and paste the following in it.

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

$Definition['Points: '] = 'Points: ';
$Definition['Top Leaders'] = 'Top Leaders';

e.g. changing the right hand side of the equation will change the Title of the panel and the Points.

$Definition['Points: '] = 'My Points: ';
$Definition['Top Leaders'] = 'My Top Leaders';

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

Comments

  • Options

    Ey @peregrine , i have 1 question about translations. I think, this not is the best thread but.. I can add $Definition from plugins in locale.php? Is for translated some addons to spanish :=)

    Thanks! :D

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You can add a locale file to the plugins if they don't have one make a folder called locales and put in the plugin folder then put a locale.php in that and add your $Definitions. You can also change or add to the plugin about , 'Has Locale'=TRUE;

  • Options

    @Konquet said:
    Ey peregrine , i have 1 question about translations. I think, this not is the best thread but.. I can add $Definition from plugins in locale.php? Is for translated some addons to spanish :=)

    Thanks! :D

    You can follow the way V does it or you can do it "my way". Whatever works for you.

    Yes - you can have all of your added definitions "Todos los Definitions" read from one file /conf/locale.php. Some people like to do it other ways. This is my preferred way - everything in locale.php. Also locale.php is read last so whatever is in there takes precedence. Much easier that way. but follow the path you want. This is the way I do it and I don't want to debate the different ways of doing it.

    Just make sure to create a backup of the definitions file and call it /conf/x-locale.ph if you want to use the convention I use for backups so backup files don't get intentionally executed.

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

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes - you can have all of your added definitions "Todos los Definitions" read from one file /conf/locale.php. takes precedence

    is there such a thing as customlocale.php ?

    @Konquet here is some php info in espanish for you about setting locale maybe it could help

    http://php.net/manual/es/function.setlocale.php

  • Options
    peregrineperegrine MVP
    edited March 2013

    @vrijvlinder said:

    is there such a thing as customlocale.php ?

    short answer no.

    I think sometimes you may be confused on locales.

    maybe this will help you. also you can mine the source to figure out how things are read, and then the conjecture will diminish.

    http://vanillaforums.org/discussion/comment/170146/#Comment_170146

    this is pretty much needed for dates and times. Otherwise you can put everything in conf/locale.php

    or conf/locale-en-ES.php or whatever.

    I don't know why trying to explain "definitions" is so exasperating for me. Maybe because I found a simple and easy way that works for me and I am trying to shove it down everyone's else's throat. Do what you want, if it doesn't work, then do what I explained and it WILL work.

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

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Ah very interesting thanks for clearing it up , the order it will be overruled by the highest number.
    I forgot to add to my advice up there to call the folder inside the locale folder en-Ca then locale.php . I mean that was missing from the chain not to say it makes it right over what you advice , I see what you mean and it makes total sense to do it that way for sure, mine is just a bunch of unnecessary work ...

  • Options
    KonquetKonquet ✭✭
    edited March 2013

    I cant understand all.. But when im translated some options in my forum, i use this way :

    For example to "Latest Post" to spanish is "Ultimos Mensajes". Well i change this code :

    <?php echo '<a href="'.Url('/', TRUE).$this->_Link.'">'.T('Latest Post').''; ?> 

    to

    <?php echo '<a href="'.Url('/', TRUE).$this->_Link.'">'.T('Ultimos Mensajes').''; ?> 

    In latest Post list module.php , but i think, this not is the best way for publics translations, cause when the plugin is update, i need change again... Only is a good way to change for customs translations.

    So i wanna search 1 mode to translated for public and dont want translated every update addon.

    With $Definition['Latest Post'] = 'Ultimos Mensajes' ; in custom locale.php is correct?

  • Options
    peregrineperegrine MVP
    edited March 2013


    in the conf directory - same directory as your config.php, create the file at the top called locale.php

    claro

    leer este mesaje (you can correct my spelling and V can translate without altering details.

    facil:

    primero message.

    http://vanillaforums.org/discussion/23111/here-is-how-to-internationalize-the-peregrine-leaderboard-plugin

    let the flurry of espanol commence

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

  • Options

    @peregrine , sorry! I read the first message and ask this stupid question lol! Is lated for me and my eyes are closed soon :(

    Well, soon i update again the spanish addon, thanks for u help :=)

  • Options

    You probably had too big a helping of red herrings!

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

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2013

    Si no deje que (arenque rojo) la pista falsa lo muerda en la cola !! Yo también estoy de aprendiz :)

    I think just because I asked if there was a custom locale is not that big a hearring just that Kon sometimes does not read the instructions as they come, selective reading of some type , I don't think it has to do with language barriers :)

  • Options

    LoL @vrijvilinder u wanna cut my head! :( I read the first post sure, but i read in "automatic mode"... cause im so sleeping yesterday night.

    Now i have this song in my head every time :(

    http://www.youtube.com/watch?v=4icPTcQZacE

  • Options

    Images posted sparingly like once every couple of months go a long way :) Image overload help!!! help!!!

    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.