Development

Changeset 8996

You must first sign up to be able to contribute.

Changeset 8996

Show
Ignore:
Timestamp:
05/16/08 09:56:25 (4 months ago)
Author:
FabianLange
Message:

sfSimpleForum has been updated to search I18N in sfSimpleForum.XX.xml files. When upgrading with existing translations, the messages.xx.xml has to be renamed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfSimpleForumPlugin/trunk/README

    r7653 r8996  
    219219}}} 
    220220 
     221=== I18N === 
     222 
     223You can write own translations for this plugin by providing an `sfSimpleForum.XX.xml` file, whereas xx is the locale. 
     224If you are upgrading from version 0.6.5 or earlier and created a `messages.xx.xml` file for your translation, you need to rename it. 
     225 
    221226== TODO == 
    222227 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_add_post_form.php

    r5356 r8996  
    88     
    99    <?php echo form_error('title') ?> 
    10     <?php echo label_for('title', __('Title')) ?> 
     10    <?php echo label_for('title', __('Title', null, 'sfSimpleForum')) ?> 
    1111    <?php echo input_tag('title', '', 'id=topic_title') ?> 
    1212    <?php if (isset($forum)): ?> 
    1313      <?php echo input_hidden_tag('forum_name', $forum->getStrippedName()) ?> 
    1414    <?php else: ?> 
    15       <?php echo label_for('forum', __('Forum')) ?> 
     15      <?php echo label_for('forum', __('Forum', null, 'sfSimpleForum')) ?> 
    1616      <?php echo select_tag('forum_name', options_for_select(sfSimpleForumForumPeer::getAllAsArray())) ?> 
    1717    <?php endif; ?> 
     
    2020   
    2121  <?php echo form_error('body') ?> 
    22   <?php echo label_for('body', __('Body')) ?> 
     22  <?php echo label_for('body', __('Body', null, 'sfSimpleForum')) ?> 
    2323  <?php echo textarea_tag('body', '', 'id=topic_body') ?> 
    2424   
     
    2626    <div class="option"> 
    2727      <?php echo checkbox_tag('is_sticked', '1')?> 
    28       <?php echo label_for('is_sticked', __('Sticked topic')) ?> 
     28      <?php echo label_for('is_sticked', __('Sticked topic', null, 'sfSimpleForum')) ?> 
    2929    </div> 
    3030    <div class="option"> 
    3131      <?php echo checkbox_tag('is_locked', '1')?> 
    32       <?php echo label_for('is_locked', __('Locked topic')) ?> 
     32      <?php echo label_for('is_locked', __('Locked topic', null, 'sfSimpleForum')) ?> 
    3333    </div> 
    3434  <?php endif; ?> 
    3535   
    36   <?php echo submit_tag(__('Post'), 'id=topic_submit') ?> 
     36  <?php echo submit_tag(__('Post', null, 'sfSimpleForum'), 'id=topic_submit') ?> 
    3737   
    3838</form> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_author.php

    r6132 r8996  
    44<?php echo link_to(get_partial('sfSimpleForum/author_name', array('author' => $author, 'sf_cache_key' => $author_name)), 'sfSimpleForum/userLatestPosts?username='.$author_name) ?><br/> 
    55<?php if ($author->hasPermission('moderator')): ?> 
    6   <?php echo __('Moderator') ?><br/> 
     6  <?php echo __('Moderator', null, 'sfSimpleForum') ?><br/> 
    77<?php endif ?> 
    8 <?php echo format_number_choice('[1]1 message|(1,+Inf] %1% messages', array('%1%' => $nb_posts), $nb_posts) ?><br /> 
     8<?php echo format_number_choice('[1]1 message|(1,+Inf] %1% messages', array('%1%' => $nb_posts), $nb_posts, 'sfSimpleForum') ?><br /> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_figures.php

    r5293 r8996  
    99  <?php echo link_to_if( 
    1010    $display_topic_link, 
    11     format_number_choice('[0]No topic yet|[1]One topic|(1,+Inf]%topics% topics', array('%topics%' => $nb_topics), $nb_topics), 
     11    format_number_choice('[0]No topic yet|[1]One topic|(1,+Inf]%topics% topics', array('%topics%' => $nb_topics), $nb_topics, 'sfSimpleForum'), 
    1212    $topic_rule 
    1313    ) ?>,  
     
    1515  <?php echo link_to_if( 
    1616    $display_post_link, 
    17     format_number_choice('[0]No message|[1]One message|(1,+Inf]%posts% messages', array('%posts%' => $nb_posts), $nb_posts), 
     17    format_number_choice('[0]No message|[1]One message|(1,+Inf]%posts% messages', array('%posts%' => $nb_posts), $nb_posts, 'sfSimpleForum'), 
    1818    $post_rule 
    1919   ) ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_forum.php

    r6629 r8996  
    1414        '%date%'   => distance_of_time_in_words($latest_post->getCreatedAt('U')), 
    1515        '%author%' => link_to(get_partial('sfSimpleForum/author_name', array('author' => $latest_post->getAuthorName(), 'sf_cache_key' => $latest_post->getAuthorName())), 'sfSimpleForum/userLatestPosts?username='.$latest_post->getAuthorName()) 
    16         )) ?> 
     16        ), 'sfSimpleForum') ?> 
    1717    <?php endif ;?> 
    1818  </td> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_latestPosts.php

    r5070 r8996  
    11<?php echo use_helper('I18N', 'Date') ?> 
    22<div class="forum_sidebar_block"> 
    3   <h2><?php echo __('Recent posts') ?></h2> 
     3  <h2><?php echo __('Recent posts', null, 'sfSimpleForum') ?></h2> 
    44  <ol> 
    55  <?php foreach ($posts as $post): ?> 
     
    99      '%date%'   => distance_of_time_in_words($post->getCreatedAt('U')), 
    1010      '%author%' => link_to($post->getAuthorName(), 'sfSimpleForum/latestUserPosts?username='.$post->getAuthorName()) 
    11       )) ?> 
     11      ), 'sfSimpleForum') ?> 
    1212    </li> 
    1313  <?php endforeach; ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_post_moderator_actions.php

    r5317 r8996  
    11<?php echo use_helper('I18N') ?> 
    22<ul class="post_actions"> 
    3   <li><?php echo link_to(__('Delete'), 'sfSimpleForum/deletePost?id='.$post->getId(), array('confirm' =>__('Are you sure you want to delete this post?'))) ?></li> 
     3  <li><?php echo link_to(__('Delete', null, 'sfSimpleForum'), 'sfSimpleForum/deletePost?id='.$post->getId(), array('confirm' =>__('Are you sure you want to delete this post?', null, 'sfSimpleForum'))) ?></li> 
    44</ul>    
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_topic.php

    r5414 r8996  
    66      <?php echo image_tag('/sfSimpleForumPlugin/images/note.png', array( 
    77        'align' => 'absbottom', 
    8         'alt'   => __('Sticked topic'), 
    9         'title' => __('Sticked topic'
     8        'alt'   => __('Sticked topic', null, 'sfSimpleForum'), 
     9        'title' => __('Sticked topic', null, 'sfSimpleForum'
    1010      )) ?> 
    1111    <?php endif; ?> 
     
    1313      <?php echo image_tag('/sfSimpleForumPlugin/images/lock.png', array( 
    1414        'align' => 'absbottom', 
    15         'alt'   => __('Locked topic'), 
    16         'title' => __('Locked topic'
     15        'alt'   => __('Locked topic', null, 'sfSimpleForum'), 
     16        'title' => __('Locked topic', null, 'sfSimpleForum'
    1717      )) ?> 
    1818    <?php endif; ?> 
     
    5454 
    5555  <td class="thread_recent"> 
    56     <?php $message_link = $topic->getNbReplies() ? __('Last reply') : __('Posted') ?> 
     56    <?php $message_link = $topic->getNbReplies() ? __('Last reply', null, 'sfSimpleForum') : __('Posted', null, 'sfSimpleForum') ?> 
    5757    <?php $latest_post = $topic->getsfSimpleForumPost() ?> 
    5858    <?php echo $message_link . ' ' . __('%date% ago by %author%', array( 
    5959      '%date%'   => distance_of_time_in_words($latest_post->getCreatedAt('U')), 
    6060      '%author%' => link_to(get_partial('sfSimpleForum/author_name', array('author' => $latest_post->getAuthorName(), 'sf_cache_key' => $latest_post->getAuthorName())), 'sfSimpleForum/userLatestPosts?username='.$latest_post->getAuthorName()) 
    61       )) ?> 
     61      ), 'sfSimpleForum') ?> 
    6262 
    6363    <?php if ($topic->getNbReplies()): ?> 
    64       (<?php echo link_to(__('view'), 'sfSimpleForum/post?id='.$topic->getLatestPostId()) ?>) 
     64      (<?php echo link_to(__('view', null, 'sfSimpleForum'), 'sfSimpleForum/post?id='.$topic->getLatestPostId()) ?>) 
    6565    <?php endif; ?> 
    6666 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_topic_list.php

    r5356 r8996  
    11<table id="threads"> 
    22  <tr> 
    3     <th class="thread_name"><?php echo __('Topic') ?></th> 
    4     <th class="thread_replies"><?php echo __('Replies') ?></th> 
     3    <th class="thread_name"><?php echo __('Topic', null, 'sfSimpleForum') ?></th> 
     4    <th class="thread_replies"><?php echo __('Replies', null, 'sfSimpleForum') ?></th> 
    55    <?php if (sfConfig::get('app_sfSimpleForumPlugin_count_views', true)): ?> 
    6     <th class="thread_replies"><?php echo __('Views') ?></th> 
     6    <th class="thread_replies"><?php echo __('Views', null, 'sfSimpleForum') ?></th> 
    77    <?php endif; ?> 
    8     <th class="thread_recent"><?php echo __('Last Message') ?></th> 
     8    <th class="thread_recent"><?php echo __('Last Message', null, 'sfSimpleForum') ?></th> 
    99  </tr> 
    1010  <?php foreach ($topics as $topic): ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/_topic_moderator_actions.php

    r5356 r8996  
    22<?php if ($user_is_moderator): ?> 
    33  <ul class="post_actions"> 
    4     <li><?php echo link_to(__('Delete'), 'sfSimpleForum/deleteTopic?id='.$topic->getId(), array('confirm' =>__('Are you sure you want to delete this topic?'))) ?></li> 
     4    <li><?php echo link_to(__('Delete', null, 'sfSimpleForum'), 'sfSimpleForum/deleteTopic?id='.$topic->getId(), array('confirm' =>__('Are you sure you want to delete this topic?', null, 'sfSimpleForum'))) ?></li> 
    55  </ul> 
    66<?php endif ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/createTopicSuccess.php

    r5356 r8996  
    55<?php if ($forum): ?> 
    66  <?php echo forum_breadcrumb(array( 
    7     array(__(sfConfig::get('app_sfSimpleForumPlugin_forum_name', 'Forums')), 'sfSimpleForum/forumList'), 
     7    array(__(sfConfig::get('app_sfSimpleForumPlugin_forum_name', 'Forums'), null, 'sfSimpleForum'), 'sfSimpleForum/forumList'), 
    88    array($forum->getName(), 'sfSimpleForum/forum?forum_name='.$forum->getStrippedName()), 
    9     __('New topic'
     9    __('New topic', null, 'sfSimpleForum'
    1010  )) ?> 
    1111<?php else: ?> 
    1212  <?php echo forum_breadcrumb(array( 
    1313    array(__(sfConfig::get('app_sfSimpleForumPlugin_forum_name', 'Forums')), 'sfSimpleForum/forumList'), 
    14     __('New topic'
     14    __('New topic', null, 'sfSimpleForum'
    1515  )) ?> 
    1616<?php endif; ?> 
     
    2020<div class="sfSimpleForum"> 
    2121 
    22   <h1><?php echo __('Create a new topic') ?></h1> 
     22  <h1><?php echo __('Create a new topic', null, 'sfSimpleForum') ?></h1> 
    2323   
    2424  <?php include_partial('sfSimpleForum/add_post_form', array('forum' => $forum)) ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/forumLatestPostsSuccess.php

    r5356 r8996  
    11<?php use_helper('I18N', 'Pagination', 'sfSimpleForum') ?> 
    2 <?php $title = __('Latest messages') ?> 
     2<?php $title = __('Latest messages', null, 'sfSimpleForum') ?> 
    33 
    44<?php if (sfConfig::get('app_sfSimpleForum_include_breadcrumb', true)): ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/forumListSuccess.php

    r8029 r8996  
    1515  <?php if (sfConfig::get('app_sfSimpleForumPlugin_allow_new_topic_outside_forum', true)): ?> 
    1616  <ul class="forum_actions"> 
    17     <li><?php echo link_to(__('New topic'), 'sfSimpleForum/createTopic') ?></li> 
     17    <li><?php echo link_to(__('New topic', null, 'sfSimpleForum'), 'sfSimpleForum/createTopic') ?></li> 
    1818  </ul>     
    1919  <?php endif; ?> 
     
    3333  <table id="fora"> 
    3434    <tr> 
    35       <th class="forum_name"><?php echo __('Forum') ?></th> 
    36       <th class="forum_threads"><?php echo __('Topics') ?></th> 
    37       <th class="forum_posts"><?php echo __('Messages') ?></th> 
    38       <th class="forum_recent"><?php echo __('Last Message') ?></th> 
     35      <th class="forum_name"><?php echo __('Forum', null, 'sfSimpleForum') ?></th> 
     36      <th class="forum_threads"><?php echo __('Topics', null, 'sfSimpleForum') ?></th> 
     37      <th class="forum_posts"><?php echo __('Messages', null, 'sfSimpleForum') ?></th> 
     38      <th class="forum_recent"><?php echo __('Last Message', null, 'sfSimpleForum') ?></th> 
    3939    </tr> 
    4040    <?php foreach ($forums as $forum): ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/forumSuccess.php

    r7652 r8996  
    1515 
    1616  <ul class="forum_actions"> 
    17     <li><?php echo link_to(__('New topic'), 'sfSimpleForum/createTopic?forum_name='.$forum->getStrippedName()) ?></li> 
     17    <li><?php echo link_to(__('New topic', null, 'sfSimpleForum'), 'sfSimpleForum/createTopic?forum_name='.$forum->getStrippedName()) ?></li> 
    1818  </ul> 
    1919   
     
    3535    <?php echo pager_navigation($topic_pager, 'sfSimpleForum/forum?forum_name='.$forum->getStrippedName()) ?>     
    3636  <?php else: ?> 
    37     <p><?php echo __('There is no topic in this discussion yet. Perhaps you would like to %start%?', array('%start%' =>  link_to(__('start a new one'), 'sfSimpleForum/createTopic?forum_name='.$forum->getStrippedName()))) ?></p> 
     37    <p><?php echo __('There is no topic in this discussion yet. Perhaps you would like to %start%?', array('%start%' =>  link_to(__('start a new one', null, 'sfSimpleForum'), 'sfSimpleForum/createTopic?forum_name='.$forum->getStrippedName())), 'sfSimpleForum') ?></p> 
    3838  <?php endif; ?> 
    3939 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/latestPostsSuccess.php

    r5356 r8996  
    11<?php use_helper('I18N', 'Pagination', 'sfSimpleForum') ?> 
    2 <?php $title = __('Latest messages') ?> 
     2<?php $title = __('Latest messages', null, 'sfSimpleForum') ?> 
    33 
    44<?php if (sfConfig::get('app_sfSimpleForum_include_breadcrumb', true)): ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/latestTopicsSuccess.php

    r5293 r8996  
    11<?php use_helper('I18N', 'Pagination', 'sfSimpleForum') ?> 
    2 <?php $title = __('Latest topics') ?> 
     2<?php $title = __('Latest topics', null, 'sfSimpleForum') ?> 
    33 
    44<?php if (sfConfig::get('app_sfSimpleForum_include_breadcrumb', true)): ?> 
     
    1717  <?php if (sfConfig::get('app_sfSimpleForumPlugin_allow_new_topic_outside_forum', true)): ?> 
    1818  <ul class="forum_actions"> 
    19     <li><?php echo link_to(__('New topic'), 'sfSimpleForum/createTopic') ?></li> 
     19    <li><?php echo link_to(__('New topic', null, 'sfSimpleForum'), 'sfSimpleForum/createTopic') ?></li> 
    2020  </ul>     
    2121  <?php endif; ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/topicSuccess.php

    r5356 r8996  
    2424    <?php if ($sf_user->hasCredential('moderator')): ?> 
    2525      <li><?php echo link_to( 
    26         $topic->getIsSticked() ? __('Unstick') : __('Stick'),  
     26        $topic->getIsSticked() ? __('Unstick', null, 'sfSimpleForum') : __('Stick', null, 'sfSimpleForum'),  
    2727        'sfSimpleForum/toggleStick?id='.$topic->getId() 
    2828      ) ?></li> 
    2929      <li><?php echo link_to( 
    30         $topic->getIsLocked() ? __('Unlock') : __('Lock'),  
     30        $topic->getIsLocked() ? __('Unlock', null, 'sfSimpleForum') : __('Lock', null, 'sfSimpleForum'),  
    3131        'sfSimpleForum/toggleLock?id='.$topic->getId() 
    3232      ) ?></li> 
     
    3535     
    3636  <div class="forum_figures"> 
    37     <?php echo format_number_choice('[1]1 message, no reply|(1,+Inf]%posts% messages', array('%posts%' => $post_pager->getNbResults()), $post_pager->getNbResults()) ?>  
     37    <?php echo format_number_choice('[1]1 message, no reply|(1,+Inf]%posts% messages', array('%posts%' => $post_pager->getNbResults()), $post_pager->getNbResults(), 'sfSimpleForum') ?>  
    3838    <?php if (sfConfig::get('app_sfSimpleForumPlugin_count_views', true)): ?> 
    39     - <?php echo format_number_choice('[0,1]1 view|(1,+Inf]%views% views', array('%views%' => $topic->getNbViews()), $topic->getNbViews()) ?> 
     39    - <?php echo format_number_choice('[0,1]1 view|(1,+Inf]%views% views', array('%views%' => $topic->getNbViews()), $topic->getNbViews(), 'sfSimpleForum') ?> 
    4040    <?php endif; ?> 
    4141    <?php if(sfConfig::get('app_sfSimpleForumPlugin_use_feeds', true)): ?> 
     
    5151     
    5252    <h2> 
    53       <?php echo __('Post a reply') ?> 
     53      <?php echo __('Post a reply', null, 'sfSimpleForum') ?> 
    5454    </h2> 
    5555    <?php include_partial('sfSimpleForum/add_post_form', array('topic' => $topic)) ?> 
     
    5959    <ul class="forum_actions"> 
    6060        <li><?php echo link_to( 
    61           __('Post a reply'),  
     61          __('Post a reply', null, 'sfSimpleForum'),  
    6262          sfConfig::get('sf_login_module').'/'.sfConfig::get('sf_login_action') 
    6363        ) ?></li> 
     
    6666  <?php elseif ($topic->getIsLocked() && $sf_user->isAuthenticated()): ?> 
    6767     
    68     <?php echo __('This topic was locked by a forum moderator. No reply can be added.') ?> 
     68    <?php echo __('This topic was locked by a forum moderator. No reply can be added.', null, 'sfSimpleForum') ?> 
    6969     
    7070  <?php endif; ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/userLatestPostsSuccess.php

    r5414 r8996  
    11<?php use_helper('I18N', 'Pagination', 'sfSimpleForum') ?> 
    2 <?php $title = __('Messages by %user%', array('%user%' => get_partial('sfSimpleForum/author_name', array('author' => $user, 'sf_cache_key' => $username)))) ?> 
     2<?php $title = __('Messages by %user%', array('%user%' => get_partial('sfSimpleForum/author_name', array('author' => $user, 'sf_cache_key' => $username))), 'sfSimpleForum') ?> 
    33 
    44<?php if (sfConfig::get('app_sfSimpleForum_include_breadcrumb', true)): ?> 
  • plugins/sfSimpleForumPlugin/trunk/modules/sfSimpleForum/templates/userLatestTopicsSuccess.php

    r5414 r8996  
    11<?php use_helper('I18N', 'Pagination', 'sfSimpleForum') ?> 
    2 <?php $title = __('Topics by %user%', array('%user%' => get_partial('sfSimpleForum/author_name', array('author' => $user, 'sf_cache_key' => $username)))) ?> 
     2<?php $title = __('Topics by %user%', array('%user%' => get_partial('sfSimpleForum/author_name', array('author' => $user, 'sf_cache_key' => $username))), 'sfSimpleForum') ?> 
    33 
    44<?php if (sfConfig::get('app_sfSimpleForum_include_breadcrumb', true)): ?> 
     
    1717  <?php if (sfConfig::get('app_sfSimpleForumPlugin_allow_new_topic_outside_forum', true)): ?> 
    1818  <ul class="forum_actions"> 
    19     <li><?php echo link_to(__('New topic'), 'sfSimpleForum/createTopic') ?></li> 
     19    <li><?php echo link_to(__('New topic', null, 'sfSimpleForum'), 'sfSimpleForum/createTopic') ?></li> 
    2020  </ul>     
    2121  <?php endif; ?>