Changeset 629


Ignore:
Timestamp:
Dec 7, 2013, 1:42:02 PM (11 years ago)
Author:
maron
Message:
  • Added: Colore special chars ($b,$n,$r,$g)
  • Fixed: Url to dictionary from Translation/Form.php
  • Added: If open original text, fill right side with tran. text
Location:
trunk
Files:
2 edited

Legend:

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

    r628 r629  
    77         $orig_replace = str_replace(' ',' ',$orig);
    88
    9          if (strlen($orig) < strlen($Text)-1)
    10                                   $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);
    11                                  return ($Text);
     9         if (strlen($orig) < strlen($Text)-1) {
     10                                  if ($Group <> '') {
     11              $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);
     12            } else { 
     13              $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);
     14            }
     15                                 }
     16         return ($Text);
    1217  }
    1318  function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group) {
     
    2328        {
    2429    $Text = ' '.$Text;
     30   
     31          $Text = str_replace('$B','<span Title="Znamená odřádkování, překladu zachovej na stejné pozici." class="edit">$B</span>',$Text);
     32          $Text = str_replace('$N','<span Title="Znamená jméno hráče, překladu zachovej na stejné pozici." class="edit">$N</span>',$Text);
     33          $Text = str_replace('$R','<span Title="Znamená rasu hráče, překladu zachovej na stejné pozici." class="edit">$R</span>',$Text);
     34          $Text = str_replace('$G','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text);
     35          $Text = str_replace('$b','<span Title="Znamená odřádkování, překladu zachovej na stejné pozici." class="edit">$B</span>',$Text);
     36          $Text = str_replace('$n','<span Title="Znamená jméno hráče, překladu zachovej na stejné pozici." class="edit">$N</span>',$Text);
     37          $Text = str_replace('$r','<span Title="Znamená rasu hráče, překladu zachovej na stejné pozici." class="edit">$R</span>',$Text);
     38          $Text = str_replace('$g','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text);
    2539                foreach($names as $Line) {
    2640                        if ($Line[3] <> '') {
     
    6680                        } else
    6781                        {       
    68                                 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
     82                          if ($this->System->Config['OriginalLanguage'] == $Line['Language']){
     83          $LineAJ = $Line;
     84                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
     85                                        '(`Language` != '.$this->System->Config['OriginalLanguage'].') AND '.
     86                                        '(`Entry` = '.$Line['Entry'].') LIMIT 1');
     87                                $LineSearch = $DbResult->fetch_assoc();
     88                                        foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     89                                                if($TextItem['Visible'] == 1)
     90                                                if (($LineAJ[$TextItem['Column']] <> '') and ($LineSearch[$TextItem['Column']] <> '')) $Line[$TextItem['Column']] = $LineSearch[$TextItem['Column']];
     91
     92        } else {
     93                                $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE '.
    6994                                        '(`Language` = '.$this->System->Config['OriginalLanguage'].') AND '.
    7095                                        '(`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');
    71                                 $LineAJ = $DbResult->fetch_assoc();
     96                                $LineAJ = $DbResult->fetch_assoc();
     97        }
    7298                                if(!$LineAJ)
    7399                                {
     
    151177                                                $Output .= '<form action="save.php?group='.$GroupId.'" method="post"><div>';
    152178                                                // TODO: Remove fixed group id condition
    153                                                 if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
     179                                        //      if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
    154180                                                        $Output .= '<a href="'.$this->System->Link('/dictionary/?action=group&amp;group='.$GroupId.'&amp;ID='.$LineAJ['ID']).'" target="_blank"  title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>';
    155181                                                $Output .= ' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" />'.
  • trunk/includes/Version.php

    r628 r629  
    66// and system will need database update.
    77
    8 $Revision = 628; // Subversion revision
     8$Revision = 629; // Subversion revision
    99$DatabaseRevision = 610; // Database structure revision
    1010$ReleaseTime = '2013-12-04';
Note: See TracChangeset for help on using the changeset viewer.