Skip to content

Commit deee71d

Browse files
andrewbirdPerditionC
authored andcommitted
I18n: Localise
1/ Add kitten and tnyprntf submodules 2/ Split out strings 3/ Update help for latest options 4/ On gcc move localisation to transient portion
1 parent f73c313 commit deee71d

File tree

10 files changed

+242
-189
lines changed

10 files changed

+242
-189
lines changed

.github/workflows/ci-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
3030
- name: Build
3131
run: |
32-
make clobber
32+
make -C src clobber
3333
env COMPILER=gcc ./build.sh

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "kitten"]
2+
path = kitten
3+
url = https://github.com/FDOS/kitten
4+
[submodule "tnyprntf"]
5+
path = tnyprntf
6+
url = https://github.com/FDOS/tnyprntf

build.bat

+25-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ rem Small
1111
rem set COPT=-c -ms -1 share.c
1212
rem set LOPT=/m /s /c $(LIBS)\c0s.obj share.obj,share.com,,$(LIBS)\cs.lib
1313
rem Tiny
14-
set COPT=-c -mt -1 share.c
15-
set LOPT=/m /s /c /t $(LIBS)\c0t.obj share.obj,share.com,,$(LIBS)\cs.lib
14+
set CFLAGS=-mt -1 -c -o
15+
set LDFLAGS=/m /s /c /t $(LIBS)\c0t.obj $(EXTRA_OBJS) share.obj,share.com,,$(LIBS)\cs.lib
16+
rem tcc looks for includes from the current directory, not the location of the
17+
rem file that's trying to include them, so add kitten's location
18+
set CFLAGS=-I../kitten -I../tnyprntf %CFLAGS%
1619
goto doit
1720

1821
:tcc3
@@ -27,5 +30,25 @@ set LOPT=/m /s /c /t -L$(LIBS) c0t.obj share.obj,share.com,,cs.lib
2730
goto doit
2831

2932
:doit
33+
set EXTRA_OBJS=
34+
35+
set EXTRA_OBJS=%EXTRA_OBJS% kitten.obj
36+
rem # if you want to build without kitten comment the above and uncomment
37+
rem the following
38+
rem set CFLAGS=-DNOCATS %CFLAGS%
39+
40+
set EXTRA_OBJS=%EXTRA_OBJS% tnyprntf.obj
41+
rem # if you want to build without tnyprntf comment the above and uncomment
42+
rem the following
43+
rem set CFLAGS=-DNOPRNTF %CFLAGS%
44+
45+
set UPXARGS=upx --8086 --best
46+
rem if you don't want to use UPX set
47+
rem UPXARGS=-rem
48+
rem if you use UPX: then options are
49+
rem --8086 for 8086 compatibility
50+
rem or
51+
rem --best for smallest
52+
3053
rem We use GNU make for all targets
3154
make -C src

build.sh

+25-6
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22

33
if [ x"${COMPILER}" = "xgcc" ] ; then
44
export CC="ia16-elf-gcc"
5-
export COPT="-mtsr -Wall -fpack-struct -mcmodel=tiny -c share.c -o share.obj -Os"
6-
export XOBJS="gcc_help.obj"
5+
export CFLAGS="-mtsr -Wall -fpack-struct -mcmodel=tiny -c -Os -o"
6+
export EXTRA_OBJS="gcc_help.obj"
77
export LD="ia16-elf-gcc"
8-
export LOPT="-mtsr share.obj ${XOBJS} -o share.com -li86 -Wl,-Map=share.map"
9-
make -C src
8+
export LDFLAGS="-mtsr share.obj \${EXTRA_OBJS} -o share.com -li86 -Wl,-Map=share.map"
109

1110
elif [ x"${COMPILER}" = "xtcc2-emu" ] ; then
1211
if ! $(file "share.c" | grep -q CRLF) ; then
1312
echo "Warning: Turbo C 2.01 doesn't process files with Unix line endings"
1413
echo " Converting ..."
15-
unix2dos "src/share.c"
14+
unix2dos src/share.c kitten/kitten.c kitten/kitten.h tnyprntf/tnyprntf.c tnyprntf/tnyprntf.h
1615
UNDO=1
1716
fi
1817
dosemu -q -td -K . -E "build.bat tcc2"
19-
[ "$UNDO" = "1" ] && dos2unix "src/share.c"
18+
[ "$UNDO" = "1" ] && dos2unix src/share.c kitten/kitten.c kitten/kitten.h tnyprntf/tnyprntf.c tnyprntf/tnyprntf.h
2019
exit $?
2120

2221
elif [ x"${COMPILER}" = "xtcc3-emu" ] ; then
@@ -29,3 +28,23 @@ else
2928
echo "Native compile (Dosemu) : 'tcc2-emu' or 'tcc3-emu'"
3029
exit 1
3130
fi
31+
32+
export EXTRA_OBJS="${EXTRA_OBJS} tnyprntf.obj"
33+
# if you want to build without tnyprntf comment the above and uncomment
34+
# the following
35+
# export CFLAGS="-DNOPRNTF ${CFLAGS}"
36+
37+
export EXTRA_OBJS="${EXTRA_OBJS} kitten.obj"
38+
# if you want to build without kitten comment the above and uncomment
39+
# the following
40+
# export CFLAGS="-DNOCATS ${CFLAGS}"
41+
42+
export UPXARGS="upx --8086 --best"
43+
# if you don't want to use UPX set
44+
# UPXARGS=true
45+
# if you use UPX: then options are
46+
# --8086 for 8086 compatibility
47+
# or
48+
# --best for smallest
49+
50+
make -C src

