Changeset 23488 for extensions/plugin_lang_analysis
- Timestamp:
- Jun 24, 2013, 1:23:50 AM (11 years ago)
- Location:
- extensions/plugin_lang_analysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/plugin_lang_analysis/admin.php
r23473 r23488 205 205 unset($string_data); 206 206 207 // unused strings 208 $unused = array(); 209 foreach ($language_files as $name => $path) 210 { 211 $unused = array_merge($unused, array_diff_key($lang_plugin[ $name ], $strings)); 212 } 213 214 foreach ($unused as $string => $translation) 215 { 216 $string_data = array( 217 'files' => array(), 218 'in_common' => array_key_exists($string, $lang_common), 219 'in_admin' => array_key_exists($string, $lang_admin), 220 'in_plugin' => array(), 221 'stat' => 'useless', 222 'is_admin' => false, 223 'warning' => array(l10n('This string is not used anywhere in the plugin')), 224 ); 225 226 foreach ($language_files as $name => $path) 227 { 228 if (array_key_exists($string, $lang_plugin[$name])) $string_data['in_plugin'][] = $name; 229 } 230 231 $strings[ $string ] = $string_data; 232 } 233 207 234 uksort($strings, 'strnatcasecmp'); // natural sort 208 235 $counts['total'] = array_sum($counts); -
extensions/plugin_lang_analysis/main.inc.php
r23473 r23488 21 21 define('PLA_PATH' , PHPWG_PLUGINS_PATH . PLA_ID . '/'); 22 22 define('PLA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PLA_ID); 23 define('PLA_DATA', $conf['data_location'] . PLA_ID . '/');23 define('PLA_DATA', $conf['data_location'] . PLA_ID . '/'); 24 24 25 25 add_event_handler('loc_begin_admin', 'pla_begin_admin'); -
extensions/plugin_lang_analysis/template/analysis.tpl
r23472 r23488 88 88 <td> 89 89 {$string|htmlspecialchars} 90 {if isset($data.warnings)}<span class="iconpla-attention-circled tiptip" title="{'<br>'|@implode:$data.warning }"></span>{/if}90 {if isset($data.warnings)}<span class="iconpla-attention-circled tiptip" title="{'<br>'|@implode:$data.warnings}"></span>{/if} 91 91 </td> 92 92 {if $data.is_admin}<td class="text-admin">{'Admin'|@translate}</td> … … 111 111 <td></td> 112 112 </tr> 113 {foreachelse} 114 <tr class="file string-{$data.stat} useless"> 115 <td></td> 116 <td><i>{'Unused'|@translate}</i></td> 117 {'<td></td>'|str_repeat:(3+$PLA_LANG_FILES|@count)} 118 </tr> 113 119 {/foreach} {* <!-- end file --> *} 114 120 {/foreach} {* <!-- end string --> *} … … 119 125 <th></th> 120 126 <th>{'%d strings : %d missing and %d useless.'|@translate|sprintf:$PLA_COUNTS.total:$PLA_COUNTS.missing:$PLA_COUNTS.useless}</th> 121 <th></th> 122 {foreach from=$PLA_LANG_FILES item=path key=lang_file} 123 <th></th> 124 {/foreach} 125 <th></th> 126 <th></th> 127 {'<th></th>'|str_repeat:(3+$PLA_LANG_FILES|@count)} 127 128 </tr> 128 129 </tfoot>
Note: See TracChangeset
for help on using the changeset viewer.