1 | {combine_css path=$PLA_PATH|@cat:"template/style.css"} |
---|
2 | {combine_css path=$PLA_PATH|@cat:"template/fontello/css/fontello_pla.css"} |
---|
3 | |
---|
4 | |
---|
5 | <div class="titrePage"> |
---|
6 | <h2>Plugin Language Analysis</h2> |
---|
7 | </div> |
---|
8 | |
---|
9 | {if isset($U_BACK)} |
---|
10 | <p style="text-align:left;margin-left:20px;"><a href="{$U_BACK}" class="buttonLike">{'Back'|@translate}</a></p> |
---|
11 | {/if} |
---|
12 | |
---|
13 | |
---|
14 | {* <!-- select --> *} |
---|
15 | {if $PLA_STEP=='select'} |
---|
16 | {footer_script}{literal} |
---|
17 | $('form#pla').submit(function() { |
---|
18 | window.location.href = location.href + '&plugin_id=' + $(this).find('select').val(); |
---|
19 | return false; |
---|
20 | }); |
---|
21 | {/literal}{/footer_script} |
---|
22 | |
---|
23 | <form method="GET" action="{$F_ACTION}" class="properties" id="pla"> |
---|
24 | <fieldset> |
---|
25 | <legend>{'How to use?'|@translate}</legend> |
---|
26 | |
---|
27 | <p> |
---|
28 | This tool analyzes each file of the selected plugin, searching for <b>l10n</b>, <b>l10n_dec</b> and <b>translate</b> functions.<br> |
---|
29 | Then it compares the matched strings to the content of the plugin language file and the common and admin core language files.<br> |
---|
30 | Each file of the plugin can be configured as <b>Common</b> (public) or <b>Admin</b>.<br> |
---|
31 | <br> |
---|
32 | When the analysis is complete, each string can have one of these three status : |
---|
33 | </p> |
---|
34 | |
---|
35 | <dl style="margin-left:30px;"> |
---|
36 | <dt class="iconpla-attention">missing</dt> |
---|
37 | <dd> |
---|
38 | not in the plugin language file<br> |
---|
39 | <b>AND</b> not in the common language file<br> |
---|
40 | <b>AND</b> (<br> |
---|
41 | belonging to at least one common file<br> |
---|
42 | <b>OR</b> not in the admin language file<br> |
---|
43 | ) |
---|
44 | </dd> |
---|
45 | |
---|
46 | <dt class="iconpla-attention-circled">useless</dt> |
---|
47 | <dd> |
---|
48 | in the plugin language file<br> |
---|
49 | <b>AND</b> (<br> |
---|
50 | in the common language file<br> |
---|
51 | <b>OR</b> (<br> |
---|
52 | not belonging to any common file<br> |
---|
53 | <b>AND</b> in the admin language file<br> |
---|
54 | )<br> |
---|
55 | ) |
---|
56 | </dd> |
---|
57 | |
---|
58 | <dt class="iconpla-ok-squared">ok</dt> |
---|
59 | <dd> |
---|
60 | any other case |
---|
61 | </dd> |
---|
62 | </dl> |
---|
63 | |
---|
64 | <p> |
---|
65 | You can click the <span class="icon-plus-circled"></span> icon on the left of each string to see where it is located. |
---|
66 | </p> |
---|
67 | </fieldset> |
---|
68 | |
---|
69 | <fieldset> |
---|
70 | <legend>{'Select a plugin'|@translate}</legend> |
---|
71 | |
---|
72 | <select name="plugin_id"> |
---|
73 | {foreach from=$PLA_PLUGINS item=plugin} |
---|
74 | <option value="{$plugin.id}">{$plugin.id} ({$plugin.version})</option> |
---|
75 | {/foreach} |
---|
76 | </select> |
---|
77 | |
---|
78 | <p class="formButtons"><input type="submit" value="{'Continue'|@translate}"></p> |
---|
79 | </fieldset> |
---|
80 | </form> |
---|
81 | |
---|
82 | {* <!-- configure --> *} |
---|
83 | {elseif $PLA_STEP=='config'} |
---|
84 | {footer_script}{literal} |
---|
85 | $('.type-button span').click(function() { |
---|
86 | $(this).siblings('span').removeClass('active'); |
---|
87 | $(this).addClass('active'); |
---|
88 | |
---|
89 | if ($(this).data('type') == 'common') { |
---|
90 | $(this).nextAll('input').val('false'); |
---|
91 | } |
---|
92 | else { |
---|
93 | $(this).nextAll('input').val('true'); |
---|
94 | } |
---|
95 | }); |
---|
96 | {/literal}{/footer_script} |
---|
97 | |
---|
98 | <form method="POST" action="{$F_ACTION}" class="properties"> |
---|
99 | <fieldset> |
---|
100 | <legend>{'Select dependencies'|@translate}</legend> |
---|
101 | |
---|
102 | <b>{'Plugin language file name'|@translate}</b> |
---|
103 | <input type="test" name="filename" value="{$PLA_FILENAME}"> |
---|
104 | <br><br> |
---|
105 | |
---|
106 | {foreach from=$PLA_FILES item=file} |
---|
107 | <div class="type-button"> |
---|
108 | <span class="item {if not $file.is_admin}active{/if}" data-type="common">{'Common'|@translate}</span><!-- |
---|
109 | --><span class="item {if $file.is_admin}active{/if}" data-type="admin">{'Admin'|@translate}</span> |
---|
110 | <input type="hidden" name="files[{$file.path}]" value="{if $file.is_admin}true{else}false{/if}"> |
---|
111 | </div> |
---|
112 | {$file.path}<br> |
---|
113 | {/foreach} |
---|
114 | |
---|
115 | <p class="formButtons"><input type="submit" value="{'Continue'|@translate}"></p> |
---|
116 | </fieldset> |
---|
117 | </form> |
---|
118 | |
---|
119 | {* <!-- analysis --> *} |
---|
120 | {elseif $PLA_STEP=='analysis'} |
---|
121 | {footer_script}{literal} |
---|
122 | $('.strings tr td:first-child').click(function() { |
---|
123 | if ($(this).hasClass('icon-plus-circled')) { |
---|
124 | $(this).removeClass('icon-plus-circled').addClass('iconpla-minus-circled'); |
---|
125 | $(this).next().children('ul').show(); |
---|
126 | } |
---|
127 | else { |
---|
128 | $(this).removeClass('iconpla-minus-circled').addClass('icon-plus-circled'); |
---|
129 | $(this).next().children('ul').hide(); |
---|
130 | } |
---|
131 | }); |
---|
132 | {/literal}{/footer_script} |
---|
133 | |
---|
134 | <fieldset> |
---|
135 | <legend>{$PLA_PLUGIN}</legend> |
---|
136 | |
---|
137 | <table class="strings"> |
---|
138 | <thead> |
---|
139 | <tr> |
---|
140 | <th></th> |
---|
141 | <th class="legend"> |
---|
142 | <span class="missing">{'Missing'|@translate}</span> |
---|
143 | <span class="useless">{'Useless'|@translate}</span> |
---|
144 | </th> |
---|
145 | <th>{'Dependency'|@translate}</th> |
---|
146 | <th>{'In plugin'|@translate}</th> |
---|
147 | <th>{'In common'|@translate}</th> |
---|
148 | <th>{'In admin'|@translate}</th> |
---|
149 | </tr> |
---|
150 | </thead> |
---|
151 | |
---|
152 | <tbody> |
---|
153 | {foreach from=$PLA_STRINGS item=data key=string} |
---|
154 | <tr class="string {$data.stat}"> |
---|
155 | <td class="icon-plus-circled"></td> |
---|
156 | <td> |
---|
157 | {$string|htmlspecialchars} |
---|
158 | <ul> |
---|
159 | {foreach from=$data.files item=lines key=file} |
---|
160 | <li>{$file} <i>({', '|@implode:$lines})</i></li> |
---|
161 | {/foreach} |
---|
162 | </ul> |
---|
163 | </td> |
---|
164 | <td>{if $data.is_admin}{'Admin'|@translate}{else}{'Common'|@translate}{/if}</td> |
---|
165 | <td>{if $data.in_plugin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> |
---|
166 | <td>{if $data.in_common}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> |
---|
167 | <td>{if $data.in_admin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> |
---|
168 | </tr> |
---|
169 | {/foreach} |
---|
170 | </tbody> |
---|
171 | |
---|
172 | <tfoot> |
---|
173 | <tr> |
---|
174 | <th></th> |
---|
175 | <th>{'%d strings : %d missing and %d useless.'|@translate|sprintf:$PLA_COUNTS.total:$PLA_COUNTS.missing:$PLA_COUNTS.useless}</th> |
---|
176 | <th></th> |
---|
177 | <th></th> |
---|
178 | <th></th> |
---|
179 | <th></th> |
---|
180 | </tr> |
---|
181 | </tfoot> |
---|
182 | </table> |
---|
183 | </fieldset> |
---|
184 | |
---|
185 | {/if} |
---|