|
1 | 1 | @echo off
|
| 2 | +set pathofEDASourceFile=%1 |
| 3 | +set FilePath=%~dp0 |
| 4 | + |
| 5 | +::delete --show-dialog after frist start up and setting |
| 6 | +set option=--show-dialog |
2 | 7 |
|
| 8 | +::detect current language of user. |
| 9 | +FOR /F "tokens=3" %%a IN ('reg query "HKCU\Control Panel\Desktop" /v PreferredUILanguages ^| find "PreferredUILanguages"') DO set language=%%a |
| 10 | +set language=%language:~,2% |
| 11 | +if %language%==zh ( |
| 12 | + set PYTHONIOENCODING=utf-8 |
| 13 | + chcp 65001 |
| 14 | + call %FilePath%\i18n\language_zh.bat |
| 15 | +) else ( |
| 16 | + call %FilePath%\i18n\language_en.bat |
| 17 | +) |
3 | 18 | echo -------------------------------------------------------------------------------------------------------------------
|
4 | 19 | echo -------------------------------------------------------------------------------------------------------------------
|
5 | 20 | echo -
|
6 |
| -echo Thank you for using InteractiveHtmlBom |
7 |
| -echo https://github.com/openscopeproject/InteractiveHtmlBom |
8 |
| -echo Bat file by Scarrrr0725 |
| 21 | +echo %i18n_thx4using% |
| 22 | +echo %i18n_gitAddr% |
| 23 | +echo %i18n_batScar% |
9 | 24 | echo -
|
10 | 25 | echo --------------------------------------------------------------------------------------------------------------------
|
11 | 26 | echo --------------------------------------------------------------------------------------------------------------------
|
12 | 27 |
|
13 |
| -::delete --show-dialog after frist start up and setting |
14 |
| -set option=--show-dialog |
15 |
| - |
16 |
| -set FilePath=%~dp0 |
17 | 28 | set pyFilePath=%FilePath%generate_interactive_bom.py
|
18 | 29 |
|
19 | 30 | :convert
|
20 |
| -set /p pathofEDASourceFile=Please Drag the EasyEDA PCB source file here : |
21 |
| - |
22 |
| -echo Converting. . . . . . . . . . |
| 31 | +if not defined pathofEDASourceFile ( |
| 32 | + set /p pathofEDASourceFile=%i18n_draghere% |
| 33 | +) |
| 34 | +echo . |
| 35 | +echo %i18n_converting% |
| 36 | +echo . |
23 | 37 | python %pyFilePath% %pathofEDASourceFile% %option%
|
| 38 | +set pathofEDASourceFile= |
24 | 39 |
|
25 | 40 | echo -------------------------------------------------------------------------------------------------------------------
|
26 | 41 | echo -------------------------------------------------------------------------------------------------------------------
|
27 |
| -echo - |
28 |
| -echo EDA source file is converted to bom successfully! |
29 |
| -echo - |
| 42 | +echo . - |
| 43 | +echo %i18n_converted% |
| 44 | +echo . - |
30 | 45 | echo -------------------------------------------------------------------------------------------------------------------
|
31 | 46 | echo -------------------------------------------------------------------------------------------------------------------
|
32 | 47 |
|
33 |
| -CHOICE /C YN /N /M "Do you want to convert another file? [Y/N" |
| 48 | + |
| 49 | +CHOICE /C YN /N /M "%i18n_again% [ Y/N ]" |
34 | 50 | if errorlevel 2 exit
|
35 | 51 | if errorlevel 1 goto convert
|
0 commit comments