Ticket #57: local-tpl.diff
| File local-tpl.diff, 29.0 KB (added by momo360modena, 2 years ago) |
|---|
-
gp-templates/footer.php
1 1 <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(); ?> 4 4 </p> 5 5 </body> 6 6 </html> 7 No newline at end of file -
gp-templates/translation-set-permissions.php
4 4 gp_link_project_get( $project, $project->name ), 5 5 $locale->english_name, 6 6 'default' != $translation_set->slug? $translation_set->name : '', 7 'Permissions'7 __('Permissions') 8 8 ) ); 9 9 gp_tmpl_header(); 10 10 ?> 11 <h2> Permissions</h2>11 <h2><?php _e('Permissions'); ?></h2> 12 12 <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"><?php printf(__('can %s'), 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; ?> 24 25 </ul> 26 25 27 <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 →" 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_e(__('Add →')); ?>" id="submit" /> 35 </p> 36 29 37 <input type="hidden" name="action" value="add-approver" /> 30 38 </form> 31 39 <?php -
gp-templates/translation-row.php
16 16 <td class="priority" title="<?php echo esc_attr('Priority: '.gp_array_get( GP::$original->get_static( 'priorities' ), $t->priority )); ?>"> 17 17 <?php echo $priority_char[$t->priority][0] ?> 18 18 </td> 19 <td class="original"> 19 <td class="original"> 20 20 <?php echo prepare_original( esc_translation( $t->singular ) ); ?> 21 21 <?php if ( $t->context ): ?> 22 22 <span class="context" title="<?php printf( __('Context: %s'), esc_html($t->context) ); ?>"><?php echo esc_html($t->context); ?></span> 23 23 <?php endif; ?> 24 24 25 25 </td> 26 26 <td class="translation"> 27 27 <?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()); 29 29 $missing_text = "<span class='missing'>$edit_text</span>"; 30 30 if ( !count( array_filter( $t->translations ) ) ): 31 31 echo $missing_text; 32 32 elseif ( !$t->plural ): 33 33 echo esc_translation( $t->translations[0] ); 34 else: ?> 34 else: ?> 35 35 <ul> 36 36 <?php 37 37 foreach( $t->translations as $translation ): 38 ?> 38 ?> 39 39 <li><?php echo $translation? esc_translation( $translation ) : $missing_text; ?></li> 40 40 <?php 41 41 endforeach; … … 73 73 </p> 74 74 <?php foreach( range( 0, $locale->nplurals - 1 ) as $plural_index ): ?> 75 75 <?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> 77 77 <?php endif; ?> 78 <?php textareas( $t, $can_edit, $plural_index ); ?> 78 <?php textareas( $t, $can_edit, $plural_index ); ?> 79 79 <?php endforeach; ?> 80 80 <?php endif; ?> 81 81 <?php endif; ?> 82 82 </div> 83 83 84 <div class="meta"> 84 <h3> Meta</h3>85 <h3><?php _e('Meta'); ?></h3> 85 86 <dl> 86 <dt> Status:</dt>87 <dt><?php _e('Status:'); ?></dt> 87 88 <dd><?php echo display_status( $t->translation_status ); ?></dd> 88 89 <!-- 89 90 TODO: ajaxy actions for approve/set as current/reject 90 91 <?php if ( $can_approve ): ?> 91 92 <?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> 93 94 <?php endif; ?> 94 95 <?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> 96 97 <?php endif; ?> 97 98 <?php endif; ?> 98 99 --> 99 100 </dl> 100 101 <!-- 101 <dl> 102 <dt> Priority:</dt>102 <dl> 103 <dt><?php _e('Priority:'); ?></dt> 103 104 <dd><?php echo esc_html($t->priority); ?></dd> 104 105 </dl> 105 --> 106 --> 106 107 107 108 <?php if ( $t->context ): ?> 108 <dl> 109 <dt> Context:</dt>109 <dl> 110 <dt><?php _e('Context:'); ?></dt> 110 111 <dd><span class="context"><?php echo esc_translation($t->context); ?></span></dd> 111 112 </dl> 112 <?php endif; ?> 113 <?php endif; ?> 113 114 <?php if ( $t->extracted_comment ): ?> 114 <dl> 115 <dt> Comment:</dt>115 <dl> 116 <dt><?php _e('Comment:'); ?></dt> 116 117 <dd><?php echo make_clickable( esc_translation($t->extracted_comment) ); ?></dd> 117 118 </dl> 118 119 <?php endif; ?> 119 120 <?php if ( $t->translation_added && $t->translation_added != '0000-00-00 00:00:00' ): ?> 120 121 <dl> 121 <dt> Date added:</dt>122 <dt><?php _e('Date added:'); ?></dt> 122 123 <dd><?php echo $t->translation_added; ?> GMT</dd> 123 </dl> 124 </dl> 124 125 <?php endif; ?> 125 126 <?php if ( $t->user_login ): ?> 126 127 <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> 130 131 <?php endif; ?> 131 132 132 133 <?php references( $project, $t ); ?> 133 134 134 135 <dl> 135 <dt> Priority of the original:</dt>136 <dt><?php _e('Priority of the original:'); ?></dt> 136 137 <?php if ( $can_write ): ?> 137 138 <?php echo gp_select( 'priority-'.$t->original_id, GP::$original->get_static( 'priorities' ), $t->priority, array('class' => 'priority') ); ?> 138 139 <?php else: ?> … … 143 144 <div class="actions"> 144 145 <?php if ( $can_edit ): ?> 145 146 <button class="ok"> 146 <?php echo $can_approve? 'Add translation →' : 'Suggest new translation →'; ?>147 <?php echo $can_approve? __('Add translation →') : __('Suggest new translation →'); ?> 147 148 </button> 148 <?php endif; ?> 149 <?php endif; ?> 149 150 <a href="#" class="close"><?php _e('Cancel'); ?></a> 150 151 </div> 151 152 </td> -
gp-templates/project.php
44 44 <?php endforeach; ?> 45 45 </ul> 46 46 <?php else: ?> 47 <p> There are no translations of this project.</p>47 <p><?php _e('There are no translations of this project.'); ?></p> 48 48 <?php endif; ?> 49 49 <?php if ( $can_write ): ?> 50 50 <div class="secondary actionlist"> 51 <a href="#" class="personal-options" id="personal-options-toggle"> Personal project options ↓</a>51 <a href="#" class="personal-options" id="personal-options-toggle"><?php _e('Personal project options ↓'); ?></a> 52 52 <div class="personal-options"> 53 53 <form action="<?php echo gp_url_project( $project, '_personal' ); ?>" method="post"> 54 54 <dl> 55 55 <dt><label for="source-url-template"><?php _e('Source file URL'); ?></label></dt> 56 56 <dd> 57 57 <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> 59 59 </dd> 60 60 </dl> 61 61 <p> 62 <input type="submit" name="submit" value=" Save →" 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_e(__('Save →')); ?>" id="save" /> 63 <a class="ternary" href="#" onclick="jQuery('#personal-options-toggle').click();return false;"><?php _e('Cancel'); ?></a> 64 64 </p> 65 65 </form> 66 66 </div> -
gp-templates/install.php
6 6 7 7 gp_tmpl_header(); 8 8 ?> 9 9 10 <?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 15 16 else: 16 17 echo $success_message; 17 18 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 <IfModule mod_rewrite.c> 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 </IfModule> 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 23 if ( $show_htaccess_instructions ): ?> 24 <p> 25 <?php _e('Please add this to your <code>.htaccess</code> file:'); ?> 26 <pre> 27 # BEGIN GlotPress 28 <IfModule mod_rewrite.c> 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 </IfModule> 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> 35 39 <?php endif; ?> 40 36 41 <?php gp_tmpl_footer(); ?> 42 No newline at end of file -
gp-templates/project-form.php
6 6 <dt><label for="project[slug]"><?php _e('Slug'); ?></label></dt> 7 7 <dd> 8 8 <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> 10 10 </dd> 11 11 12 12 <dt><label for="project[description]"><?php _e('Description'); ?></label></dt> … … 15 15 <dt><label for="project[source_url_template]"><?php _e('Source file URL'); ?></label></dt> 16 16 <dd> 17 17 <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> 19 19 </dd> 20 20 21 21 <dt><label for="project[parent_project_id]"><?php _e('Parent Project'); ?></label></dt> 22 22 <dd><?php echo gp_select( 'project[parent_project_id]', $all_project_options, $project->parent_project_id); ?></dd> 23 23 </dl> 24 24 25 <?php echo gp_js_focus_on( 'project[name]' ); ?> 26 No newline at end of file -
gp-templates/404.php
1 1 <?php 2 2 gp_title( __('Not Found < GlotPress') ); 3 3 gp_tmpl_header(); 4 ?> 5 Not Found 6 <?php gp_tmpl_footer(); ?> 7 No newline at end of file 4 5 _e('Not found'); 6 7 gp_tmpl_footer(); 8 ?> 9 No newline at end of file -
gp-templates/translations.php
7 7 ) ); 8 8 wp_enqueue_script( 'editor' ); 9 9 wp_enqueue_script( 'translations-page' ); 10 10 11 // localizer adds var in front of the variable name, so we can't use $gp.editor.options 11 wp_localize_script( 'editor', '$gp_editor_options', compact('can_approve', 'can_write', 'url', 'discard_warning_url', 'set_priority_url') ); 12 wp_localize_script( 'translations-page', '$gp_translations_options', array('action' => $approve_action) ); 12 wp_localize_script( 'editor', '$gp_editor_options', array( 13 'can_approve' => $can_approve, 14 'can_write' => $can_write, 15 'url' => $url, 16 'discard_warning_url' => $discard_warning_url, 17 'set_priority_url' => $set_priority_url, 18 'saving_hellip' => __('Saving…'), 19 'error_start' => __('Error: '), 20 'error_translation' => __('Error saving the translation!'), 21 'setting_prio' => __('Setting priority…'), 22 'set_prio' => __('Priority set!'), 23 'error_prio' => __('Error setting the priority!'), 24 'discarding' => __('Discarding…'), 25 'saved' => __('Saved!') 26 ) ); 27 wp_localize_script( 'translations-page', '$gp_translations_options', array( 28 'action' => $approve_action, 29 'sort_d' => __('Sort ↓'), 30 'sort_u' => __('Sort ↑'), 31 'filt_d' => __('Filter ↓'), 32 'filt_u' => __('Filter ↑'), 33 'bulk_d' => __('Bulk ↓'), 34 'bulk_u' => __('Bulk ↑'), 35 'approv' => __('Approve'), 36 'reject' => __('Reject') 37 ) ); 38 39 13 40 $parity = gp_parity_factory(); 14 41 gp_tmpl_header(); 15 42 $i = 0; 16 43 ?> 17 44 <!-- TODO: use another form for bulk actions --> 18 45 <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 ↓</a> <strong class="separator">•</strong>46 <?php if ( $can_approve ): ?> 47 <a href="#" class="revealing bulk"><?php _e('Bulk ↓'); ?></a> <strong class="separator">•</strong> 21 48 <?php endif; ?> 22 <a href="#" class="revealing filter"> Filter ↓</a> <span class="separator">•</span>23 <a href="#" class="revealing sort"> Sort ↓</a> <strong class="separator">•</strong>49 <a href="#" class="revealing filter"><?php _e('Filter ↓'); ?></a> <span class="separator">•</span> 50 <a href="#" class="revealing sort"><?php _e('Sort ↓'); ?></a> <strong class="separator">•</strong> 24 51 <?php 25 52 $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' ); 53 $filter_links[] = gp_link_get( $url, __('All') ); 54 $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'priority', 'sort[how]' => 'desc', 'filters[status]' => 'either'), $url ), __('Untranslated') ); 55 $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'no', 'sort[by]' => 'random', 'filters[status]' => 'either'), $url ), __('Random Untranslated') ); 30 56 if ( $can_approve ) { 31 57 $filter_links[] = gp_link_get( add_query_arg( array('filters[translated]' => 'yes', 'filters[status]' => 'waiting'), $url ), 32 'Waiting');58 __('Waiting') ); 33 59 $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 60 __('Warnings') ); 61 36 62 } 37 63 // TODO: with warnings 38 64 // TODO: saved searches 39 65 echo implode( ' <span class="separator">•</span> ', $filter_links ); 40 66 ?> 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>67 <dl class="filters-expanded filters hidden clearfix"> 68 <dt><label for="filters[term]"><?php _e('Term:'); ?></label></dt> 69 <dd><input type="text" value="<?php echo gp_esc_attr_with_entities( gp_array_get( $filters, 'term' ) ); ?>" name="filters[term]" id="filters[term]" /></dd> 70 <dt><label for="filters[translated]"><?php _e('With translation:'); ?></label></dt> 45 71 <dd> 46 72 <?php echo gp_radio_buttons('filters[translated]', 47 73 array( 48 'yes' => 'Yes',49 'no' => 'No',50 'either' => 'Either',74 'yes' => __('Yes'), 75 'no' => __('No'), 76 'either' => __('Either'), 51 77 ), gp_array_get( $filters, 'translated', 'either' ) ); 52 ?> 53 </dd> 54 55 <dt><label for="filters[status]"> Status:</label></dt>78 ?> 79 </dd> 80 81 <dt><label for="filters[status]"><?php _e('Status:'); ?></label></dt> 56 82 <dd> 57 83 <?php echo gp_radio_buttons('filters[status]', //TODO: show only these, which user is allowed to see afterwards 58 84 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',85 'current_or_waiting' => __('Current or waiting'), 86 'current' => __('Current only'), 87 'old' => __('Approved, but obsoleted by another string'), 88 'waiting' => __('Waiting approval'), 89 'rejected' => __('Rejected'), 90 'either' => __('Any'), 65 91 ), gp_array_get( $filters, 'status', 'current_or_waiting' ) ); 66 ?> 67 </dd> 92 ?> 93 </dd> 68 94 69 <dd><input type="submit" value=" Filter" name="filter" /></dd>95 <dd><input type="submit" value="<?php esc_attr_e(__('Filter')); ?>" name="filter" /></dd> 70 96 </dl> 71 <dl class="filters-expanded sort hidden clearfix"> 72 <dt> By:</dt>97 <dl class="filters-expanded sort hidden clearfix"> 98 <dt><?php _e('By:'); ?></dt> 73 99 <dd> 74 100 <?php echo gp_radio_buttons('sort[by]', 75 101 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',102 'original_date_added' => __('Date added (original)'), 103 'translation_date_added' => __('Date added (translation)'), 104 'original' => __('Original string'), 105 'translation' => __('Translation'), 106 'priority' => __('Priority'), 107 'references' => __('Filename in source'), 108 'random' => __('Random'), 83 109 ), gp_array_get( $sort, 'by', 'original_date_added' ) ); 84 110 ?> 85 111 </dd> 86 <dt> How:</dt>112 <dt><?php _e('How:'); ?></dt> 87 113 <dd> 88 114 <?php echo gp_radio_buttons('sort[how]', 89 115 array( 90 'asc' => 'Ascending',91 'desc' => 'Descending',116 'asc' => __('Ascending'), 117 'desc' => __('Descending'), 92 118 ), gp_array_get( $sort, 'how', 'desc' ) ); 93 119 ?> 94 120 </dd> 95 <dd><input type="submit" value=" Sort" name="sorts" /></dd>121 <dd><input type="submit" value="<?php esc_attr_e('Sort')); ?>" name="sorts" /></dd> 96 122 </dl> 97 123 <dl class="hidden bulk-actions filters-expanded clearfix"> 98 <dt class="select"> Select:</dt>124 <dt class="select"><?php _e('Select:'); ?></dt> 99 125 <dd> 100 <a href="#" class="all"> All</a>101 <a href="#" class="none"> None</a>126 <a href="#" class="all"><?php _e('All'); ?></a> 127 <a href="#" class="none"><?php _e('None'); ?></a> 102 128 </dd> 103 <dt> Approve:</dt>129 <dt><?php _e('Approve:'); ?></dt> 104 130 <dd> 105 131 <?php echo gp_radio_buttons('bulk[action]', 106 132 array( 107 'approve-all' => 'All',108 'approve-selected' => 'Selected',133 'approve-all' => __('All'), 134 'approve-selected' => __('Selected'), 109 135 ), null ); 110 ?> 136 ?> 111 137 </dd> 112 <dt> Reject:</dt>138 <dt><?php _e('Reject:'); ?></dt> 113 139 <dd> 114 140 <?php echo gp_radio_buttons('bulk[action]', 115 141 array( 116 'reject-all' => 'All',117 'reject-selected' => 'Selected',142 'reject-all' => __('All'), 143 'reject-selected' => __('Selected'), 118 144 ), null ); 119 ?> 145 ?> 120 146 </dd> 121 147 <dd> 122 148 <input type="hidden" name="bulk[redirect_to]" value="<?php echo esc_attr(gp_url_current()); ?>" id="bulk[redirect_to]"> 123 149 <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> Bulk edit works only on the current page.</p>126 </dd> 127 </dl> 128 150 <input type="submit" value="<?php esc_attr_e(__('Approve/Reject')); ?>" name="approve" /> 151 <p class="ternary"><?php _e('<strong>Note:</strong> Bulk edit works only on the current page.'); ?></p> 152 </dd> 153 </dl> 154 129 155 </form> 130 156 131 157 <?php echo gp_pagination( $page, $per_page, $total_translations_count ); ?> 132 158 <table id="translations" class="translations clear"> 133 159 <tr> 134 <th> •</th>135 <th> Prio</th>160 <th><?php _e('•'); ?></th> 161 <th><?php _e('Prio'); ?></th> 136 162 <th class="original"><?php _e('Original string'); ?></th> 137 163 <th class="translation"><?php _e('Translation'); ?></th> 138 164 <th>—</th> 139 165 </tr> 140 166 <?php foreach( $translations as $t ): 141 167 gp_tmpl_load( 'translation-row', get_defined_vars() ); 142 ?> 168 ?> 143 169 <?php endforeach; ?> 144 170 <?php 145 171 if ( !$translations ): 146 172 ?> 147 <tr><td colspan="4"> No translations were found!</td></tr>173 <tr><td colspan="4"><?php _e('No translations were found!'); ?></td></tr> 148 174 <?php 149 175 endif; 150 176 ?> … … 163 189 $footer_links[] = $export_link; 164 190 } 165 191 if ( $can_write ) { 166 $footer_links[] = gp_link_get( gp_url_project( $project, array( $locale->slug, $translation_set->slug, '_permissions' ) ), 'Permissions');192 $footer_links[] = gp_link_get( gp_url_project( $project, array( $locale->slug, $translation_set->slug, '_permissions' ) ), __('Permissions') ); 167 193 } 168 194 echo implode( ' • ', $footer_links ); 169 195 ?> -
gp-templates/helper-functions.php
1 1 <?php 2 3 2 function prepare_original( $text ) { 4 $text = str_replace( array("\r", "\n"), "<span class='invisibles' title=' New line'>↵</span>\n", $text);5 $text = str_replace( "\t", "<span class='invisibles' title=' Tab character'>→</span>\t", $text);3 $text = str_replace( array("\r", "\n"), "<span class='invisibles' title='".esc_attr(__('New line'))."'>↵</span>\n", $text); 4 $text = str_replace( "\t", "<span class='invisibles' title='".esc_attr(__('Tab character'))."'>→</span>\t", $text); 6 5 return $text; 7 6 } 8 7 9 8 function textareas( $entry, $can_edit, $index = 0 ) { 10 9 $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] ) ): 14 14 $referenceable = $entry->warnings[$index]; 15 15 $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 37 38 } 38 39 39 40 /** … … 45 46 46 47 function display_status( $status ) { 47 48 $status = preg_replace( '/^[+-]/', '', $status); 48 return $status ? $status : 'untranslated';49 return $status ? $status : 'untranslated'; 49 50 } 50 51 51 52 function references( $project, $entry ) { 52 53 if ( !$project->source_url_template() ) return; 53 ?>54 References:55 <ul class="refs">56 <?php54 ?> 55 <?php _e('References:'); ?> 56 <ul class="refs"> 57 <?php 57 58 foreach( $entry->references as $reference ): 58 59 list( $file, $line ) = array_pad( explode( ':', $reference ), 2, 0 ); 59 60 // TODO: allow the user to override the project setting 60 61 if ( $source_url = $project->source_url( $file, $line ) ): 61 ?>62 ?> 62 63 <li><a target="_blank" tabindex="-1" href="<?php echo $source_url; ?>"><?php echo $file.':'.$line ?></a></li> 63 64 <?php 64 <?php 65 65 endif; 66 66 endforeach; 67 ?>68 </ul>67 ?> 68 </ul> 69 69 <?php 70 70 } 71 No newline at end of file -
gp-templates/header.php
11 11 <?php gp_head(); ?> 12 12 </head> 13 13 <body> 14 <div id="gp-js-message"></div> 14 <div id="gp-js-message"></div> 15 15 <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_e(__('GlotPress logo')); ?>" src="<?php echo gp_url_img( 'glotpress-logo.png' ); ?>" /> 18 </a> 19 17 20 <?php echo gp_breadcrumb(); ?> 18 21 <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> 24 29 <?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> 26 31 <?php endif; ?> 27 32 </span> 28 33 </h1> -
gp-templates/translation-set-form.php
2 2 <dt><label for="set[locale]"><?php _e('Locale'); ?></label></dt> 3 3 <dd> 4 4 <?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> 6 6 </dd> 7 7 8 8 <dt><label for="set[name]"><?php _e('Name'); ?></label></dt>
