Skip to content

Commit 98f91e2

Browse files
committed
Improved gettext build scripts for Windows systems.
1 parent 1866c3d commit 98f91e2

5 files changed

Lines changed: 38 additions & 6 deletions

File tree

i18n-compile.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ foreach po [glob -nocomplain -directory $I18N_PO_DIR -type f "*.po"] {
3939
set lang [string range $name 0 [expr {$pos - 1}]]
4040
set msg [file join $SRC_MSGS_DIR [concat $name ".msg"]]
4141

42-
if { [catch {exec $MSGFMT --tcl $po -l $lang -d $SRC_MSGS_DIR} result] } {
42+
if { [catch {exec $MSGFMT --tcl [file nativename $po] -l $lang -d [file nativename $SRC_MSGS_DIR]} result] } {
4343
puts "ERROR: Can't compile translation!"
4444
puts "at: $po"
4545
puts $::errorInfo

i18n-extract.tcl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ cd $SRC_APP_DIR
3131
foreach tcl [glob -nocomplain -directory $SRC_APP_DIR -type f "*.tcl"] {
3232
puts "process $tcl"
3333
set f [file tail $tcl]
34-
if { [catch {exec $XGETTEXT -j -c -o $I18N_POT -L Tcl -k_ --copyright-holder=$AUTHOR_NAME --msgid-bugs-address=$AUTHOR_EMAIL --package-name=$PROJECT --package-version=$VERSION $f} result] } {
34+
if { [catch {exec $XGETTEXT -j -c -o [file nativename $I18N_POT] -L Tcl -k_ --copyright-holder=$AUTHOR_NAME --msgid-bugs-address=$AUTHOR_EMAIL $f} result] } {
3535
puts "ERROR: Can't extract translation!"
3636
puts "from: $tcl"
3737
puts $::errorInfo
3838
}
3939
}
40-
41-

i18n-merge.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if {$MSGMERGE == "" || ![file isfile $MSGMERGE] || ![file executable $MSGMERGE]}
2323

2424
foreach po [glob -nocomplain -directory $I18N_PO_DIR -type f "*.po"] {
2525
puts "merge $po"
26-
if { [catch {exec $MSGMERGE -q -U $po $I18N_POT} result] } {
26+
if { [catch {exec $MSGMERGE -q -U [file nativename $po] [file nativename $I18N_POT]} result] } {
2727
puts "ERROR: Can't merge translation!"
2828
puts "at: $po"
2929
puts $::errorInfo

utils/touch.bat

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@echo off
2+
goto :TopOfCode
3+
4+
================================================================================
5+
6+
Create an empty file at the specified path.
7+
8+
Copyright (c) 2015-2017 OpenIndex.de
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in
18+
all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+
THE SOFTWARE.
27+
28+
================================================================================
29+
30+
:TopOfCode
31+
32+
set FILE=%1
33+
type nul >>%FILE% & copy %FILE% +,,

utils/utils.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ proc touch {path} {
122122
return
123123
}
124124
if {[is_windows]} {
125-
if {[catch {exec copy "/b" "$path" "+,,"} result]} {
125+
global UTILS_DIR
126+
if {[catch {exec [file nativename [file join $UTILS_DIR touch.bat]] [file nativename $path]} result]} {
126127
puts "ERROR: Can't execute touch!"
127128
if {$result != ""} { puts $result }
128129
puts $::errorInfo

0 commit comments

Comments
 (0)