Changeset 108

Show
Ignore:
Timestamp:
Mon Aug 29 15:58:22 2005
Author:
fredrikc
Message:

Prepared more strings for L10N

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/transolution/xliffeditor/gtk_main.py

    r105 r108  
    303 303             f = xliff.files[0]  
    304 304             if not f.getTargetLang():  
    305                   msg = _('Source language=%s\n'%(f.getSourceLang()))  
      305                 msg = _('Source language=%s\n')%(f.getSourceLang())  
    305 305                 msg += _('No target language set for file.\n')  
    306 306                 msg += _('Please enter target language to use.')  
     
    313 313                     drop_down_values = None  
    314 314  
    315                   target_lang = entryDialog(self.window,_('Set target language for "%s"'%(path(fname).basename()) ),msg, _('Target language'),  
      315                 target_lang = entryDialog(self.window,_('Set target language for "%s"')%(path(fname).basename() ) ,msg, _('Target language'),  
    315 315                                           default_response=gtk.RESPONSE_OK,drop_down_values=drop_down_values)  
    316 316                 if target_lang:  
  • trunk/transolution/xliffeditor/gtk_documentviewpanel.py

    r105 r108  
    248 248     def onTuNext(self):  
    249 249         if not(self.open_seg is None):  
    250               raise EditorException('Segment Open')  
      250             raise EditorException(_('Segment Open'))  
    250 250         self.document_control.nextSeg()  
    251 251         self.document_control.grab_focus()  
     
    254 254     def onTuPrev(self):  
    255 255         if not(self.open_seg is None):  
    256               raise EditorException('Segment Open')  
      256             raise EditorException(_('Segment Open'))  
    256 256         self.document_control.prevSeg()  
    257 257         self.document_control.grab_focus()  
     
    264 264     def openTransUnit(self,seg):  
    265 265         if seg.__class__ != TuSegment:  
    266               raise EditorException('Can only open TuSegment segs')  
      266             raise EditorException(_('Can only open TuSegment segments'))  
    266 266  
    267 267         self.open_seg = seg  
     
    297 297     def _segClose(self,commit=False,approve=None,state=None,common_state=None):  
    298 298         if self.open_seg is None:  
    299               raise CloseTUSegmentException('No Segment open')  
      299             raise CloseTUSegmentException(_('No Segment open'))  
    299 299  
    300 300         from transolution.xmlutils import getText  
     
    313 313             print e  
    314 314             if commit and not len(getText(self.open_seg.tu.getTargetNode().childNodes)):  
    315                   raise CloseTUSegmentException('Cant commit when target empty')  
      315                 raise CloseTUSegmentException(_('Cant commit when target empty'))  
    315 315  
    316 316             # commit, approve?  
     
    381 381             # ask what to do  
    382 382             INSERT_NEW,MOVE,CANCEL = 1,2,gtk.RESPONSE_CANCEL  
    383               buttons = (("Move Existing", MOVE),  
    384                          ("Insert new copy",INSERT_NEW),  
      383             buttons = ((_("Move Existing"), MOVE),  
      384                        (_("Insert new copy"),INSERT_NEW),  
    385 385                        (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))  
    386 386              
    387 387             res = askDialog(self.win,  
    388                               'Tag already exists in target',  
    389                               'Target already have tag(s) choose action.',  
      388                             _('Tag already exists in target'),  
      389                             _('Target already have tag(s) choose action'),  
    390 390                             buttons)  
    391 391             if res == INSERT_NEW:  
     
    404 404             tags = list(tmodel.getTagNodeByID(id))  
    405 405             if not tags:  
    406                   raise EditorException('no tags with id:"%s" found'%(id,))  
      406                 raise EditorException(_('no tags with id:"%s" found')%(id,))  
    406 406  
    407 407         # should tags be inserted with new id?  
     
    420 420             if not((bpt.tagName == 'bpt' and ept.tagName == 'ept') or  
    421 421                (bpt.tagName == 'bx' and ept.tagName == 'ex')):  
    422                   raise EditorException('Illegal paired tags')  
      422                 raise EditorException(_('Illegal paired tags'))  
    422 422  
    423 423             start,end = self.target_control.get_buffer().getSelection()  
     
    430 430             tmodel.pasteNodesAtTextIndexWithUndo(end,[ept,],interactive=False)  
    431 431         else:  
    432               raise EditorException('Illegal number of tags with id found:%s'%(id,))  
      432             raise EditorException(_('Illegal number of tags with id found:%s')%(id,))  
    432 432  
    433 433  
     
    447 447         self._assertMainTuIsOpen()  
    448 448         try:  
    449               if i < 0: raise IndexError('negative alttrans index not supported')  
      449             if i < 0: raise IndexError(_('negative alttrans index not supported'))  
    449 449             alttrans = list(self.open_seg.tu.getAltTrans())[i]  
    450 450         except IndexError,e:  
    451               raise EditorException('alttrans index ut of range:%i'%(i,))  
      451             raise EditorException(_('alttrans index ut of range:%i')%(i,))  
    451 451  
    452 452         try: targetnode = alttrans.target_nodes[sub_target_index]  
    453 453         except IndexError,e:  
    454               raise EditorException('alttrans sub target index ut of range:%i'%(sub_target_index,))  
      454             raise EditorException(_('alttrans sub target index ut of range:%i')%(sub_target_index,))  
    454 454         #insert the alt trans with undo  
    455 455         self._replaceTargetNodesWithUndo(targetnode.childNodes)  
     
    501 501     def _assertMainTuIsOpen(self):  
    502 502         if self.open_seg is None:  
    503               raise EditorException('No Segment open')  
      503             raise EditorException(_('No Segment open'))  
    503 503         elif self.sub_seg and self.sub_seg.parent:  
    504               raise EditorException('Operation not permitted in a sub seg')  
      504             raise EditorException(_('Operation not permitted in a sub seg'))  
    504 504  
    505 505     def close(self):  
    506 506         if self.open_seg:  
    507               raise EditorException('Cant close when theres a open TU')  
      507             raise EditorException(_('Cant close when theres a open TU'))  
    507 507         else:  
    508 508             # Do some cleanup to free objects  
     
    534 534         m = None  
    535 535         if not tm.tm:  
    536               raise EditorException('No TM connection')  
      536             raise EditorException(_('No Translation Memory connected'))  
    536 536              
    537 537         m = list(tm.tm.lookup(self.sub_seg.tu.getSourceNode()))[0]  
     
    594 594             bg_color = 'bg_lightyellow' # 'bg_lightgray'  
    595 595         # show match quality  
    596           text_buffer.insert_with_tags_by_name(iter, 'Match quality:%0.3f\n'%(float(m.quality),), bg_color,'fg_black')  
      596         text_buffer.insert_with_tags_by_name(iter, _('Match quality:%0.3f\n')%(float(m.quality),), bg_color,'fg_black')  
    596 596  
    597 597         # Show difference in diff textview  
     
    688 688     def _askWrapSearch(self):  
    689 689         'Ask for wrap around search'  
    690           res = askOk(self.search_dlg,'End reached', 'End reached, wrap around and continue?')  
      690         res = askOk(self.search_dlg,_('End reached'), _('End reached, wrap around and continue?'))  
    690 690         return res  
    691 691  
     
    696 696            raises CloseCancelTUSegmentException if cancel  
    697 697         '''  
    698           res = askOk(parent_dialog,'Commit?','Current segment changed, do you want to commit?')  
      698         res = askOk(parent_dialog,_('Commit?'),_('Current segment changed, do you want to commit?'))  
    698 698         if not res:  
    699 699             raise CloseCancelTUSegmentException()  
     
    724 724         if s['replace_all']:  
    725 725             replaced = self.replaceAll(s,search_dlg)  
    726               messageDialog(search_dlg,'replaced:%d'%(replaced,))  
      726             messageDialog(search_dlg,_('replaced:%d')%(replaced,))  
    726 726  
    727 727             return  
  • trunk/transolution/xliffeditor/gtk_tustatus.py

    r99 r108  
    216 216          
    217 217     def alertException(self,e,msg):  
    218           messageDialog(self.window,"Error","%s:%s"%(msg,e))  
      218         messageDialog(self.window,_("Error"),"%s:%s"%(msg,e))  
    218 218         print e,msg  
    219 219  
  • trunk/transolution/xliffeditor/xliffparser_ng.py

    r91 r108  
    85 85         if path(fname).isfile():  
    86 86             if not zipfile.is_zipfile(fname):  
    87                   raise XlzFileException('File not a zip:%s'%(fname,))  
      87                 raise XlzFileException(_('File not a zip:%s')%(fname,))  
    87 87         else:  
    88               raise XlzFileException('not a file:%s'%(fname,))  
      88             raise XlzFileException(_('not a file:%s')%(fname,))  
    88 88  
    89 89  
     
    248 248     def parseSkeleton(self):  
    249 249         if (not self.header) or (not self.header.skl):  
    250               raise XliffException('Xliff has no skeleton file')  
      250             raise XliffException(_('Xliff has no skeleton file'))  
    250 250         if self.xlz:  
    251 251             skl = StringIO(self.xlz.read(self.header.skl))  
     
    256 256             self.skeleton = Skeleton(skl)  
    257 257         except (IOError,SklFileException),e:  
    258               raise XliffException('Cant open skeleton file:%s'%(e,))  
      258             raise XliffException(_('Cant open skeleton file:%s')%(e,))  
    258 258         return self.skeleton  
    259 259  
     
    285 285             self.skldoc = loadXml(skl_file)  
    286 286         except IOError,e:  
    287               raise SklFileException('Failed to load skeleton file')  
      287             raise SklFileException(_('Failed to load skeleton file'))  
    287 287         except Exception,e:  
    288               raise SklFileException('Skeleton file format not supported')  
      288             raise SklFileException(_('Skeleton file format not supported'))  
    288 288  
    289 289         try:self.parse()  
    290 290         except XmlError,e:  
    291               raise SklFileException('Skeleton file format not supported')  
      291             raise SklFileException(_('Skeleton file format not supported'))  
    291 291              
    292 292     def parse(self):  
  • trunk/transolution/xliffeditor/gtk_noteedit.py

    r98 r108  
    76 76  
    77 77         # Add Colums  
    78           for name,COL in (('Priority',COLUMN_PRIORITY),('Annotates',COLUMN_ANNOTATES),('From',COLUMN_FROM),('Note Value',COLUMN_VALUE)):  
      78         for name,COL in ((_('Priority'),COLUMN_PRIORITY),(_('Annotates'),COLUMN_ANNOTATES),(_('From'),COLUMN_FROM),(_('Note Value'),COLUMN_VALUE)):  
    78 78             renderer = gtk.CellRendererText()  
    79 79             renderer.connect("edited", self.onCellEdited, model)  
     
    129 129                 print "Priority Edited!"  
    130 130                 if int(new_text) not in range(1,11):  
    131                       raise NoteValueException('Priority must be between 1 and 10 (default 1)')  
      131                     raise NoteValueException(_('Priority must be between 1 and 10 (default 1)'))  
    131 131                 note.priority = str(new_text)  
    132 132                 model.set(iter, column, int(note.priority))  
     
    139 139                 print "annotates Edited!"  
    140 140                 if new_text not in ('general','source','target'):  
    141                       raise NoteValueException("annotates value must be 'general','source' or 'target'(default 'general')")  
      141                     raise NoteValueException(_("annotates value must be 'general','source' or 'target'(default 'general')"))  
    141 141                 note.annotates = new_text  
    142 142                 model.set(iter, column, note.annotates)  
     
    147 147                 model.set(iter, column, note.getValue())  
    148 148         except NoteValueException,e:  
    149               self.alertException(e,'Error setting note value')  
      149             self.alertException(e,_('Error setting note value'))  
    149 149  
    150 150