debug-result.php
54 lines
| 1 | <?php |
| 2 | /* @var Loco_mvc_View $this */ |
| 3 | |
| 4 | $this->extend('debug-form'); |
| 5 | $this->start('header'); |
| 6 | |
| 7 | /* @var Loco_mvc_ViewParams $result */ |
| 8 | if( $result->translated ):?> |
| 9 | <div class="panel panel-success"> |
| 10 | <h3 class="has-icon">Translation result:</h3> |
| 11 | <p><code class="po"><?php $result->e('msgstr')?></code></p> |
| 12 | <p> |
| 13 | This is the translation value returned from the |
| 14 | <a href="<?php $result->e('calleeDoc')?>" target="_blank"><code><?php $result->e('callee')?></code></a> function. |
| 15 | </p> |
| 16 | </div><?php |
| 17 | |
| 18 | else:?> |
| 19 | <div class="panel panel-warning"> |
| 20 | <h3 class="has-icon">String found, but no translation returned</h3> |
| 21 | <p> |
| 22 | The <a href="<?php $result->e('calleeDoc')?>" target="_blank"><code><?php $result->e('callee')?></code></a> function |
| 23 | returned the same value as the source string. Either the string isn't translated, or the required translation file wasn't loaded. |
| 24 | </p> |
| 25 | <p> |
| 26 | See below for the exact string matches we found in your translation files. |
| 27 | </p> |
| 28 | </div><?php |
| 29 | endif; |
| 30 | |
| 31 | |
| 32 | /* @var Loco_mvc_ViewParams[] $matched */ |
| 33 | foreach( $result->matches as $g => $matched ): |
| 34 | /* @var Loco_mvc_FileParams $group */ |
| 35 | $group = $result->grouped[$g];?> |
| 36 | <div class="panel panel-info"> |
| 37 | <h3> |
| 38 | <?php $group->e('type');?> translations: |
| 39 | </h3><?php |
| 40 | foreach( $matched as $file ):?> |
| 41 | <p> |
| 42 | <span class="icon icon-file"> </span> |
| 43 | <code class="path"><?php $file->e('relpath') ?></code> → <code class="po"><?php $file->e('msgstr');?></code> |
| 44 | </p><?php |
| 45 | endforeach; |
| 46 | if( $group->has('href') ):?> |
| 47 | <p> |
| 48 | <span class="icon icon-pencil"> </span> |
| 49 | <a href="<?php $group->e('href')?>">Edit PO</a> |
| 50 | </p><?php |
| 51 | endif;?> |
| 52 | </div><?php |
| 53 | endforeach; |
| 54 |