Fork me on GitHub
Current releases are 2.1.3 (9 Sept 2014) and 2.0.18.13 (5 Aug 2014)

Ready for 2.1? Find out if your plugins are compatible. 2.0 will no longer be updated after Dec 2014.

Translateng homepage of dashboard! where is it's files?

Best Answer

Answers

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    I think you can find it in

    plugins\GettingStarted\default.php

    and

    plugins\VanillaStats

    If you have Windows, I would recommend AgentRansack or Grep.

    This allows you to search Vanilla for key words or phrases.

    qwenty
  • I'm using Ubuntu. grep is available on linux, too -> toward learning search options! tnx to @whu606.

  • qwentyqwenty New
    edited May 2012

    :(

    whu606 said: I think you can find it in plugins\GettingStarted\default.php

    I checked the file you mentioned;

    1. Why it's not written as standard format for translating=> T( ) The page: http://YOURDOMAIN/index.php?p=/dashboard/settings has 6 paragraphs and a head-title, but just 4th part is using T( ).

    2. I tried for that 4 parts in this form:

    <?php if (!defined('APPLICATION')) exit();
    $Definition['Organize your Categories'] = 'AAAAA';
    $Definition['Customize your Public Profile'] = 'BBBBB';
    $Definition['Start your First Discussion'] = 'CCCCC';
    $Definition['Manage your Plugins'] = 'DDDDD';
    ?>
    

    Then I saved this codes into a file(gettingstarted.php) and placed in locale pack into /vanilla/locales/translationpack/. But it doesn't work?


    See codes of /plugins/GettingStarted/default.php

                .Anchor('×', '/dashboard/plugin/dismissgettingstarted/'.$Session->TransientKey(), 'Dismiss')
       ."<h1>Here's how to get started:</h1>"
       .'<ul>
          <li class="One'.(C('Plugins.GettingStarted.Dashboard', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor('Welcome to your Dashboard', 'settings').'</strong>
             <p>This is the administrative dashboard for your new community. Check
             out the configuration options to the left: from here you can configure
             how your community works. <b>Only users in the "Administrator" role can
             see this part of your community.</b></p>
          </li>
          <li class="Two'.(C('Plugins.GettingStarted.Discussions', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor("Where is your Community Forum?", '/').'</strong>
             <p>Access your community forum by clicking the "Visit Site" link on the
             top-left of this page, or by '.Anchor('clicking here', '/').'. The
             community forum is what all of your users &amp; customers will see when
             they visit '.Anchor(Gdn::Request()->Url('/', TRUE), Gdn::Request()->Url('/', TRUE)).'.</p>
          </li>
          <li class="Three'.(C('Plugins.GettingStarted.Categories', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor(T('Organize your Categories'), 'vanilla/settings/managecategories').'</strong>
             <p>Discussion categories are used to help your users organize their
             discussions in a way that is meaningful for your community.</p>
          </li>
          <li class="Four'.(C('Plugins.GettingStarted.Profile', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor(T('Customize your Public Profile'), 'profile').'</strong>
             <p>Everyone who signs up for your community gets a public profile page
             where they can upload a picture of themselves, manage their profile
             settings, and track cool things going on in the community. You should
             '.Anchor('customize your profile now', 'profile').'.</p>
          </li>
          <li class="Five'.(C('Plugins.GettingStarted.Discussion', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor(T('Start your First Discussion'), 'post/discussion').'</strong>
             <p>Get the ball rolling in your community by '
             .Anchor('starting your first discussion', 'post/discussion').' now.</p>
          </li>
          <li class="Six'.(C('Plugins.GettingStarted.Plugins', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor(T('Manage your Plugins'), 'settings/plugins').'</strong>
             <p>Change the way your community works with plugins. We\'ve bundled
             popular plugins with the software, and there are more available online.</p>
          </li>
       </ul>
    
  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012

    .

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012
    /GettingStarted/locale/**en-Ca**/definitions.php
    
    try one of these
    /GettingStarted/locale/**translationpack**/definitions.php
    or
    /GettingStarted/definitions.php
    

    also clear your cache when changing locale and definitions

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • qwentyqwenty New
    edited May 2012

    qwenty wrote:

    1. I tried for parts assigned by T( ) into /plugins/GettingStarted/default.php in this form: <?php if (!defined('APPLICATION')) exit(); > $Definition['Organize your Categories'] = 'AAAAA'; > $Definition['Customize your Public Profile'] = 'BBBBB'; > $Definition['Start your First Discussion'] = 'CCCCC'; > $Definition['Manage your Plugins'] = 'DDDDD'; > ?> Then I saved this codes into a file(gettingstarted.php) and placed in locale pack into /vanilla/locales/translationpack/. But it doesn't work?

    peregrine said:

    /GettingStarted/locale/**en-Ca**/definitions.php
    
    try one of these
    /GettingStarted/locale/**translationpack**/definitions.php
    or
    /GettingStarted/definitions.php
    

    Didn't work!

    :'(

    also clear your cache when changing locale and definitions

    It doesn't need! I refresh firefox by Ctrl+F5, which refreshes the page from scratch.

    qwenty 1. Why it's not written as standard format for translating=> T( ) The page: http://YOURDOMAIN/index.php?p=/dashboard/settings has 6 paragraphs and a head-title, but just 4th part is using T( ).

    Bump!

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012

    refresh the server cache by deleting all the .ini files here.

    /vanilla/cache

    if its not already in the local documetation on the wiki and it works for you, maybe you could append it to the wiki documentation, how you solved it. (and please don't ask where the wiki is?, because if you do ... it will drive me to the edge.)

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    UnderDog
  • UnderDogUnderDog Moderator

    peregrine said: because if you do ... it will drive me to the edge.

    And I will stand by that edge with peregrine... holding him back, because we've got some more stuff to solve! :-)

    peregrine
  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    x00 said: The answer is oversight.

    You could even send a pull request to the core. I'm sure they would appreciate it. >

    can you explain what "pull request" means please?

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • qwentyqwenty New
    edited May 2012

    peregrine said: refresh the server cache by deleting all the .ini files here.

    /vanilla/cache

    Great! Worked :) It was because of those damn ".ini" files. Now, I placed the translated file into /locales/translationpack; It's working.

    qwenty Why GettingStarted/default.php is not written as standard format for translating=> T( ); The page: http://YOURDOMAIN/index.php?p=/dashboard/settings has 6 paragraphs and a head-title, but just 4th part is using T( ).

    Answer:

    x00 This plug-in is benign so you can mod it, to use... You can add the value to the standard definition file.

    tnx to @x00

    Solved. I added T( ) manually.

    for Ex: T("<h1>Here's how to get started:</h1>") =>

    $Definition['Here\'s how to get started:'] = 'TRANSLATION PHRASE';
    
  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012

    thx @xoo sounds like a great idea for qwenty to follow through on.... http://help.github.com/send-pull-requests/. .... assuming its not a snatch and run...

    If it was a snake it would have bit you. - adding to wiki????

     <strong>'.Anchor('Welcome to your Dashboard', 'settings').'</strong>
             <p>This is the administrative dashboard for your new community. Check
             out the configuration options to the left: from here you can configure
             how your community works. <b>Only users in the "Administrator" role can
             see this part of your community.</b></p>
          </li>
          <li class="Two'.(C('Plugins.GettingStarted.Discussions', '0') == '1' ? ' Done' : '').'">
             <strong>'.Anchor("Where is your Community Forum?", '/').'</strong>
             <p>Access your community forum by clicking the "Visit Site" link on the
             top-left of this page, or by '.Anchor('clicking here', '/').'. The
             community forum is what all of your users &amp; customers will see when
             they visit '.Anchor(Gdn::Request()->Url('/', TRUE), Gdn::Request()->Url('/', TRUE)).'.</p>
          </li>
    
    
    
    
     <strong>'.Anchor(T('Welcome to your Dashboard'), 'settings').'</strong>
    
    .Anchor(T("Where is your Community Forum?"), '/')
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • x00x00 MVP
    edited May 2012

    You can do

    ....<p>'.T('SomeTextLabel','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ipsum lacus, commodo molestie vehicula quis, mattis a elit. Curabitur nec elit nec ligula tincidunt tempor. Praesent pretium feugiat sem, iaculis mollis quam sodales et. Mauris sit amet nisl mauris. Curabitur eu felis non metus aliquet laoreet. Curabitur blandit ipsum et arcu molestie vulputate. Duis quam tortor, suscipit eu pharetra nec, accumsan elementum lectus. Donec libero nibh, dictum quis tristique quis, tincidunt non velit.').'</p>...
    

    grep is your friend.

  • @whu606 @x00 , @peregrine

    both problems are solved now, Thank you very much.

    It's better that one of you (the stuff) reports modifications via github. If not, I'll do that soon!

  • qwentyqwenty New
    edited May 2012

    How should I translate the below code which is into: models/class.permissionmodel.php?

    T('Permission.'.$JunctionTable, $JunctionTable)
    

    $JunctionTable, $JunctionTable -> ??

    $Definition['Permission.'] = '???';

    What about: T('InviteErrorPermission', T('ErrorPermission'))

  • qwentyqwenty New
    edited May 2012

    T('Permission.'.$JunctionTable, $JunctionTable)

    T('InviteErrorPermission', T('ErrorPermission'))

    these code wrote in the standard form?

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    qwenty said: How should I translate the below code which is into: models/class.permissionmodel.php?

    > T('Permission.'.$JunctionTable, $JunctionTable)
    > 

    $JunctionTable, $JunctionTable -> ??

    $Definition['Permission.'] = '???';

    What about: T('InviteErrorPermission', T('ErrorPermission'))>

    $JunctionTable - probably no need since it refers to database table

    All the other T('something') - you do the same way you've been doing it.

    $Definition['Permission.'] = 'permission-in-the-language-you-are-translating'; $Definition[InviteErrorPermission'] = 'InviteErrorPermission-in-the-language-you-are-translating'; $Definition['ErrorPermission'] = 'ErrorPermission-in-the-language-you-are-translating';

    did you try it and it didn't work

    qwenty said: @whu606 @x00 , @peregrine

    both problems are solved now, Thank you very much.

    It's better that one of you (the stuff) reports modifications via github. If not, I'll do that soon!

    I suspect that means you!

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

  • peregrine said:

    T('Permission.'.$JunctionTable, $JunctionTable)

    $JunctionTable, $JunctionTable -> ??

    $Definition['Permission.'] = '???';

    What about: T('InviteErrorPermission', T('ErrorPermission'))

    $JunctionTable - probably no need since it refers to database table

    So, why "$JunctionTable" comes between T( ) ? Is this the correct form: T('Permission.').$JunctionTable, $JunctionTable

    $Definition[InviteErrorPermission'] = 'InviteErrorPermission-in-the-language-you-are-translating'; $Definition['ErrorPermission'] = 'ErrorPermission-in-the-language-you-are-translating';

    They are nested; doesn't it matter? => T('InviteErrorPermission', T('ErrorPermission')) ??

    did you try it and it didn't work

    Indeed, No! because of "It seems not possible to find all codes into installed Vanilla to check them!" I'm just translating result of grep command and output of locale-developer plugin! I don't know where any code will be appeared!?

    I suspect that means you!

    I didn't get your intention!

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    You could test them by echoing them and see if they get picked up correctly.

    throw it somewhere in one of your pages or create a page in the custompage plugin.

    $JunctionTable = "blah";

    echo T('Permission.'.$JunctionTable, $JunctionTable);

    // I believe what I said above will work - but I am not testing them, just suggesting them. T('InviteErrorPermission', T('ErrorPermission'))

    use the custompage plugin and throw the line in there and see if it works the way you want.

    It's better that one of you (the stuff) reports modifications via github. If not, I'll do that soon!

    I suspect that means you!

    I didn't get your intention!

    I suspect that means you report modifications to github if you want to improve things, because no one is likely to do it for you. a tit-for-tat so to speak

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    qwenty
  • qwentyqwenty New
    edited May 2012

    peregrine said: You could test them by echoing them and see if they get picked up correctly. throw it somewhere in one of your pages or create a page in the custompage plugin.

    I created a php file containing the below code and placed it into: /vanilla/plugins/CustomPages/pages

    <?php
    echo T('Powered by Vanilla');
    ?>
    

    Nothing happened! I'm not familiar with php. Is the above code correct?

    I suspect that means you report modifications to github if you want to improve things, because no one is likely to do it for you. a tit-for-tat so to speak

    Ok, Sure. I'll do.


    Now, I have another odd problem: Add /vanilla/applications/dashboard/design/admin.css to the "design" folder of your current theme. then go to the dashboard. you'll see that images(icons) are (e.g.) disappeared. Why?

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited May 2012

    I never played with Custompages till yesterday.

    Suggestion: Become familiar with php :) .

    This is what I did and it works for me.

    /conf/locale.php

        <?php if (!defined('APPLICATION')) exit();
    
    
        $Definition['Powered by Vanilla']='Test';
    

    /vanilla/plugins/CustomPages/pages/default.php

    <?php if (!defined('APPLICATION')) exit(); ?>
    
    <h1>This is the default page in the "Custom Pages" plugin.</h1>
    <p>You can find this page on your filesystem at:</p>
    <code><?php echo PATH_PLUGINS . DS . 'CustomPages' . DS . 'pages' . DS . 'default.php'; ?></code>
    
    <p>You can copy this file, rename it, and put any content you like in it. You
    will be able to access your page by using it's filename in the url. For example,
    if you copied this file and renamed it "shoes.php", you could access it at:
    <?php echo Url('/plugin/page/shoes', TRUE); ?></p>
    

    //added this <?php echo T('Powered by Vanilla'); ?>

    //rest of file

    test shows up instead of Powered by Vanilla


    Now, I have another odd problem: Add /vanilla/applications/dashboard/design/admin.css to the "design" folder of your current theme. then go to the dashboard. you'll see that images(icons) are (e.g.) disappeared. Why? >

    check you cache, look in firebug to see what css files where loaded, see if images are located where it wants them to be.

    BTW - What is the language you are translating to?

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Sign In or Register to comment.