Language selection added, with a bug in it yet
This commit is contained in:
parent
cea0f4c263
commit
4c62dfaff1
8 changed files with 55 additions and 4 deletions
scripts/windows/coco-dev-setup/batch
6
scripts/windows/coco-dev-setup/batch/get_array.bat
Executable file
6
scripts/windows/coco-dev-setup/batch/get_array.bat
Executable file
|
@ -0,0 +1,6 @@
|
|||
set "file=%1"
|
||||
set /a %3=0
|
||||
for /F "usebackq delims=" %%a in ("%file%") do (
|
||||
set /A %3+=1
|
||||
call set %2[%%%3%%]=%%a
|
||||
)
|
37
scripts/windows/coco-dev-setup/batch/get_language.bat
Executable file
37
scripts/windows/coco-dev-setup/batch/get_language.bat
Executable file
|
@ -0,0 +1,37 @@
|
|||
echo Some feedback is sent in your system's language
|
||||
echo but most feedback is sent and localised by us.
|
||||
echo Here is a list of languages:
|
||||
call print_dashed_seperator
|
||||
|
||||
call get_array localisation\\languages.coco languages language_count
|
||||
for /l %%i in (1,1,%language_count%) do (
|
||||
call get_text !languages[%%i]! "global-native"
|
||||
echo [%%i] !native!
|
||||
)
|
||||
|
||||
goto:get_localisation_id
|
||||
|
||||
:get_localisation_id
|
||||
call print_dashed_seperator
|
||||
set /p "localisation_id=Enter the language ID of your preference and press <ENTER>: "
|
||||
goto:validation_check
|
||||
|
||||
:validation_check
|
||||
set "localisation_is_false="
|
||||
set /a local_id = %localisation_id%
|
||||
if !local_id! EQU 0 set localisation_is_false=1
|
||||
if !local_id! LSS 1 set localisation_is_false=1
|
||||
if !local_id! GTR language_count set localisation_is_false=1
|
||||
if defined localisation_is_false (
|
||||
echo The id you entered is invalid, please try again...
|
||||
goto:get_localisation_id
|
||||
) else (
|
||||
set language_id=!languages[%local_id%]!
|
||||
call get_text %language_id% "global-native"
|
||||
|
||||
call print_dashed_seperator
|
||||
echo You have choosen '%native%' as your language.
|
||||
call get_text %language_id% "global-intro"
|
||||
echo !intro!
|
||||
call print_seperator
|
||||
)
|
|
@ -1 +1,3 @@
|
|||
for /f "delims=" %%a in ('utilities\\get_var.exe localisation\\%1.coco %2') do set "%%a"
|
||||
for /f "delims=" %%a in ('utilities\\get_var.exe localisation\\%1.coco %2') do (
|
||||
set "%%a"
|
||||
)
|
|
@ -1,5 +1,6 @@
|
|||
[global]
|
||||
native=English
|
||||
intro=From now on we'll send you feedback in English!
|
||||
bye=Bye Bye!
|
||||
[install]
|
||||
begin=Installation has begun, this can take a while... Please stay tuned...
|
||||
|
|
2
scripts/windows/coco-dev-setup/batch/localisation/languages.coco
Executable file
2
scripts/windows/coco-dev-setup/batch/localisation/languages.coco
Executable file
|
@ -0,0 +1,2 @@
|
|||
en
|
||||
nl
|
|
@ -1,5 +1,5 @@
|
|||
[global]
|
||||
native=English
|
||||
native=Nederlands
|
||||
bye=Bye Bye!
|
||||
[install]
|
||||
begin=De installatie is begonnen, dit kan een tijdje duren. Geduld alsjeblieft...
|
||||
|
|
|
@ -12,10 +12,12 @@ call get_config author
|
|||
call get_config copyright
|
||||
echo Welcome to the automated Installation of the CodeCombat Dev. Environment!
|
||||
echo v%version% authored by %author% and published by %copyright%.
|
||||
|
||||
call print_seperator
|
||||
|
||||
call sign_license
|
||||
if "%result%"=="false" (exit)
|
||||
|
||||
call get_language
|
||||
|
||||
pause
|
||||
|
||||
endlocal
|
|
@ -11,4 +11,5 @@ call print_dashed_seperator
|
|||
if "%result%"=="false" (
|
||||
echo This setup can't happen without an agreement.
|
||||
set /p res="Installation and Setup of the CodeCombat environment is cancelled."
|
||||
exit
|
||||
)
|
Reference in a new issue