Permalink
Browse files

Fixes on 3locales view, fixes 771 (#772)

  • Loading branch information...
TheoChevalier authored and flodolo committed Jul 12, 2016
1 parent 64dda7a commit 132b3d86efaa675b5c51c409104ac755128e2273
Showing with 12 additions and 8 deletions.
  1. +1 −2 app/classes/Transvision/ShowResults.php
  2. +11 −6 app/views/results_entities.php
@@ -343,6 +343,7 @@ public static function resultsTable($search_object, $search_results, $page)
$target_string = Strings::multipleStringReplace($replacements, $target_string);
$clipboard_target_string = 'clip_' . md5($target_string);
$clipboard_target_string2 = 'clip_' . md5($target_string2);
$temp = explode('-', $locale1);
$locale1_short_code = $temp[0];
@@ -410,8 +411,6 @@ public static function resultsTable($search_object, $search_results, $page)
$locale3_path = VersionControl::hgPath($locale3, $current_repo, $key);
}
$clipboard_target_string2 = 'clip_' . md5($target_string2);
$extra_column_rows = "
<td dir='{$direction3}' lang='{$locale3}'>
<span class='celltitle'>{$locale3}</span>
@@ -36,6 +36,11 @@
$source_string = Utils::secureText($tmx_source[$entity]);
$clipboard_target_string = 'clip_' . md5($target_string);
// Don't show meta links by default
$meta_source = $meta_target = $meta_target2 = '';
// 3locales view
if ($url['path'] == '3locales') {
$bz_target_string2 = $target_string2 = isset($tmx_target2[$entity])
@@ -44,6 +49,8 @@
// Highlight non-breaking spaces only after strings have been escaped
$target_string2 = str_replace(' ', '<span class="highlight-gray"> </span>', $target_string2);
$clipboard_target_string2 = 'clip_' . md5($target_string2);
if (in_array($current_repo, ['firefox_ios', 'mozilla_org'])) {
$path_locale3 = VersionControl::gitPath($locale2, $current_repo, $entity);
} else {
@@ -67,15 +74,18 @@
$target_string2 = '<em class="error">Warning: Missing string</em>';
} elseif (! $target_string2) {
$target_string2 = '<em class="error">Warning: Empty string</em>';
} else {
$meta_target2 = "<span class='clipboard' data-clipboard-target='#{$clipboard_target_string2}' alt='Copy to clipboard'><img src='/img/copy_icon_black_18x18.png'></span>";
}
$extra_column_rows = "
<td dir='{$direction3}'>
<span class='celltitle'>{$locale2}</span>
<div class='string'>{$target_string2}</div>
<div class='string' id='{$clipboard_target_string2}'>{$target_string2}</div>
<div dir='ltr' class='result_meta_link'>
<a class='source_link' href='{$path_locale3}'>&lt;source&gt;</a>
{$file_bug}
{$meta_target2}
</div>
</td>";
} else {
@@ -102,14 +112,9 @@
. '">&lt;report a bug&gt;</a>';
$anchor_name = str_replace(['/', ':'], '_', $entity);
$clipboard_target_string = 'clip_' . md5($target_string);
// Get the potential errors for $target_string (final dot, long/small string)
$error_message = ShowResults::buildErrorString($source_string, $target_string);
// Don't show meta links by default
$meta_source = $meta_target = '';
// If there is no source_string, display an error, otherwise display the string + meta links
if (! $source_string) {
$source_string = '<em class="error">Warning: Source string is empty</em>';

0 comments on commit 132b3d8

Please sign in to comment.