Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Improved translation to WinHelp

Closed / Fixed218990ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:09:01
OriginalBugID: 3679 RFE
Version: 8.2.3
SubmitDate: '1999-11-23'
LastModified: '2000-04-03'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Windows 98
FixedDate: '2000-04-03'
FixedInVersion: 8.3.1
ClosedDate: '2000-10-25'


Name:

Peter Spjuth



CVS:

23 nov 99



ObservedBehavior:

Currently the translation of man pages to WinHelp gives a rather ugly result.

This patch fixes the translation tool in the following ways:

Buggy tabs corrected.

On numbered lists the numbers were not displayed. They are now.

Adjusted paragraph spacing.

Translate right/left double quotes correctly.

Include "Last Change" info



Also included, a fix for listbox.n.



tcltest.n is also broken, but it's hard to make a patch.

The problem is that there are extra carriage returns in the file.

It appears that some line breaks are CRCRLF in stead of CRLF.



Patch:

Index: man2help2.tcl

===================================================================

RCS file: /cvsroot/tcl/tools/man2help2.tcl,v

retrieving revision 1.3

diff -c -r1.3 man2help2.tcl

*** man2help2.tcl1998/09/14 18:40:151.3

--- man2help2.tcl1999/11/23 23:10:32

***************

*** 60,65 ****

--- 60,66 ----

      set state(leftMargin) [getTwips 0.5i]

      set state(nestingLevel) 0

      set state(intl) 0

+     set state(sb) 0

      setTabs 0.5i

  

  # set up international character table

***************

*** 125,130 ****

--- 126,139 ----

      if $state(paragraphPending) {

  puts $file [format "\\par\n\\pard\\fi%.0f\\li%.0f" \

  $state(firstIndent) $state(leftIndent)]

+ foreach tab $state(tabs) {

+     puts $file [format "\\tx%.0f" $tab]

+ }

+ set state(tabs) {}

+ if {$state(sb)} {

+     puts $file "\\sb$state(sb)"

+     set state(sb) 0

+ }

      }

      set state(breakPending) 0

      set state(paragraphPending) 0

***************

*** 146,153 ****

      textSetup

      regsub -all "(\[\\\\\{\}\])" $string {\\\1}  string

      regsub -all {} $string {\\tab } string

!     regsub -all '' $string \"  string

!     regsub -all `` $string \"  string

  

  # Check if this is the beginning of an international character string.

  # If so, look up the sequence in the chars table and substitute the

--- 155,162 ----

      textSetup

      regsub -all "(\[\\\\\{\}\])" $string {\\\1}  string

      regsub -all {} $string {\\tab } string

!     regsub -all '' $string "\\rdblquote "  string

!     regsub -all `` $string "\\ldblquote "  string

  

  # Check if this is the beginning of an international character string.

  # If so, look up the sequence in the chars table and substitute the

***************

*** 293,298 ****

--- 302,308 ----

  }

  LP {

      newPara 0i

+     set state(sb) 80

  }

  ne {

  }

***************

*** 304,311 ****

  puts stderr "Bad .OP macro: .$name [join $args " "]"

      }

      set state(nestingLevel) 0

-     set state(breakPending) 1

      newPara 0i

      setTabs 4c

      text "Command-Line Name:"

      tab

--- 314,321 ----

  puts stderr "Bad .OP macro: .$name [join $args " "]"

      }

      set state(nestingLevel) 0

      newPara 0i

+     set state(sb) 120

      setTabs 4c

      text "Command-Line Name:"

      tab

***************

*** 328,338 ****

      font R

      set state(inTP) 0

      newPara 0.5i