help/share.en

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
Installs file-sharing and locking capabilities on your hard disk.
2-
3-
SHARE [/F:space] [/L:locks]
4-
1+
SHARE [/F:space] [/L:locks] [/U] [/S] [/O] [/D] [/E]
52
/F:space Allocates file space (in bytes) for file-sharing information.
63
/L:locks Sets the number of files that can be locked at one time.
4+
/U Uninstall a resident instance.
5+
/S Show patch status and table sizes.
6+
/O Only operate if already resident, do not install.
7+
/D Disable a resident instance.
8+
/E Enable a resident instance. (Default.)
9+
10+
Installs file-sharing and locking capabilities on your hard disk.

kitten

Submodule kitten added at 6eed789

nls/share.en

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# English master translation template
3+
#
4+
0.0:Installs file-sharing and locking capabilities on your hard disk.\n
5+
0.1: /F:space Allocates file space (in bytes) for file-sharing information.\n
6+
0.2: /L:locks Sets the number of files that can be locked at one time.\n
7+
0.3:%s [/F:space] [/L:locks]\n
8+
0.4:%s [/F:space] [/L:locks] [/U] [/S] [/O] [/D] [/E]\n
9+
0.5: /U Uninstall a resident instance.\n
10+
0.6: /S Show patch status and table sizes.\n
11+
0.7: /O Only operate if already resident, do not install.\n
12+
0.8: /D Disable a resident instance.\n
13+
0.9: /E Enable a resident instance. (Default.)\n
14+
15+
1.0:%s: parameter out of range!\n
16+
1.1:%s: is already installed!\n
17+
1.2:%s: out of memory!\n
18+
1.3:%s: invalid interrupt 2Fh handler!\n
19+
1.4:%s: installed.\n
20+
21+
1.5:%s: is already installed, but not found on AMIS interrupt!\n
22+
1.6:%s: enabled.\n
23+
1.7:%s: disabled.\n
24+
1.8:%s: cannot be enabled, check TSR version.\n
25+
1.9:%s: cannot be disabled, check TSR version.\n
26+
1.10:%s: is installed resident.\n
27+
1.11:%s: is installed resident, but currently disabled.\n
28+
1.12:%s: no free AMIS multiplex number!\n
29+
1.13:%s: invalid interrupt 2Dh handler!\n
30+
1.14:%s: removed.\n
31+
1.15:%s: cannot remove, not yet installed.\n
32+
1.16:%s: cannot remove, some failure.\n
33+
1.17:%s: cannot remove, handlers hooked AMIS-incompatible.\n
34+
1.18:%s: cannot remove, internal unhook error.\n
35+
1.19:%s: cannot remove, unknown error.\n
36+
1.20:%s: program is not resident!\n
37+
38+
2.0:Program is not resident!\n
39+
2.1:Patch status: not supported by TSR.\n
40+
2.2:Patch status: indeterminate.\n
41+
2.3:Patch status: needed, flag at %04Xh:%04Xh.\n
42+
2.4:Patch status: not needed.\n
43+
2.5:Patch status: unknown.\n
44+
2.6:Patched the share_installed byte of old FreeDOS kernel to zero.\n
45+
2.7:Resident patched the share_installed byte of old FreeDOS kernel to zero.\n
46+
2.8:File table: %u free / %u total, lock table: %u free / %u total\n
47+
2.9:File table: %u total, lock table: %u total\n

src/Makefile

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
share.com: share.obj $(XOBJS)
2-
$(LD) $(LOPT)
1+
VPATH=../kitten ../tnyprntf
2+
3+
all: share.com
4+
5+
6+
ifeq "$(COMPILER)" "gcc"
7+
%.obj: %.ob1
8+
ia16-elf-objcopy \
9+
--rename-section .text=.text.startup \
10+
--rename-section .data=.data.startup \
11+
--rename-section .rodata=.rodata.startup \
12+
--rename-section .bss=.bss.startup \
13+
$^ $@
14+
15+
%.ob1: %.c
16+
else
17+
%.obj: %.c
18+
endif
19+
$(CC) $(CFLAGS)$@ $^
320

421
share.obj: share.c
5-
$(CC) $(COPT)
22+
$(CC) $(CFLAGS)$@ $^
623

724
gcc_help.obj: gcc_help.asm
825
nasm -f elf -I ../lmacros/ -I lmacros/ $< -o $@
926

27+
share.com: share.obj $(EXTRA_OBJS)
28+
$(LD) $(LDFLAGS)
29+
$(UPXARGS) $@
30+
1031
clean:
1132
$(RM) *.obj
1233

0 commit comments

Comments
 (0)