Changeset 633


Ignore:
Timestamp:
Dec 9, 2013, 9:08:12 PM (10 years ago)
Author:
maron
Message:
  • Fixed: ColorNames only the longest not tran
  • Added: Show left last version tran text at original text
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Translation/Form.php

    r630 r633  
    33class PageTranslationForm extends Page
    44{
     5  var $GroupId;
     6  var $ID;
    57  function ReplaceTranslated($orig,$tran,$Text,$ID,$Group) {
    6          $tran_replace = str_replace(' ',' ',$tran);
    7          $orig_replace = str_replace(' ',' ',$orig);
    8 
    9          if (strlen($orig) < strlen($Text)-1) {
     8         $tran_replace = str_replace(' ','&nbsp;',htmlspecialchars($tran));
     9         $orig_replace = str_replace(' ','&nbsp;',htmlspecialchars($orig));
     10
     11       //  if (strlen($orig) < strlen($Text)-1) {
    1012                                  if ($Group <> '') {
    1113              $Text = str_replace(' '.$orig,' <span Title="Přelož jako:&nbsp;'.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
     
    1315              $Text = str_replace(' '.$orig,' <span Title="Přelož jako:&nbsp;'.$tran_replace.'" class="edit"><a class="edit" target="_NEW2" href="'.$this->System->Link('/dictionary/?search='.$tran).'">'.$orig_replace.'</a></span>',$Text);
    1416            }
    15                                  }
     17                        //       }
    1618         return ($Text);
    1719  }
    1820  function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group) {
    19          $orig_replace = str_replace(' ','&nbsp;',$orig);
     21//         echo $orig.'-'.$Text.'<br>';
     22         $orig_replace = str_replace(' ','&nbsp;',htmlspecialchars($orig));
    2023         
    21 //         echo $orig.'-'.$Text.'<br>';
    22          if (strlen($orig) < strlen($Text)-1)
    23                                  $Text = str_replace($orig,' <span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
     24         $Text = str_replace(' '.$orig,' <span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.$this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
    2425                                 return ($Text);
    2526  }
     
    2829        {
    2930    $Text = ' '.$Text;
     31    $Text = str_replace('$B$B','$B$B ',$Text);
    3032   
    3133          $Text = str_replace('$B','<span Title="Znamená odřádkování, překladu zachovej na stejné pozici." class="edit">$B</span>',$Text);
     
    3840          $Text = str_replace('$g','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text);
    3941                foreach($names as $Line) {
    40                         if ($Line[3] <> '') {
     42                 if (($this->ID <> $Line[0]) or ($Line[1] <> $this->GroupId))   
     43      if ($Line[3] <> '')  {
    4144        $Text = $this->ReplaceTranslated($Line[2],$Line[3],$Text,$Line[0],$Line[1]);
    4245       
     
    6568       
    6669                $GroupId = LoadGroupIdParameter();
     70                $this->GroupId = $GroupId;
    6771                $Table = $TranslationTree[$GroupId]['TablePrefix'];
    6872                if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
     
    7276                {
    7377                        $TextID = $_GET['ID'] * 1;
     78                  $this->ID = $TextID;
    7479       
    7580                        $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
     
    8489                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
    8590                                        '(`Language` != '.$this->System->Config['OriginalLanguage'].') AND '.
    86                                         '(`Entry` = '.$Line['Entry'].') LIMIT 1');
     91                                        '(`Entry` = '.$Line['Entry'].') ORDER BY `ModifyTime` DESC LIMIT 1');
    8792                                $LineSearch = $DbResult->fetch_assoc();
    8893                                        foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
  • trunk/includes/Version.php

    r632 r633  
    66// and system will need database update.
    77
    8 $Revision = 632; // Subversion revision
     8$Revision = 633; // Subversion revision
    99$DatabaseRevision = 610; // Database structure revision
    1010$ReleaseTime = '2013-12-08';
Note: See TracChangeset for help on using the changeset viewer.