!     set state(breakPending) 1

  }

  PP {

-     set state(breakPending) 1

      newPara 0i

  }

  RE {

      decrNestingLevel

--- 338,348 ----

      font R

      set state(inTP) 0

      newPara 0.5i

!     set state(sb) 80

  }

  PP {

      newPara 0i

+     set state(sb) 120

  }

  RE {

      decrNestingLevel

***************

*** 553,563 ****

  proc setTabs {tabList} {

      global file state

  

      foreach arg $tabList {

  set distance [expr $state(leftMargin) \

    + $state(offset) * $state(nestingLevel) \

    + [getTwips $arg]]

!     puts $file [format "\\tx%.0f" [expr round($distance)]]

      }

  }

  

--- 563,574 ----

  proc setTabs {tabList} {

      global file state

  

+     set state(tabs) {}

      foreach arg $tabList {

  set distance [expr $state(leftMargin) \

    + $state(offset) * $state(nestingLevel) \

    + [getTwips $arg]]

! lappend state(tabs) [expr {round($distance)}]

      }

  }

  

***************

*** 609,616 ****

  # None.

  

  proc pageBreak {} {

!     global file

!     puts $file "\\page"

  }

  

  

--- 620,633 ----

  # None.

  

  proc pageBreak {} {

!     global file curVer

!     if {[string equal $curVer ""]} {

! puts $file {\page}

!     } else {

! puts $file {\par}

! puts $file {\pard\sb400\qc}

! puts $file "Last change: $curVer\\page"

!     }

  }

  

  

***************

*** 741,756 ****

  return

      }

      if {$length == 1} {

- set arg [lindex $argList 0]

- if {$arg == {[1]}} {

-     newPara 0.5i

-     return

- }

- if {[regexp {^\[[0-9]*\]$} $arg] == 1} {

-     newPara 0.5i

-     return

- }

  newPara 0.5i -0.5i

  setTabs 0.5i

  formattedText [lindex $argList 0]

  tab

--- 758,765 ----

  return

      }

      if {$length == 1} {

  newPara 0.5i -0.5i

+ set state(sb) 80

  setTabs 0.5i

  formattedText [lindex $argList 0]

  tab

***************

*** 760,766 ****

  set count [lindex $argList 1]

  set tab [expr $count * 0.1]i

  newPara $tab -$tab

! textSetup

  setTabs $tab

  formattedText [lindex $argList 0]

  tab

--- 769,775 ----

  set count [lindex $argList 1]

  set tab [expr $count * 0.1]i

  newPara $tab -$tab

! set state(sb) 80

  setTabs $tab

  formattedText [lindex $argList 0]

  tab

***************

*** 797,803 ****

      newPara $val -$val

      setTabs $val

      set state(inTP) 1

!     set state(breakPending) 1

  }

  

  

--- 806,812 ----

      newPara $val -$val

      setTabs $val

      set state(inTP) 1

!     set state(sb) 120

  }

  

  

***************

*** 814,820 ****

  # argList -List of arguments to the .TH macro.

  

  proc THmacro {argList} {

!     global file curPkg curSect curID id_keywords state

  

      if {[llength $argList] != 5} {

  set args [join $argList " "]

--- 823,829 ----

  # argList -List of arguments to the .TH macro.

  

  proc THmacro {argList} {

!     global file curPkg curSect curID id_keywords state curVer

  

      if {[llength $argList] != 5} {

  set args [join $argList " "]

***************

*** 823,829 ****

      incr curID

      set name[lindex $argList 0];# Tcl_UpVar

      set page[lindex $argList 1];# 3

!     set vers[lindex $argList 2];# 7.4

      set curPkg[lindex $argList 3];# Tcl

      set curSect[lindex $argList 4];# {Tcl Library Procedures}

      

--- 832,838 ----

      incr curID

      set name[lindex $argList 0];# Tcl_UpVar

      set page[lindex $argList 1];# 3

!     set curVer[lindex $argList 2];# 7.4

      set curPkg[lindex $argList 3];# Tcl

      set curSect[lindex $argList 4];# {Tcl Library Procedures}

      

Index: listbox.n

===================================================================

RCS file: /cvsroot/tk/doc/listbox.n,v

retrieving revision 1.3

diff -r1.3 listbox.n

218c218

< \fIpathName \fBitemcget \fIindex \foption

---

> \fIpathName \fBitemcget \fIindex option\fR



PatchFiles:

man2help2.tcl

    listbox.n





Patched as given for 8.3.1. 
-- 04/03/2000 hobbs
welch Closed ticket [218990ffff]. [History diff]2000-10-26 08:33:07
dgp Ticket [218990ffff]: 3 changes [History diff]2001-04-04 13:09:00
Log in (anonymous is fine) to add a comment.