ooxml

Changes On Branch languages
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch languages Excluding Merge-Ins

This is equivalent to a diff from 39d1bdcd33 to 32d02e7be1

2018-08-15
09:17
merged languages check-in: 95744c5775 user: alex tags: trunk
2018-08-14
12:31
fix tools processing instruction check-in: 82a2b34025 user: alex tags: trunk
12:17
adding language support Closed-Leaf check-in: 32d02e7be1 user: alex tags: languages
06:18
tools added check-in: 39d1bdcd33 user: alex tags: trunk
2018-08-10
10:38
examples 6-8 check-in: a1c7b1cb9a user: alex tags: trunk

Changes to ooxml.tcl.

158
159
160
161
162
163
164

165
166
167
168
169
170
171
#     spreadsheet sheet maxcol column title width align sortmode hide
#


package require Tcl 8.6
package require vfs::zip
package require tdom 0.9.0-



namespace eval ::ooxml {
  namespace export xl_sheets xl_read xl_write

  variable defaults
  variable predefNumFmts







>







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#     spreadsheet sheet maxcol column title width align sortmode hide
#


package require Tcl 8.6
package require vfs::zip
package require tdom 0.9.0-
package require msgcat


namespace eval ::ooxml {
  namespace export xl_sheets xl_read xl_write

  variable defaults
  variable predefNumFmts
321
322
323
324
325
326
327









































































328
329
330
331
332
333
334
    mediumDashDotDot
    mediumDashDotDot
    none
    slantDashDot
    thick
    thin
  }









































































}


proc ::ooxml::Default { name value } {
  variable defaults

  switch -- $name {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
    mediumDashDotDot
    mediumDashDotDot
    none
    slantDashDot
    thick
    thin
  }

  msgcat::mcset ar Book \u0627\u0644\u0643\u062a\u0627\u0628
  msgcat::mcset ar Worksheets "\u0623\u0648\u0631\u0627\u0642 \u0627\u0644\u0639\u0645\u0644"
  msgcat::mcset ar Sheet \u0627\u0644\u0648\u0631\u0642\u0629
  msgcat::mcset cs Book Ses\u030cit
  msgcat::mcset cs Worksheets Listy
  msgcat::mcset cs Sheet List
  msgcat::mcset da Book Mappe
  msgcat::mcset da Worksheets Regneark
  msgcat::mcset da Sheet Ark
  msgcat::mcset de Book Mappe
  msgcat::mcset de Worksheets Arbeitsbl\u00e4tter
  msgcat::mcset de Sheet Blatt
  msgcat::mcset el Book \u0392\u03b9\u03b2\u03bb\u03b9\u0301\u03bf
  msgcat::mcset el Worksheets "\u03a6\u03cd\u03bb\u03bb\u03b1 \u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2"
  msgcat::mcset el Sheet \u03a6\u03cd\u03bb\u03bb\u03bf
  msgcat::mcset en Book Book
  msgcat::mcset en Worksheets Worksheets
  msgcat::mcset en Sheet Sheet
  msgcat::mcset es Book Libro
  msgcat::mcset es Worksheets "Hojas de c\u00e1lculo"
  msgcat::mcset es Sheet Hoja
  msgcat::mcset fi Book Tyo\u0308kirja
  msgcat::mcset fi Worksheets Laskentataulukot
  msgcat::mcset fi Sheet Taulukko
  msgcat::mcset fr Book Classeur
  msgcat::mcset fr Worksheets "Feuilles de calcul"
  msgcat::mcset fr Sheet Feuil
  msgcat::mcset he Book \u05d7\u05d5\u05d1\u05e8\u05ea
  msgcat::mcset he Worksheets "\u05d2\u05dc\u05d9\u05d5\u05e0\u05d5\u05ea \u05e2\u05d1\u05d5\u05d3\u05d4"
  msgcat::mcset he Sheet \u05d2\u05d9\u05dc\u05d9\u05d5\u05df
  msgcat::mcset hu Book Munkafu\u0308zet
  msgcat::mcset hu Worksheets Munkalapok
  msgcat::mcset hu Sheet Munkalap
  msgcat::mcset it Book Cartel
  msgcat::mcset it Worksheets "Fogli di lavoro"
  msgcat::mcset it Sheet Foglio
  msgcat::mcset ja Book Book
  msgcat::mcset ja Worksheets \u30ef\u30fc\u30af\u30b7\u30fc\u30c8
  msgcat::mcset ja Sheet Sheet
  msgcat::mcset ko Book "\u1110\u1169\u11bc\u1112\u1161\u11b8 \u1106\u116e\u11ab\u1109\u1165"
  msgcat::mcset ko Worksheets \uc6cc\ud06c\uc2dc\ud2b8
  msgcat::mcset ko Sheet \uc2dc\ud2b8
  msgcat::mcset nl Book Map
  msgcat::mcset nl Worksheets Werkbladen
  msgcat::mcset nl Sheet Blad
  msgcat::mcset no Book Bok
  msgcat::mcset no Worksheets Regneark
  msgcat::mcset no Sheet Ark
  msgcat::mcset pl Book Skoroszyt
  msgcat::mcset pl Worksheets Arkusze
  msgcat::mcset pl Sheet Arkusz
  msgcat::mcset pt Book Livro
  msgcat::mcset pt Worksheets "Folhas de C\u00e1lculo"
  msgcat::mcset pt Sheet Folha
  msgcat::mcset ru Book \u041a\u043d\u0438\u0433\u0430
  msgcat::mcset ru Worksheets \u041b\u0438\u0441\u0442\u044b
  msgcat::mcset ru Sheet \u041b\u0438\u0441\u0442
  msgcat::mcset sl Book Zos\u030cit
  msgcat::mcset sl Worksheets H\u00e1rky
  msgcat::mcset sl Sheet H\u00e1rok
  msgcat::mcset sv Book Bok
  msgcat::mcset sv Worksheets Kalkylblad
  msgcat::mcset sv Sheet Blad
  msgcat::mcset th Book \u0e2a\u0e21\u0e38\u0e14\u0e07\u0e32\u0e19
  msgcat::mcset th Worksheets \u0e40\u0e27\u0e34\u0e23\u0e4c\u0e01\u0e0a\u0e35\u0e15
  msgcat::mcset th Sheet \u0e41\u0e1c\u0e48\u0e19\u0e07\u0e32\u0e19
  msgcat::mcset tr Book Kitap
  msgcat::mcset tr Worksheets "\u00c7al\u0131\u015fma Sayfalar\u0131"
  msgcat::mcset tr Sheet Sayfa
  msgcat::mcset zh Book \u5de5\u4f5c\u7c3f
  msgcat::mcset zh Worksheets \u5de5\u4f5c\u8868
  msgcat::mcset zh Sheet \u5de5\u4f5c\u8868
}


