Language selection added, with a bug in it yet

This commit is contained in:
Glen De Cauwsemaecker 2014-03-23 17:32:54 +01:00
parent cea0f4c263
commit 4c62dfaff1
8 changed files with 55 additions and 4 deletions

View 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
)

View 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
)

View file

@ -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"
)

View file

@ -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...

View file

@ -0,0 +1,2 @@
en
nl

View file

@ -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...

View file

@ -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

View file

@ -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
)