Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthortamboo
     
    Hello!
    Thank you for a great framework.

    I want to make the locale file that can be shared.
    How do you make it?
    • CommentAuthorKaste
     

    If understand your question right, this should lead you in the right way.

    In a view we have the text_helper for that:

    <?php echo $text_helper->translate(string,array_of_variables_to_bind,scope); ?>
    
    <?php echo $text_helper->translate(
                            'This is %what',
                            array('%what'=>'super'),
                            'global_shared'
    ); ?>
    

    This will create the folder "global_shared" under app/locales

    Unfortunately you can't use Sintags for this, right now.

    • CommentAuthorKaste
     

    the translate has an alias: t().

    if you don't define a scope, it usually guesses one (the controller name or the model name).

    • CommentAuthorKaste
     

    Unfortunately you can't use Sintags for this

    I was wrong. I first tried

    <%= translate 'Take me %where', :where=>"home", "scope" %>
    

    which leads to translate('Take me %where',array('where'=>'home','scope')), which is wrong, because 'scope' should be our third argument.

    So we have to be more specific.

    <%= translate 'Take me %where', {"%where"=>"home"}, "scope" %>
    

    is correct and works as expected.

    • CommentAuthortamboo
     
    That explains it.

    Thanks, Kaste.