blawk
05-09-2006, 12:38 PM
Hi,
I'm sure many people in this forum may have played or know a bit about GNU/Linux. One of the most easy and fast ways to perform repetitive tasks is to make use of so-called shell scripts (ex. Bash scripts). In MS Windows, we have a (more limited, it doesn't support certain statements and operations, among that you need the ResKit if you want to use complex commands) similar language usually referred as "BATCH".
I was working on the files and setup scripts when I found out that I would need to change the UTC/UTI/DLG files for each language inside the installer. I wrote a short script that will do the job pretty well:
@echo off
REM (c) 2006 blawk - making retro-mod multi-language
REM You should change klang value to one of:
REM English=1 Español=2 Français=3 4=Deutsch 5=Italiano
REM 6=Polski 7=Simplified Chinese 8=Traditional Chinese
REM 9=Korean 10=Japanese
REM -- dlgconv.exe must be in the PATH
SET klang=1
echo ------------------------------------------
echo Files that need to be translated:
echo -- UTI
FOR /R . %%G IN (*.uti) DO (
dlgconv -i %%G -t %klang%)
echo -- Dialog files
FOR /R . %%G IN (*.dlg) DO (
dlgconv -i %%G -t %klang%)
echo -- UTC
FOR /R . %%G IN (*.utc) DO (
dlgconv -i %%G -t %klang%)
echo ------------------------------------------
pause
It can be even more short, just a matter of changing the 'for' statements. As I like to have the otion of a well structured/organized output, I just divided it in 3 sections for UTI, DLG and UTC files. This way you can just redirect the output to a logfile and keep track of the changes.
I'll share other stuff like this as soon as I get ready to release betas of the mod. Moderators, if it applies, feel free to make it sticky/move under the proper sub-forum/section. (Other scripts will get posted in this thread).
BTW, feel free to reply and show your own scripts. I'm sure someone uses something similar to make some tasks easier.
Cheers.
I'm sure many people in this forum may have played or know a bit about GNU/Linux. One of the most easy and fast ways to perform repetitive tasks is to make use of so-called shell scripts (ex. Bash scripts). In MS Windows, we have a (more limited, it doesn't support certain statements and operations, among that you need the ResKit if you want to use complex commands) similar language usually referred as "BATCH".
I was working on the files and setup scripts when I found out that I would need to change the UTC/UTI/DLG files for each language inside the installer. I wrote a short script that will do the job pretty well:
@echo off
REM (c) 2006 blawk - making retro-mod multi-language
REM You should change klang value to one of:
REM English=1 Español=2 Français=3 4=Deutsch 5=Italiano
REM 6=Polski 7=Simplified Chinese 8=Traditional Chinese
REM 9=Korean 10=Japanese
REM -- dlgconv.exe must be in the PATH
SET klang=1
echo ------------------------------------------
echo Files that need to be translated:
echo -- UTI
FOR /R . %%G IN (*.uti) DO (
dlgconv -i %%G -t %klang%)
echo -- Dialog files
FOR /R . %%G IN (*.dlg) DO (
dlgconv -i %%G -t %klang%)
echo -- UTC
FOR /R . %%G IN (*.utc) DO (
dlgconv -i %%G -t %klang%)
echo ------------------------------------------
pause
It can be even more short, just a matter of changing the 'for' statements. As I like to have the otion of a well structured/organized output, I just divided it in 3 sections for UTI, DLG and UTC files. This way you can just redirect the output to a logfile and keep track of the changes.
I'll share other stuff like this as soon as I get ready to release betas of the mod. Moderators, if it applies, feel free to make it sticky/move under the proper sub-forum/section. (Other scripts will get posted in this thread).
BTW, feel free to reply and show your own scripts. I'm sure someone uses something similar to make some tasks easier.
Cheers.