Skip to content

Commit 621368c

Browse files
authored
Added New Fuction and Chinese language (#145)
Added New Function and Chinese language to bat
1 parent 7630401 commit 621368c

File tree

3 files changed

+54
-14
lines changed

3 files changed

+54
-14
lines changed

InteractiveHtmlBom/Run.bat

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,51 @@
11
@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
27

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+
)
318
echo -------------------------------------------------------------------------------------------------------------------
419
echo -------------------------------------------------------------------------------------------------------------------
520
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%
924
echo -
1025
echo --------------------------------------------------------------------------------------------------------------------
1126
echo --------------------------------------------------------------------------------------------------------------------
1227

13-
::delete --show-dialog after frist start up and setting
14-
set option=--show-dialog
15-
16-
set FilePath=%~dp0
1728
set pyFilePath=%FilePath%generate_interactive_bom.py
1829

1930
: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 .
2337
python %pyFilePath% %pathofEDASourceFile% %option%
38+
set pathofEDASourceFile=
2439

2540
echo -------------------------------------------------------------------------------------------------------------------
2641
echo -------------------------------------------------------------------------------------------------------------------
27-
echo -
28-
echo EDA source file is converted to bom successfully!
29-
echo -
42+
echo . -
43+
echo %i18n_converted%
44+
echo . -
3045
echo -------------------------------------------------------------------------------------------------------------------
3146
echo -------------------------------------------------------------------------------------------------------------------
3247

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 ]"
3450
if errorlevel 2 exit
3551
if errorlevel 1 goto convert
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
::start up echo
2+
set i18n_gitAddr= https://github.com/openscopeproject/InteractiveHtmlBom
3+
set i18n_batScar= Bat file by Scarrrr0725
4+
set i18n_thx4using= Thankyou For Using Generate Interactive Bom
5+
6+
::convert
7+
set i18n_draghere=Please Drag the EasyEDA PCB source file here :
8+
set i18n_converting=Converting . . . . . .
9+
10+
::converted
11+
set i18n_again=Do you want to convert another file ?
12+
set i18n_converted= EDA source file is converted to bom successfully!
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
::start up echo
2+
set i18n_gitAddr= https://github.com/openscopeproject/InteractiveHtmlBom
3+
set i18n_batScar= Bat 文件: Scarrrr0725
4+
set i18n_thx4using= 感谢使用 InteractiveHtmlBom
5+
6+
::convert
7+
set i18n_draghere=请将您的EDA PCB源文件拖移至此 :
8+
set i18n_converting=导出中. . . . . . . . . .
9+
10+
::converted
11+
set i18n_again=请问是否转换其他文件 ?
12+
set i18n_converted= 您的EDA源文件已成功导出 Bom !

0 commit comments

Comments
 (0)