proc ::ooxml::Default { name value } {
  variable defaults

  switch -- $name {
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
      $node0 appendChild [$doc createTextNode false]

    $root appendChild [set node0 [$doc createElement HeadingPairs]]
      set node1 [$node0 appendChild [$doc createElement vt:vector]]
	$node1 setAttribute size 2 baseType variant
	set node2 [$node1 appendChild [$doc createElement vt:variant]]
	  set node3 [$node2 appendChild [$doc createElement vt:lpstr]]
	    $node3 appendChild [$doc createTextNode Arbeitsblätter]
	set node2 [$node1 appendChild [$doc createElement vt:variant]]
	  set node3 [$node2 appendChild [$doc createElement vt:i4]]
	    $node3 appendChild [$doc createTextNode 3]

    $root appendChild [set node0 [$doc createElement TitlesOfParts]]
      set node1 [$node0 appendChild [$doc createElement vt:vector]]
	$node1 setAttribute size $obj(sheets) baseType lpstr
	for {set ws 1} {$ws <= $obj(sheets)} {incr ws} {
	  set node2 [$node1 appendChild [$doc createElement vt:lpstr]]
	    $node2 appendChild [$doc createTextNode Blatt$ws]
	}

    $root appendChild [set node0 [$doc createElement Company]]

    $root appendChild [set node0 [$doc createElement LinksUpToDate]]
      $node0 appendChild [$doc createTextNode false]








|









|







2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
      $node0 appendChild [$doc createTextNode false]

    $root appendChild [set node0 [$doc createElement HeadingPairs]]
      set node1 [$node0 appendChild [$doc createElement vt:vector]]
	$node1 setAttribute size 2 baseType variant
	set node2 [$node1 appendChild [$doc createElement vt:variant]]
	  set node3 [$node2 appendChild [$doc createElement vt:lpstr]]
	    $node3 appendChild [$doc createTextNode [msgcat::mc Worksheets]]
	set node2 [$node1 appendChild [$doc createElement vt:variant]]
	  set node3 [$node2 appendChild [$doc createElement vt:i4]]
	    $node3 appendChild [$doc createTextNode 3]

    $root appendChild [set node0 [$doc createElement TitlesOfParts]]
      set node1 [$node0 appendChild [$doc createElement vt:vector]]
	$node1 setAttribute size $obj(sheets) baseType lpstr
	for {set ws 1} {$ws <= $obj(sheets)} {incr ws} {
	  set node2 [$node1 appendChild [$doc createElement vt:lpstr]]
	    $node2 appendChild [$doc createTextNode [msgcat::mc Sheet]$ws]
	}

    $root appendChild [set node0 [$doc createElement Company]]

    $root appendChild [set node0 [$doc createElement LinksUpToDate]]
      $node0 appendChild [$doc createTextNode false]

Added tools/getlanguageinfo.tcl.

































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
#\
exec tclsh8.6 "$0" "$@"

package require vfs::zip
package require tdom 0.9.0-

proc UnicodeCharsToHex { txt } {
  set new {}
  foreach {a b c d} [split [binary encode hex [encoding convertto unicode $txt]] {}] {
    if {[expr 0x${c}${d}${a}${b}] <= 0x7f} {
      append new [binary decode hex ${c}${d}${a}${b}]
    } else {
      append new \\u $c $d $a $b
    }
  }
  return [string map {\0 {}} $new]
}

foreach file [glob -directory languages *.xlsx] {
  set lang [lindex [split $file -.] 2]
  set files($lang) $file
}

set maptable {}

foreach lang [lsort [array names files]] {
  set file $files($lang)
  set mnt [vfs::zip::Mount $file xlsx]
  set name [lindex [split [UnicodeCharsToHex $file] -.] 0]

  set translation [string trim [file tail $name] 1]
  if {[regexp -all {\s+} $translation]} {
    set translation \"$translation\"
  }
  puts "msgcat::mcset $lang [string trim Book1 1] $translation"

  if {![catch {open xlsx/docProps/app.xml r} fd]} {
    fconfigure $fd -encoding utf-8
    if {![catch {dom parse [read $fd]} doc]} {
      set root [$doc documentElement]
      set idx -1
      foreach node [$root selectNodes -namespaces [list X [$root namespaceURI] vt http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes] {/X:Properties/X:HeadingPairs/vt:vector/vt:variant/vt:lpstr/text()}] {
	set translation [UnicodeCharsToHex [$node nodeValue]]
	if {[regexp -all {\s+} $translation]} {
	  set translation \"$translation\"
	}
	puts "msgcat::mcset $lang Worksheets $translation"
      }
      foreach node [$root selectNodes -namespaces [list X [$root namespaceURI] vt http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes] {/X:Properties/X:TitlesOfParts/vt:vector/vt:lpstr/text()}] {
	set translation [string trim [UnicodeCharsToHex [$node nodeValue]] 1]
	if {[regexp -all {\s+} $translation]} {
	  set translation \"$translation\"
	}
	puts "msgcat::mcset $lang [string trim Sheet1 1] $translation"
      }
      $doc delete
    }
    close $fd
  }

  vfs::zip::Unmount $mnt xlsx
}

Added tools/languages/Bok1-norwegisch-no.xlsx.

cannot compute difference between binary files

Added tools/languages/Bok1-schwedisch-sv.xlsx.

cannot compute difference between binary files

Added tools/languages/Book1-englisch-en.xlsx.

cannot compute difference between binary files

Added tools/languages/Book1-japanisch-ja.xlsx.

cannot compute difference between binary files

Added tools/languages/Cartel1-italienisch-it.xlsx.

cannot compute difference between binary files

Added tools/languages/Classeur1-französisch-fr.xlsx.

cannot compute difference between binary files

Added tools/languages/Kitap1-türkisch-tr.xlsx.

cannot compute difference between binary files

Added tools/languages/Libro1-spanisch-es.xlsx.

cannot compute difference between binary files

Added tools/languages/Livro1-portugiesisch-pt.xlsx.

cannot compute difference between binary files

Added tools/languages/Map1-niederländisch-nl.xlsx.

cannot compute difference between binary files

Added tools/languages/Mappe1-deutsch-de.xlsx.

cannot compute difference between binary files

Added tools/languages/Mappe1-dänisch-da.xlsx.

cannot compute difference between binary files

Added tools/languages/Munkafüzet1-ungarisch-hu.xlsx.

cannot compute difference between binary files

Added tools/languages/Sešit1-tschechisch-cs.xlsx.

cannot compute difference between binary files

Added tools/languages/Skoroszyt1-polnisch-pl.xlsx.

cannot compute difference between binary files

Added tools/languages/Työkirja1-finnisch-fi.xlsx.

cannot compute difference between binary files

Added tools/languages/Zošit1-slowakisch-sl.xlsx.

cannot compute difference between binary files

Added tools/languages/Βιβλίο1-griechisch-el.xlsx.

cannot compute difference between binary files

Added tools/languages/Книга1-russisch-ru.xlsx.

cannot compute difference between binary files

Added tools/languages/חוברת1-hebräisch-he.xlsx.

cannot compute difference between binary files

Added tools/languages/الكتاب1-arabisch-ar.xlsx.

cannot compute difference between binary files

Added tools/languages/สมุดงาน1-thailändisch-th.xlsx.

cannot compute difference between binary files

Added tools/languages/工作簿1-chinesisch-zh.xlsx.

cannot compute difference between binary files

Added tools/languages/통합 문서1-koreanisch-ko.xlsx.

cannot compute difference between binary files