Ticket #57: loca.diff

File loca.diff, 35.0 KB (added by momo360modena, 2 years ago)
  • scripts/recheck-warnings.php

     
    1010                        $warnings = GP::$translation_warnings->check( $entry->singular, $entry->plural, $entry->translations, $locale ); 
    1111                        if ( $warnings != $entry->warnings ) { 
    1212                                $translation = new GP_Translation( array('id' => $entry->id) ); 
    13                                 echo "Updating warnings for $entry->id\n"; 
     13                                echo sprintf( __("Updating warnings for %s"), $entry->id ) . "\n"; 
    1414                                $translation->update( array('warnings' => $warnings) ); 
    1515                        } 
    1616                } 
  • scripts/import-originals.php

     
    1212                        $this->usage(); 
    1313                } 
    1414                $project = GP::$project->by_path( $this->options['p'] ); 
    15                 if ( !$project ) $this->error( 'Project not found!' ); 
     15                if ( !$project ) $this->error( __('Project not found!') ); 
    1616                 
    1717                $translations = new PO(); 
    1818                $translations->import_from_file( $this->options['f'] ); 
    19                 if ( !$translations ) $this->error( 'Error importing from POT file!' ); 
     19                if ( !$translations ) $this->error( __('Error importing from POT file!') ); 
    2020                 
    2121                GP::$original->import_for_project( $project, $translations ); 
    2222        } 
  • gp-templates/footer.php

     
    11        <p id="footer"class="secondary"> 
    2                 Proudly powered by <a href="http://glotpress.org/" title="Found in translation">GlotPress</a>. 
    3                 <?php gp_footer(); ?>            
     2                <?php printf( __('Proudly powered by <a href="%s" title="Found in translation">GlotPress</a>.'), 'http://glotpress.org/' ); ?> 
     3                <?php gp_footer(); ?> 
    44        </p> 
    55        </body> 
    66</html> 
     7 No newline at end of file 
  • gp-templates/translation-set-permissions.php

     
    44        gp_link_project_get( $project, $project->name ), 
    55        $locale->english_name, 
    66        'default' != $translation_set->slug? $translation_set->name : '', 
    7         'Permissions' 
     7        __('Permissions') 
    88) ); 
    99gp_tmpl_header(); 
    1010?> 
    11 <h2>Permissions</h2> 
     11<h2><?php _e('Permissions'); ?></h2> 
    1212<ul id="translation-set-permissions"> 
    13 <? foreach( $permissions as $permission ): ?> 
    14         <li> 
    15                 <span class="permission-action">user</span> 
    16                 <span class="user"><?php echo esc_html( $permission->user->user_login ); ?></span> 
    17                 <span class="permission-action">can <?php echo esc_html( $permission->action ); ?></span> 
    18                 <a href="<?php echo gp_url_join( gp_url_current(), '_delete/'.$permission->id ); ?>" class="action delete">Remove</a> 
    19         </li> 
    20 <? endforeach; ?> 
    21 <?php if ( !$permissions ): ?> 
    22         <strong>No validators defined for this translation set.</strong> 
    23 <?php endif; ?> 
     13        <?php foreach( $permissions as $permission ): ?> 
     14                <li> 
     15                        <span class="permission-action"><?php _e('user'); ?></span> 
     16                        <span class="user"><?php echo esc_html( $permission->user->user_login ); ?></span> 
     17                        <span class="permission-action">can <?php echo esc_html( $permission->action ); ?></span> 
     18                        <a href="<?php echo gp_url_join( gp_url_current(), '_delete/'.$permission->id ); ?>" class="action delete"><?php _e('Remove'); ?></a> 
     19                </li> 
     20        <? endforeach; ?> 
     21 
     22        <?php if ( !$permissions ): ?> 
     23                <strong><?php _e('No validators defined for this translation set.'); ?></strong> 
     24        <?php endif; ?> 
    2425</ul> 
     26 
    2527<form action="" method="post" class="secondary"> 
    26         <h3>Add a validator for this translation set</h3> 
    27         <p><label for="user_login">Username:</label> <input type="text" name="user_login" value="" id="user_login" /></p> 
    28         <p><input type="submit" name="submit" value="Add &rarr;" id="submit" /></p> 
     28        <h3><?php _e('Add a validator for this translation set'); ?></h3> 
     29        <p> 
     30                <label for="user_login"><?php _e('Username:'); ?></label> 
     31                <input type="text" name="user_login" value="" id="user_login" /> 
     32        </p> 
     33        <p> 
     34                <input type="submit" name="submit" value="<?php esc_attr(__('Add &rarr;')); ?>" id="submit" /> 
     35        </p> 
     36         
    2937        <input type="hidden" name="action" value="add-approver" /> 
    3038</form> 
    3139<?php 
  • gp-templates/translation-row.php

     
    1616        <td class="priority" title="<?php echo esc_attr('Priority: '.gp_array_get( GP::$original->get_static( 'priorities' ), $t->priority )); ?>"> 
    1717           <?php echo $priority_char[$t->priority][0] ?> 
    1818        </td> 
    19         <td class="original">                    
     19        <td class="original"> 
    2020                <?php echo prepare_original( esc_translation( $t->singular ) ); ?> 
    2121                <?php if ( $t->context ): ?> 
    2222                <span class="context" title="<?php printf( __('Context: %s'), esc_html($t->context) ); ?>"><?php echo esc_html($t->context); ?></span> 
    2323                <?php endif; ?> 
    24  
     24         
    2525        </td> 
    2626        <td class="translation"> 
    2727        <?php 
    28                 $edit_text = $can_edit? 'Double-click to add' : 'You <a href="'.gp_url_login().'">have to login</a> to add a translation.'; 
     28                $edit_text = $can_edit? __('Double-click to add') : sprintf(__('You <a href="%s">have to login</a> to add a translation.'), gp_url_login()); 
    2929                $missing_text = "<span class='missing'>$edit_text</span>"; 
    3030                if ( !count( array_filter( $t->translations ) ) ): 
    3131                        echo $missing_text; 
    3232                elseif ( !$t->plural ): 
    3333                        echo esc_translation( $t->translations[0] ); 
    34                 else: ?>                                 
     34                else: ?> 
    3535                <ul> 
    3636                        <?php 
    3737                                foreach( $t->translations as $translation ): 
    38                         ?>                       
     38                        ?> 
    3939                                <li><?php echo $translation? esc_translation( $translation ) : $missing_text; ?></li> 
    4040                        <?php 
    4141                                endforeach; 
     
    7373                                </p> 
    7474                                <?php foreach( range( 0, $locale->nplurals - 1 ) as $plural_index ): ?> 
    7575                                        <?php if ( $locale->nplurals > 1 ): ?> 
    76                                         <p class="plural-numbers">This plural form is used for numbers like: <span class="numbers"><?php  echo implode(', ', $locale->numbers_for_index( $plural_index) ); ?></span></p>                                                                                 
     76                                        <p class="plural-numbers"><?php printf(__('This plural form is used for numbers like: <span class="numbers">%s</span>'), implode(', ', $locale->numbers_for_index( $plural_index) ) ); ?></p> 
    7777                                        <?php endif; ?> 
    78                                         <?php textareas( $t, $can_edit, $plural_index ); ?>                                      
     78                                        <?php textareas( $t, $can_edit, $plural_index ); ?> 
    7979                                <?php endforeach; ?> 
    8080                        <?php endif; ?> 
    8181                <?php endif; ?> 
    8282                </div> 
     83                 
    8384                <div class="meta"> 
    84                         <h3>Meta</h3> 
     85                        <h3><?php _e('Meta'); ?></h3> 
    8586                        <dl> 
    86                                 <dt>Status:</dt> 
     87                                <dt><?php _e('Status:'); ?></dt> 
    8788                                <dd><?php echo display_status( $t->translation_status ); ?></dd> 
    8889                                <!-- 
    8990                                TODO: ajaxy actions for approve/set as current/reject 
    9091                        <?php if ( $can_approve ): ?> 
    9192                                <?php if ( gp_startswith( $t->translation_status, '-' ) ): ?> 
    92                                 <dd><a href="#" tabindex="-1">Set as current</a></dd> 
     93                                <dd><a href="#" tabindex="-1"><?php _e('Set as current'); ?></a></dd> 
    9394                                <?php endif; ?> 
    9495                                <?php if ( $t->translation_status ): ?> 
    95                                 <dd><a href="#" tabindex="-1">Reject</a></dd> 
     96                                <dd><a href="#" tabindex="-1"><?php _e('Reject'); ?></a></dd> 
    9697                                <?php endif; ?> 
    9798                        <?php endif; ?> 
    9899                                --> 
    99100                        </dl> 
    100101                        <!-- 
    101                         <dl>                                     
    102                                 <dt>Priority:</dt> 
     102                        <dl> 
     103                                <dt><?php _e('Priority:'); ?></dt> 
    103104                                <dd><?php echo esc_html($t->priority); ?></dd> 
    104105                        </dl> 
    105                         -->      
     106                        --> 
    106107                         
    107108                        <?php if ( $t->context ): ?> 
    108                         <dl>                                     
    109                                 <dt>Context:</dt> 
     109                        <dl> 
     110                                <dt><?php _e('Context:'); ?></dt> 
    110111                                <dd><span class="context"><?php echo esc_translation($t->context); ?></span></dd> 
    111112                        </dl> 
    112                         <?php endif; ?>                          
     113                        <?php endif; ?> 
    113114                        <?php if ( $t->extracted_comment ): ?> 
    114                         <dl>                                     
    115                                 <dt>Comment:</dt> 
     115                        <dl> 
     116                                <dt><?php _e('Comment:'); ?></dt> 
    116117                                <dd><?php echo make_clickable( esc_translation($t->extracted_comment) ); ?></dd> 
    117118                        </dl> 
    118119                        <?php endif; ?> 
    119120                        <?php if ( $t->translation_added && $t->translation_added != '0000-00-00 00:00:00' ): ?> 
    120121                        <dl> 
    121                                 <dt>Date added:</dt> 
     122                                <dt><?php _e('Date added:'); ?></dt> 
    122123                                <dd><?php echo $t->translation_added; ?> GMT</dd> 
    123                         </dl>                                                            
     124                        </dl> 
    124125                        <?php endif; ?> 
    125126                        <?php if ( $t->user_login ): ?> 
    126127                        <dl> 
    127                                 <dt>Translated by:</dt> 
    128                                 <dd><?php echo $t->user_login; ?></dd>                           
    129                         </dl>                                                            
     128                                <dt><?php _e('Translated by:'); ?></dt> 
     129                                <dd><?php echo $t->user_login; ?></dd> 
     130                        </dl> 
    130131                        <?php endif; ?> 
    131132                         
    132133                        <?php references( $project, $t ); ?> 
    133134                         
    134135                        <dl> 
    135                             <dt>Priority of the original:</dt> 
     136                            <dt><?php _e('Priority of the original:'); ?></dt> 
    136137                        <?php if ( $can_write ): ?> 
    137138                            <?php echo gp_select( 'priority-'.$t->original_id, GP::$original->get_static( 'priorities' ), $t->priority, array('class' => 'priority') ); ?> 
    138139                        <?php else: ?> 
     
    143144                <div class="actions"> 
    144145                <?php if ( $can_edit ): ?> 
    145146                        <button class="ok"> 
    146                                 <?php echo $can_approve? 'Add translation &rarr;' : 'Suggest new translation &rarr;'; ?> 
     147                                <?php echo $can_approve? __('Add translation &rarr;') : __('Suggest new translation &rarr;'); ?> 
    147148                        </button> 
    148                 <?php endif; ?>                          
     149                <?php endif; ?> 
    149150                        <a href="#" class="close"><?php _e('Cancel'); ?></a> 
    150151                </div> 
    151152        </td> 
  • gp-templates/project.php

     
    4444        <?php endforeach; ?> 
    4545        </ul> 
    4646<?php else: ?> 
    47         <p>There are no translations of this project.</p> 
     47        <p><?php _e('There are no translations of this project.'); ?></p> 
    4848<?php endif; ?> 
    4949<?php if ( $can_write ): ?> 
    5050        <div class="secondary actionlist"> 
    51         <a href="#" class="personal-options" id="personal-options-toggle">Personal project options &darr;</a> 
     51        <a href="#" class="personal-options" id="personal-options-toggle"><?php _e('Personal project options &darr;'); ?></a> 
    5252        <div class="personal-options"> 
    5353                <form action="<?php echo gp_url_project( $project, '_personal' ); ?>" method="post"> 
    5454                <dl> 
    5555                        <dt><label for="source-url-template"><?php _e('Source file URL');  ?></label></dt> 
    5656                        <dd> 
    5757                                <input type="text" value="<?php echo esc_html( $project->source_url_template() ); ?>" name="source-url-template" id="source-url-template" /> 
    58                                 <small>URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>http://trac.example.org/browser/%file%#L%line%</code></small> 
     58                                <small><?php _e('URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>http://trac.example.org/browser/%file%#L%line%</code>'); ?></small> 
    5959                        </dd> 
    6060                </dl> 
    6161                <p> 
    62                         <input type="submit" name="submit" value="Save &rarr;" id="save" /> 
    63                         <a class="ternary" href="#" onclick="jQuery('#personal-options-toggle').click();return false;">Cancel</a> 
     62                        <input type="submit" name="submit" value="<?php esc_attr(__('Save &rarr;')); ?>" id="save" /> 
     63                        <a class="ternary" href="#" onclick="jQuery('#personal-options-toggle').click();return false;"><?php _e('Cancel'); ?></a> 
    6464                </p>             
    6565                </form> 
    6666        </div> 
  • gp-templates/install.php

     
    66 
    77gp_tmpl_header(); 
    88?> 
     9 
    910<?php if ($errors): ?> 
    10 There were some errors: 
    11 <pre> 
    12         <?php echo implode("\n", $errors); ?> 
    13 </pre> 
    14 <?php 
     11        <?php _e('There were some errors:'); ?> 
     12        <pre> 
     13                <?php echo implode("\n", $errors); ?> 
     14        </pre> 
     15<?php  
    1516        else: 
    1617                echo $success_message; 
    1718        endif; 
    18         // TODO: deny access to scripts folder 
    19         if ( $show_htaccess_instructions ): ?> 
    20 <p> 
    21 Please add this to your <code>.htacess</code> file: 
    22 <pre> 
    23 # BEGIN GlotPress 
    24 &lt;IfModule mod_rewrite.c&gt; 
    25 RewriteEngine On 
    26 RewriteBase <?php echo $path . "\n"; ?> 
    27 RewriteCond %{REQUEST_FILENAME} !-f 
    28 RewriteCond %{REQUEST_FILENAME} !-d 
    29 RewriteRule . <?php echo $path; ?>index.php [L] 
    30 &lt;/IfModule&gt; 
    31 # END GlotPress 
    32 </pre> 
    33 <strong>The default username is <code>admin</code>, whose password is simply <code>a</code>.</strong> 
    34 </p> 
     19?> 
     20 
     21<?php 
     22// TODO: deny access to scripts folder 
     23if ( $show_htaccess_instructions ): ?> 
     24        <p> 
     25                <?php _e('Please add this to your <code>.htaccess</code> file:'); ?> 
     26                <pre> 
     27                # BEGIN GlotPress 
     28                &lt;IfModule mod_rewrite.c&gt; 
     29                RewriteEngine On 
     30                RewriteBase <?php echo $path . "\n"; ?> 
     31                RewriteCond %{REQUEST_FILENAME} !-f 
     32                RewriteCond %{REQUEST_FILENAME} !-d 
     33                RewriteRule . <?php echo $path; ?>index.php [L] 
     34                &lt;/IfModule&gt; 
     35                # END GlotPress 
     36                </pre> 
     37                <?php _e('<strong>The default username is <code>admin</code>, whose password is simply <code>a</code>.</strong>'); ?> 
     38        </p> 
    3539<?php endif; ?> 
     40         
    3641<?php gp_tmpl_footer(); ?> 
     42 No newline at end of file 
  • gp-templates/project-form.php

     
    66        <dt><label for="project[slug]"><?php _e('Slug');  ?></label></dt> 
    77        <dd> 
    88                <input type="text" name="project[slug]" value="<?php echo esc_html( $project->slug ); ?>" id="project[slug]"> 
    9                 <small>If you leave the slug empty, it will be derived from the name.</small> 
     9                <small><?php _e('If you leave the slug empty, it will be derived from the name.'); ?></small> 
    1010        </dd>    
    1111 
    1212        <dt><label for="project[description]"><?php _e('Description');  ?></label></dt> 
     
    1515        <dt><label for="project[source_url_template]"><?php _e('Source file URL');  ?></label></dt> 
    1616        <dd> 
    1717                <input type="text" value="<?php echo esc_html( $project->source_url_template ); ?>" name="project[source_url_template]" id="project[source_url_template]" style="width: 30em;" /> 
    18                 <small>Public URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>http://trac.example.org/browser/%file%#L%line%</code></small> 
     18                <small><?php _e('Public URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>http://trac.example.org/browser/%file%#L%line%</code>'); ?></small> 
    1919        </dd> 
    2020 
    2121        <dt><label for="project[parent_project_id]"><?php _e('Parent Project');  ?></label></dt> 
    2222        <dd><?php echo gp_select( 'project[parent_project_id]', $all_project_options, $project->parent_project_id); ?></dd> 
    2323</dl> 
     24 
    2425<?php echo gp_js_focus_on( 'project[name]' ); ?> 
     26 No newline at end of file 
  • gp-templates/404.php

     
    11<?php 
    22gp_title( __('Not Found &lt; GlotPress') ); 
    33gp_tmpl_header(); 
    4 ?> 
    5 Not Found 
    6 <?php gp_tmpl_footer(); ?> 
    7  No newline at end of file 
     4 
     5_e('Not found'); 
     6 
     7gp_tmpl_footer(); 
     8?> 
     9 No newline at end of file 
  • gp-templates/translations.php

     
    1616?> 
    1717<!-- TODO: use another form for bulk actions --> 
    1818<form id="upper-filters-toolbar" class="filters-toolbar" action="" method="get" accept-charset="utf-8"> 
    19         <?php if ( $can_approve ): ?>    
    20         <a href="#" class="revealing bulk">Bulk &darr;</a> <strong class="separator">&bull;</strong> 
     19        <?php if ( $can_approve ): ?> 
     20        <a href="#" class="revealing bulk"><?php _e('Bulk &darr;'); ?></a> <strong class="separator">&bull;</strong> 
    2121        <?php endif; ?> 
    22         <a href="#" class="revealing filter">Filter &darr;</a> <span class="separator">&bull;</span> 
    23         <a href="#" class="revealing sort">Sort &darr;</a> <strong class="separator">&bull;</strong> 
     22        <a href="#" class="revealing filter"><?php _e('Filter &darr;'); ?></a> <span class="separator">&bull;</span> 
     23        <a href="#" class="revealing sort"><?php _e('Sort &darr;'); ?></a> <strong class="separator">&bull;</strong> 
    2424        <?php 
    2525        $filter_links = array(); 
    26         $filter_links[] = gp_link_get( $url, 'All' ); 
    27         $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'priority', 'sort[how]' => 'desc', 
    28             'filters[status]' => 'either'), $url ), 'Untranslated' ); 
    29         $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'random', 'filters[status]' => 'either'), $url ), 'Random Untranslated' ); 
     26        $filter_links[] = gp_link_get( $url, __('All') ); 
     27        $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'priority', 'sort[how]' => 'desc', 'filters[status]' => 'either'), $url ), __('Untranslated') ); 
     28        $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'random', 'filters[status]' => 'either'), $url ), __('Random Untranslated') ); 
    3029        if ( $can_approve ) { 
    3130                $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'yes', 'filters[status]' => 'waiting'), $url ), 
    32                                 'Waiting' ); 
     31                                __('Waiting') ); 
    3332                $filter_links[] = gp_link_get( add_query_arg( array('filters[warnings]' => 'yes', 'filters[status]' => 'current_or_waiting', 'sort[by]' => 'translation_date_added'), $url ), 
    34                                 'Warnings' ); 
    35                                  
     33                                __('Warnings') ); 
     34         
    3635        } 
    3736        // TODO: with warnings 
    3837        // TODO: saved searches 
    3938        echo implode( '&nbsp;<span class="separator">&bull;</span>&nbsp;', $filter_links ); 
    4039        ?> 
    41         <dl class="filters-expanded filters hidden clearfix">            
    42                 <dt><label for="filters[term]">Term:</label></dt> 
    43                 <dd><input type="text" value="<?php echo gp_esc_attr_with_entities( gp_array_get( $filters, 'term' ) ); ?>" name="filters[term]" id="filters[term]" /></dd>              
    44                 <dt><label for="filters[translated]">With translation:</label></dt> 
     40        <dl class="filters-expanded filters hidden clearfix"> 
     41                <dt><label for="filters[term]"><?php _e('Term:'); ?></label></dt> 
     42                <dd><input type="text" value="<?php echo gp_esc_attr_with_entities( gp_array_get( $filters, 'term' ) ); ?>" name="filters[term]" id="filters[term]" /></dd> 
     43                <dt><label for="filters[translated]"><?php _e('With translation:'); ?></label></dt> 
    4544                <dd> 
    4645                        <?php echo gp_radio_buttons('filters[translated]', 
    4746                                array( 
    48                                         'yes' => 'Yes', 
    49                                         'no' => 'No', 
    50                                         'either' => 'Either', 
     47                                        'yes' => __('Yes'), 
     48                                        'no'  => __('No'), 
     49                                        'either' => __('Either'), 
    5150                                ), gp_array_get( $filters, 'translated', 'either' ) ); 
    52                         ?>                       
    53                 </dd>            
    54  
    55                 <dt><label for="filters[status]">Status:</label></dt> 
     51                        ?> 
     52                </dd> 
     53                 
     54                <dt><label for="filters[status]"><?php _e('Status:'); ?></label></dt> 
    5655                <dd> 
    5756                        <?php echo gp_radio_buttons('filters[status]', //TODO: show only these, which user is allowed to see afterwards 
    5857                                array( 
    59                                         'current_or_waiting' => 'Current or waiting', 
    60                                         'current' => 'Current only', 
    61                                         'old' => 'Approved, but obsoleted by another string', 
    62                                         'waiting' => 'Waiting approval', 
    63                                         'rejected' => 'Rejected', 
    64                                         'either' => 'Any', 
     58                                        'current_or_waiting' => __('Current or waiting'), 
     59                                        'current' => __('Current only'), 
     60                                        'old' => __('Approved, but obsoleted by another string'), 
     61                                        'waiting' => __('Waiting approval'), 
     62                                        'rejected' => __('Rejected'), 
     63                                        'either' => __('Any'), 
    6564                                ), gp_array_get( $filters, 'status', 'current_or_waiting' ) ); 
    66                         ?>                       
    67                 </dd>            
     65                        ?> 
     66                </dd> 
    6867                 
    69                 <dd><input type="submit" value="Filter" name="filter" /></dd> 
     68                <dd><input type="submit" value="<?php esc_attr(__('Filter')); ?>" name="filter" /></dd> 
    7069        </dl> 
    71         <dl class="filters-expanded sort hidden clearfix">               
    72                 <dt>By:</dt> 
     70        <dl class="filters-expanded sort hidden clearfix"> 
     71                <dt><?php _e('By:'); ?></dt> 
    7372                <dd> 
    7473                <?php echo gp_radio_buttons('sort[by]', 
    7574                        array( 
    76                                 'original_date_added' => 'Date added (original)', 
    77                                 'translation_date_added' => 'Date added (translation)', 
    78                                 'original' => 'Original string', 
    79                                 'translation' => 'Translation', 
    80                                 'priority' => 'Priority', 
    81                                 'references' => 'Filename in source', 
    82                                 'random' => 'Random', 
     75                                'original_date_added' => __('Date added (original)'), 
     76                                'translation_date_added' => __('Date added (translation)'), 
     77                                'original' => __('Original string'), 
     78                                'translation' => __('Translation'), 
     79                                'priority' => __('Priority'), 
     80                                'references' => __('Filename in source'), 
     81                                'random' => __('Random'), 
    8382                        ), gp_array_get( $sort, 'by', 'original_date_added' ) ); 
    8483                ?> 
    8584                </dd> 
    86                 <dt>How:</dt> 
     85                <dt><?php _e('How:'); ?></dt> 
    8786                <dd> 
    8887                <?php echo gp_radio_buttons('sort[how]', 
    8988                        array( 
    90                                 'asc' => 'Ascending', 
    91                                 'desc' => 'Descending', 
     89                                'asc' => __('Ascending'), 
     90                                'desc' => __('Descending'), 
    9291                        ), gp_array_get( $sort, 'how', 'desc' ) ); 
    9392                ?> 
    9493                </dd> 
    95                 <dd><input type="submit" value="Sort" name="sorts" /></dd> 
     94                <dd><input type="submit" value="<?php esc_attr(__('Sort')); ?>" name="sorts" /></dd> 
    9695        </dl> 
    9796        <dl class="hidden bulk-actions filters-expanded clearfix"> 
    98                 <dt class="select">Select:</dt> 
     97                <dt class="select"><?php _e('Select:'); ?></dt> 
    9998                <dd> 
    100                         <a href="#" class="all">All</a> 
    101                         <a href="#" class="none">None</a>                        
     99                        <a href="#" class="all"><?php _e('All'); ?></a> 
     100                        <a href="#" class="none"><?php _e('None'); ?></a> 
    102101                </dd> 
    103                 <dt>Approve:</dt> 
     102                <dt><?php _e('Approve:'); ?></dt> 
    104103                <dd> 
    105104                        <?php echo gp_radio_buttons('bulk[action]', 
    106105                                array( 
    107                                         'approve-all' => 'All', 
    108                                         'approve-selected' => 'Selected', 
     106                                        'approve-all' => __('All'), 
     107                                        'approve-selected' => __('Selected'), 
    109108                                ), null ); 
    110                         ?>                       
     109                        ?> 
    111110                </dd> 
    112                 <dt>Reject:</dt> 
     111                <dt><?php _e('Reject:'); ?></dt> 
    113112                <dd> 
    114113                        <?php echo gp_radio_buttons('bulk[action]', 
    115114                                array( 
    116                                         'reject-all' => 'All', 
    117                                         'reject-selected' => 'Selected', 
     115                                        'reject-all' => __('All'), 
     116                                        'reject-selected' => __('Selected'), 
    118117                                ), null ); 
    119                         ?>                       
     118                        ?> 
    120119                </dd> 
    121120                <dd> 
    122121                        <input type="hidden" name="bulk[redirect_to]" value="<?php echo esc_attr(gp_url_current()); ?>" id="bulk[redirect_to]"> 
    123122                        <input type="hidden" name="bulk[translation-ids]" value="" id="bulk[translation-ids]"> 
    124                         <input type="submit" value="Approve/Reject" name="approve" /> 
    125                         <p class="ternary"><strong>Note:</strong>&nbsp;Bulk edit works only on the current page.</p> 
    126                 </dd>            
    127         </dl>    
    128          
     123                        <input type="submit" value="<?php esc_attr(__('Approve/Reject')); ?>" name="approve" /> 
     124                        <p class="ternary"><?php _e('<strong>Note:</strong>&nbsp;Bulk edit works only on the current page.'); ?></p> 
     125                </dd> 
     126        </dl> 
     127 
    129128</form> 
    130129 
    131130<?php echo gp_pagination( $page, $per_page, $total_translations_count ); ?> 
    132131<table id="translations" class="translations clear"> 
    133132        <tr> 
    134                 <th>&bull;</th> 
    135                 <th>Prio</th> 
     133                <th><?php _e('&bull;'); ?></th> 
     134                <th><?php _e('Prio'); ?></th> 
    136135                <th class="original"><?php _e('Original string'); ?></th> 
    137136                <th class="translation"><?php _e('Translation'); ?></th> 
    138137                <th>&mdash;</th> 
    139138        </tr> 
    140139<?php foreach( $translations as $t ): 
    141140                gp_tmpl_load( 'translation-row', get_defined_vars() ); 
    142 ?>       
     141?> 
    143142<?php endforeach; ?> 
    144143<?php 
    145144        if ( !$translations ): 
    146145?> 
    147         <tr><td colspan="4">No translations were found!</td></tr> 
     146        <tr><td colspan="4"><?php _e('No translations were found!'); ?></td></tr> 
    148147<?php 
    149148        endif; 
    150149?> 
     
    163162                        $footer_links[] = $export_link; 
    164163                } 
    165164                if ( $can_write ) { 
    166                     $footer_links[] = gp_link_get( gp_url_project( $project, array( $locale->slug, $translation_set->slug, '_permissions' ) ), 'Permissions' ); 
     165                    $footer_links[] = gp_link_get( gp_url_project( $project, array( $locale->slug, $translation_set->slug, '_permissions' ) ), __('Permissions') ); 
    167166                } 
    168167                echo implode( ' &bull; ', $footer_links ); 
    169168        ?> 
  • gp-templates/helper-functions.php

     
    11<?php 
    2  
    32function prepare_original( $text ) { 
    4         $text = str_replace( array("\r", "\n"), "<span class='invisibles' title='New line'>&crarr;</span>\n", $text); 
    5         $text = str_replace( "\t", "<span class='invisibles' title='Tab character'>&rarr;</span>\t", $text); 
     3        $text = str_replace( array("\r", "\n"), "<span class='invisibles' title='".esc_attr(__('New line'))."'>&crarr;</span>\n", $text); 
     4        $text = str_replace( "\t", "<span class='invisibles' title='".esc_attr(__('Tab character'))."'>&rarr;</span>\t", $text); 
    65        return $text; 
    76} 
    87 
    98function textareas( $entry, $can_edit, $index = 0 ) { 
    109        $disabled = $can_edit? '' : 'disabled="disabled"'; 
    11 ?> 
    12 <div class="textareas"> 
    13         <?php if( isset( $entry->warnings[$index] ) ): 
     10        ?> 
     11        <div class="textareas"> 
     12                <?php  
     13                if( isset( $entry->warnings[$index] ) ): 
    1414                        $referenceable = $entry->warnings[$index]; 
    1515                        $warning = each( $referenceable ); 
    16         ?> 
    17                 <div class="warning secondary"> 
    18                         <strong>Warning:</strong> <?php  echo esc_html( $warning['value'] ); ?> 
    19                         <?php if( GP::$user->current()->admin() ): // TODO: allow users with write permissions, too ?> 
    20                         <a href="#" class="discard-warning" key="<?php echo $warning['key'] ?>" index="<?php echo $index; ?>">Discard</a> 
    21                         <?php endif; ?> 
    22                 </div> 
    23         <?php endif; ?> 
    24         <textarea name="translation[<?php echo $entry->original_id; ?>][]" <?php echo $disabled; ?>><?php echo esc_translation(gp_array_get($entry->translations, $index)); ?></textarea> 
    25 <?php if ( $can_edit ): ?> 
    26         <p> 
    27                 <a href="#" class="copy" tabindex="-1">Copy from original</a> 
    28         </p> 
    29 <?php else: ?> 
    30         <p> 
    31                 You <a href="<?php echo gp_url_login(); ?>">have to log in</a> to edit this translation. 
    32         </p> 
    33          
    34 <?php endif; ?> 
    35 </div> 
    36 <?php 
     16                        ?> 
     17                        <div class="warning secondary"> 
     18                                <?php printf( __('<strong>Warning:</strong> %s'), esc_html( $warning['value'] ) ); ?> 
     19                                 
     20                                <?php if( GP::$user->current()->admin() ): // TODO: allow users with write permissions, too ?> 
     21                                        <a href="#" class="discard-warning" key="<?php echo $warning['key'] ?>" index="<?php echo $index; ?>"><?php _e('Discard'); ?></a> 
     22                                <?php endif; ?> 
     23                        </div> 
     24                <?php endif; ?> 
     25                <textarea name="translation[<?php echo $entry->original_id; ?>][]" <?php echo $disabled; ?>><?php echo esc_translation(gp_array_get($entry->translations, $index)); ?></textarea> 
     26 
     27                <?php if ( $can_edit ): ?> 
     28                        <p> 
     29                                <a href="#" class="copy" tabindex="-1"><?php _e('Copy from original'); ?></a> 
     30                        </p> 
     31                <?php else: ?> 
     32                        <p> 
     33                                <?php printf( __('You <a href="%s">have to log in</a> to edit this translation.'), gp_url_login() ); ?> 
     34                        </p> 
     35                <?php endif; ?> 
     36        </div> 
     37        <?php 
    3738} 
    3839 
    3940/** 
     
    4546 
    4647function display_status( $status ) { 
    4748        $status = preg_replace( '/^[+-]/', '', $status); 
    48         return $status? $status : 'untranslated'; 
     49        return $status ? $status : 'untranslated'; 
    4950} 
    5051 
    5152function references( $project, $entry ) { 
    5253        if ( !$project->source_url_template() ) return; 
    53 ?> 
    54         References: 
    55                         <ul class="refs"> 
    56         <?php 
     54        ?> 
     55        <?php _e('References:'); ?> 
     56        <ul class="refs">        
     57                <?php 
    5758                foreach( $entry->references as $reference ): 
    5859                        list( $file, $line ) = array_pad( explode( ':', $reference ), 2, 0 ); 
    5960                        // TODO: allow the user to override the project setting 
    6061                        if ( $source_url = $project->source_url( $file, $line ) ): 
    61         ?> 
     62                                ?> 
    6263                                <li><a target="_blank" tabindex="-1" href="<?php echo $source_url; ?>"><?php echo $file.':'.$line ?></a></li> 
    63  
    64         <?php 
     64                                <?php 
    6565                        endif; 
    6666                endforeach; 
    67         ?> 
    68                         </ul> 
     67                ?> 
     68        </ul> 
    6969<?php 
    7070} 
     71 No newline at end of file 
  • gp-templates/header.php

     
    1111                <?php gp_head(); ?> 
    1212        </head> 
    1313        <body> 
    14             <div id="gp-js-message"></div>               
     14            <div id="gp-js-message"></div> 
    1515                <h1> 
    16                         <a href="<?php echo gp_url( '/' ); ?>"><img alt="GlotPress logo" src="<?php echo gp_url_img( 'glotpress-logo.png' ); ?>" /></a> 
     16                        <a href="<?php echo gp_url( '/' ); ?>"> 
     17                                <img alt="<?php esc_attr(__('GlotPress logo')); ?>" src="<?php echo gp_url_img( 'glotpress-logo.png' ); ?>" /> 
     18                        </a> 
     19                         
    1720                        <?php echo gp_breadcrumb(); ?> 
    1821                        <span id="hello"> 
    19                         <?php if (GP::$user->logged_in()): 
    20                                         $user = GP::$user->current(); 
    21                         ?> 
    22                                 Hi, <?php echo $user->user_login; ?>. 
    23                                 <a href="<?php echo gp_url('/logout')?>">Log out</a> 
     22                        <?php  
     23                        if (GP::$user->logged_in()): 
     24                                $user = GP::$user->current(); 
     25                                 
     26                                printf( __('Hi, %s.'), $user->user_login ); 
     27                                ?> 
     28                                <a href="<?php echo gp_url('/logout')?>"><?php _e('Log out'); ?></a> 
    2429                        <?php else: ?> 
    25                                 <a href="<?php echo gp_url_login(); ?>">Log in</a> 
     30                                <a href="<?php echo gp_url_login(); ?>"><?php _e('Log in'); ?></a> 
    2631                        <?php endif; ?> 
    2732                        </span> 
    2833                </h1> 
  • gp-templates/translation-set-form.php

     
    22        <dt><label for="set[locale]"><?php _e('Locale');  ?></label></dt> 
    33        <dd> 
    44                <?php echo gp_select( 'set[locale]', $all_locale_options, $set->locale); ?> 
    5                 <a href="#" id="copy">Use as name</a> 
     5                <a href="#" id="copy"><?php _e('Use as name'); ?></a> 
    66        </dd> 
    77         
    88        <dt><label for="set[name]"><?php _e('Name');  ?></label></dt> 
  • gp-includes/install-upgrade.php

     
    5252         
    5353        gp_update_option( 'uri', guess_uri() ); 
    5454         
    55         $gpdb->insert( $gpdb->projects, array('name' => 'Sample', 'slug' => 'sample', 'description' => 'A Sample Project', 'path' => 'sample') ); 
    56         $gpdb->insert( $gpdb->originals, array('project_id' => 1, 'singular' => 'GlotPress FTW', 'comment' => 'FTW means For The Win', 'context' => 'dashboard', 'references' => 'bigfile:666 little-dir/small-file.php:71' ) ); 
    57         $gpdb->insert( $gpdb->originals, array('project_id' => 1, 'singular' => 'A GlotPress', 'plural' => 'Many GlotPresses' ) ); 
     55        $gpdb->insert( $gpdb->projects, array('name' => __('Sample'), 'slug' => __('sample'), 'description' => __('A Sample Project'), 'path' => __('sample') ) ); 
     56        $gpdb->insert( $gpdb->originals, array('project_id' => 1, 'singular' => __('GlotPress FTW'), 'comment' => __('FTW means For The Win'), 'context' => 'dashboard', 'references' => 'bigfile:666 little-dir/small-file.php:71' ) ); 
     57        $gpdb->insert( $gpdb->originals, array('project_id' => 1, 'singular' => __('A GlotPress'), 'plural' => __('Many GlotPresses') ) ); 
    5858         
    59         $gpdb->insert( $gpdb->translation_sets, array( 'name' => 'My Translation', 'slug' => 'my', 'project_id' => 1, 'locale' => 'bg', ) ); 
     59        $gpdb->insert( $gpdb->translation_sets, array( 'name' => __('My Translation'), 'slug' => __('my'), 'project_id' => 1, 'locale' => 'bg', ) ); 
    6060         
    6161        // TODO: ask the user for an e-mail -- borrow WordPress install process 
    6262        if ( !defined('CUSTOM_USER_TABLE') ) { 
  • gp-includes/cli.php

     
    4242                        $this->usage(); 
    4343                } 
    4444                $project = GP::$project->by_path( $this->options['p'] ); 
    45                 if ( !$project ) $this->error( 'Project not found!' ); 
     45                if ( !$project ) $this->error( __('Project not found!') ); 
    4646                 
    4747                $locale = GP_Locales::by_slug( $this->options['l'] ); 
    48                 if ( !$locale ) $this->error( 'Locale not found!' ); 
     48                if ( !$locale ) $this->error( __('Locale not found!') ); 
    4949                 
    5050                $this->options['t'] = gp_array_get( $this->options, 't', 'default' ); 
    5151                 
    5252                $translation_set = GP::$translation_set->by_project_id_slug_and_locale( $project->id, $this->options['t'], $locale->slug ); 
    53                 if ( !$translation_set ) $this->error( 'Translation set not found!' ); 
     53                if ( !$translation_set ) $this->error( __('Translation set not found!') ); 
    5454 
    5555                $this->action_on_translation_set( $translation_set ); 
    5656        } 
  • gp-includes/l10n.php

     
    1010        if (isset($locale)) 
    1111                return apply_filters( 'locale', $locale ); 
    1212 
     13        // GP_LANG is defined in gp-config. 
     14        if ( defined('GP_LANG') ) 
     15                $locale = GP_LANG; 
     16                 
    1317        // TODO: get locale from DB 
    1418 
    1519        if (empty($locale)) 
  • gp-includes/warnings.php

     
    7171                $len_trans = gp_strlen( $translation ); 
    7272                if ( !( $this->length_lower_bound*$len_src < $len_trans && $len_trans < $this->length_upper_bound*$len_src ) && 
    7373                                ( !gp_in( '_abbreviation', $original ) && !gp_in( '_initial', $original ) ) ) { 
    74                         return 'Lenghts of source and translation differ too much.'; 
     74                        return __('Lenghts of source and translation differ too much.'); 
    7575                } 
    7676                return true; 
    7777        } 
     
    8282                $original_parts = preg_split($tag_re, $original, -1, PREG_SPLIT_DELIM_CAPTURE); 
    8383                $translation_parts = preg_split($tag_re, $translation, -1, PREG_SPLIT_DELIM_CAPTURE); 
    8484                if ( count( $original_parts) > count( $translation_parts ) ) { 
    85                         return 'Missing tags from translation.'; 
     85                        return __('Missing tags from translation.'); 
    8686                } 
    8787                if ( count( $original_parts) < count( $translation_parts ) ) { 
    88                         return 'Too many tags in translation.'; 
     88                        return __('Too many tags in translation.'); 
    8989                } 
    9090                foreach( gp_array_zip( $original_parts, $translation_parts ) as $tags ) { 
    9191                        list( $original_tag, $translation_tag ) = $tags; 
     
    117117                        $original_count = gp_array_get( $original_counts, $placeholder, 0 ); 
    118118                        $translation_count = gp_array_get( $translation_counts, $placeholder, 0 ); 
    119119                        if ( $original_count > $translation_count ) { 
    120                                 return 'Missing '.$placeholder.' placeholder in translation.'; 
     120                                return sprintf(__('Missing %s placeholder in translation.'), $placeholder); 
    121121                        } 
    122122                        if ( $original_count < $translation_count ) { 
    123                                 return 'Extra '.$placeholder.' placeholder in translation.'; 
     123                                return sprintf(__('Extra %s placeholder in translation.'), $placeholder); 
    124124                        } 
    125125                } 
    126126                return true; 
     
    137137         
    138138        function warning_both_begin_end_on_newlines( $original, $translation, $locale ) { 
    139139                if ( gp_endswith( $original, "\n" ) xor gp_endswith( $translation, "\n" ) ) { 
    140                         return 'Original and translation should both end on newline.'; 
     140                        return __('Original and translation should both end on newline.'); 
    141141                } 
    142142                if ( gp_startswith( $original, "\n" ) xor gp_startswith( $translation, "\n" ) ) { 
    143                         return 'Original and translation should both begin on newline.'; 
     143                        return __('Original and translation should both begin on newline.'); 
    144144                } 
    145145                return true; 
    146146        } 
  • gp-config-sample.php

     
    3434/**#@-*/ 
    3535 
    3636/** 
     37 * GlotPress Localized Language, defaults to English. 
     38 * 
     39 * Change this to localize WordPress.  A corresponding MO file for the chosen 
     40 * language must be installed to languages/. For example, install 
     41 * fr_FR.mo to languages/ and set GP_LANG to 'fr_FR' to enable French 
     42 * language support. 
     43 */ 
     44define('GP_LANG', ''); 
     45 
     46/** 
    3747 * GlotPress Database Table prefix. 
    3848 * 
    3949 * You can have multiple installations in one database if you give each a unique 
     
    4151 */ 
    4252$gp_table_prefix = 'gp_'; 
    4353 
    44 ?> 
     54?> 
     55 No newline at end of file