中文语言包完善


主界面细节汉化

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

/opt/unetlab/html/store/public/main/pages/main.html

修改位置:

image-20231202202920310

image-20231202204622225

一键修改脚本:

警告

注意!old_text_13需要手动修改!搜索关键字to</button即可

#!/bin/bash

file_path="/opt/unetlab/html/store/public/main/pages/main.html"

old_text_1="Add new folder"
new_text_1="创建新的文件夹 "
old_text_2="Add new lab"
new_text_2="创建新的沙箱"
old_text_3="Change item's name"
new_text_3="修改所选项名称"
old_text_4="Move to ..."
new_text_4="移动到..."
old_text_5="Move to ..."
new_text_5="移动到..."
old_text_6="Delete selected items"
new_text_6="删除所选项"
old_text_7="Import"
new_text_7="导入沙箱"
old_text_8="Export"
new_text_8="导出所选沙箱"
old_text_9="Sort name"
new_text_9="根据名称排序"
old_text_10="Sort time"
new_text_10="根据创建时间排序"
old_text_11="Refresh"
new_text_11="刷新"

old_text_12="Rename</button>"
new_text_12="{{lang('Rename')}}</button>"
#old_text_13="Move to</button>"
#new_text_13="{{lang('Move to')}}</button>"

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"
sed -i "s/$old_text_5/$new_text_5/g" "$file_path"
sed -i "s/$old_text_6/$new_text_6/g" "$file_path"
sed -i "s/$old_text_7/$new_text_7/g" "$file_path"
sed -i "s/$old_text_8/$new_text_8/g" "$file_path"
sed -i "s/$old_text_9/$new_text_9/g" "$file_path"
sed -i "s/$old_text_10/$new_text_10/g" "$file_path"
sed -i "s/$old_text_11/$new_text_11/g" "$file_path"
sed -i "s|$old_text_12|$new_text_12|g" "$file_path"
#sed -i "s|$old_text_13|$new_text_13|g" "$file_path"

主界面LBA创建时间显示格式修改

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/includes/api_folders.php

搜索关键字:d M Y H:i

修改为:Y年m月d日 H:i

image-20231202210735030

image-20231202205924729

修改脚本:

#!/bin/bash

file_path="/opt/unetlab/html/includes/api_folders.php"

old_text_1="d M Y H:i"
new_text_1="Y年m月d日 H:i"
old_text_2="d M Y  H:i"
new_text_2="Y年m月d日 H:i"

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"

沙箱管理(Running Lab Sessions)

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-Lab_sessionsView-js.js

搜索关键字1:"Search Lab"

修改为:lang("Search Lab")

image-20231202211807993

搜索关键字2:"Columns"

修改为:lang("Columns")

image-20231202212447272

搜索关键字3:" Refresh"

修改为:lang(" Refresh")

image-20231202212821510

搜索关键字4:"Actions"

修改为:lang("Actions")

image-20231202213320984

搜索关键字5:"STT"

修改为:lang("STT")

image-20231202213347741

搜索关键字6:"Hard Disk"

修改为:lang("Hard Disk")

image-20231202213956376

搜索关键字7:"CPU"

修改为:lang("CPU")

搜索关键字8:"RAM"

修改为:lang("RAM")

搜索关键字9:"Total: "

修改为:lang("LAB Total: ")

image-20231202214635389

搜索关键字10:"Default"

修改为:lang("Default")

修改脚本:

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-Lab_sessionsView-js.js"

old_text_1='"Search Lab"'
new_text_1='lang("Search Lab")'
old_text_2='"Columns"'
new_text_2='lang("Columns")'
old_text_3='" Refresh"'
new_text_3='lang(" Refresh")'
old_text_4='"Actions"'
new_text_4='lang("Actions")'
old_text_5='"STT"'
new_text_5='lang("STT")'
old_text_6='"Hard Disk"'
new_text_6='lang("Hard Disk")'
old_text_7='"CPU"'
new_text_7='lang("CPU")'
old_text_8='"RAM"'
new_text_8='lang("RAM")'
old_text_9='"Total: "'
new_text_9='lang("LAB Total: ")'
old_text_10='"Refresh"'
new_text_10='lang(" Refresh")'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
sed -i "s|$old_text_5|$new_text_5|g" "$file_path"
sed -i "s|$old_text_6|$new_text_6|g" "$file_path"
sed -i "s|$old_text_9|$new_text_9|g" "$file_path"
sed -i "s|$old_text_10|$new_text_10|g" "$file_path"

账号(Accounts)

1)用户管理(Users Management)

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-UsersOffline-js.js

搜索关键字1:"Columns"

修改为:lang("Columns")

image-20231202215403370

搜索关键字2:"STT"

修改为:lang("STT")

image-20231202224234262

搜索关键字3:"Maximum Accounts: "

修改为:lang("Maximum Accounts: ")

image-20231202224216135

搜索关键字4:"Box's ID: "

修改为:lang("Box's ID: ")

image-20231202224224856

搜索关键字5:.format("llll")

修改为:.format("YYYY年MM月DD日 HH:mm")

一共三个

image-20231202222838098

搜索关键字6:"Edit"

修改为:lang("Edit"))

image-20231202223236321

搜索关键字7:" Refresh"

修改为:lang(" Refresh"))

image-20231202223702033

搜索关键字8:"CPU Limit"

修改为:lang("CPU Limit"))

搜索关键字9:"RAM Limit"

修改为:lang("RAM Limit"))

搜索关键字10:"Hard disk Limit"

修改为:lang("Hard disk Limit")

image-20231202224430848

搜索关键字11:"Total: "

修改为:lang("User Total: ")

image-20231202224723859

搜索关键字12:"Are you sure?"

修改为:lang("Are you sure?")

搜索关键字13:"You won't be able to revert this!"

修改为:lang("You won't be able to revert this!")

搜索关键字14:"Yes, delete it!"

修改为:lang("Yes, delete it!")

搜索关键字15:"Add Row"

修改为:lang("Add Row")

搜索关键字16:"Edit Multi rows"

修改为:lang("Edit Multi rows")

lang("Add Row")

>注意!13、14需要手动修改

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-UsersOffline-js.js"

old_text_1='"Columns"'
new_text_1='lang("Columns")'

old_text_2='"STT"'
new_text_2='lang("STT")'

old_text_3='"Maximum Accounts: "'
new_text_3='lang("Maximum Accounts: ")'

#old_text_4='"Box\'s ID: "'
#new_text_4='lang("Box\'s ID: ")'

old_text_5='.format("llll")'
new_text_5='.format("YYYY年MM月DD日 HH:mm")'

old_text_6='"Edit"'
new_text_6='lang("Edit")'

old_text_7='" Refresh"'
new_text_7='lang(" Refresh")'

old_text_8='"CPU Limit"'
new_text_8='lang("CPU Limit")'

old_text_9='"RAM Limit"'
new_text_9='lang("RAM Limit")'

old_text_10='"Hard disk Limit"'
new_text_10='lang("Hard disk Limit")'

old_text_11='"Total: "'
new_text_11='lang("User Total: ")'

old_text_12='"Are you sure?"'
new_text_12='lang("Are you sure?")'

#old_text_13='"You won't be able to revert this!"'
#new_text_13='lang("You won't be able to revert this!")'

old_text_14='"Yes, delete it!"'
new_text_14='lang("Yes, delete it!")'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
#sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
sed -i "s|$old_text_5|$new_text_5|g" "$file_path"
sed -i "s|$old_text_6|$new_text_6|g" "$file_path"
sed -i "s|$old_text_7|$new_text_7|g" "$file_path"
sed -i "s|$old_text_8|$new_text_8|g" "$file_path"
sed -i "s|$old_text_9|$new_text_9|g" "$file_path"
sed -i "s|$old_text_10|$new_text_10|g" "$file_path"
sed -i "s|$old_text_11|$new_text_11|g" "$file_path"
sed -i "s|$old_text_12|$new_text_12|g" "$file_path"
sed -i "s|$old_text_14|$new_text_14|g" "$file_path"

2)角色管理

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-User_rolesView-js.js

搜索关键字1:"Columns"

修改为:lang("Columns")

搜索关键字2:"STT"

修改为:lang("STT")

搜索关键字3:"Total: "

修改为:lang("ROLE Total: ")

搜索关键字4:" Refresh"

修改为:lang(" Refresh")

image-20231202225530951

搜索关键字5:"Refresh"

修改为:`lang("Refresh")

搜索关键字6:"Add Row"

修改为:lang("Add Row")

搜索关键字7:"Edit Row"

修改为:lang("Edit Row")

搜索关键字8:"Are you sure?"

修改为:lang("Are you sure?")

搜索关键字9:"You won't be able to revert this!"

修改为:lang("You won't be able to revert this!")

搜索关键字10:"warning"

修改为:lang("warning")

搜索关键字11:"Yes, delete it!"

修改为:lang("Yes, delete it!")

搜索关键字12:"warning"

修改为:lang("warning")

修改脚本

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-User_rolesView-js.js"

old_text_1='"Columns"'
new_text_1='lang("Columns")'

old_text_2='"STT"'
new_text_2='lang("STT")'

old_text_3='"Total: "'
new_text_3='lang("ROLE Total: ")'

old_text_4='" Refresh"'
new_text_4='lang(" Refresh")'

old_text_5='"Refresh"'
new_text_5='lang("Refresh")'

old_text_6='"Add Row"'
new_text_6='lang("Add Row")'


old_text_7='"Edit Row"'
new_text_7='lang("Edit Row")'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
sed -i "s|$old_text_5|$new_text_5|g" "$file_path"
sed -i "s|$old_text_6|$new_text_6|g" "$file_path"
sed -i "s|$old_text_7|$new_text_7|g" "$file_path"

系统设置(System-System Setting)

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-SystemView-js.js

搜索关键字1:"Controller"

修改为:lang("Controller")

image-20231202231451080


系统状态

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-StatusView-js.js

image-20231203203044084

  • 关键字1

    搜索:"CPU Used"

    修改为:lang("CPU Used")

  • 关键字2

    搜索:"RAM Used"

    修改为:lang("RAM Used")

  • 关键字3

    搜索:"Swap Used"

    修改为:lang("Swap Used")

  • 关键字4

    搜索:"Disk Used"

    修改为:lang("Disk Used")

  • 关键字5

    搜索:"Total: ",this.state.cores," Cores"

    修改为:lang("CPU Total: "),this.state.cores,lang(" Cores")

  • 关键字6

    搜索:"Total: ",Math.round(this.state.total_ram/1024),"MB"

    修改为:lang("RAM Total: "),Math.round(this.state.total_ram/1024),lang("MB")

  • 关键字7

    搜索:"Total: ",Math.round(this.state.total_swap/1024),"MB"

    修改为:lang("SWAP Total: "),Math.round(this.state.total_swap/1024),lang("MB")

  • 关键字8

    搜索:"Total: ",this.state.total_disk

    修改为:lang("DISK Total: "),this.state.total_disk

脚本

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-StatusView-js.js"

old_text_1='"CPU Used"'
new_text_1='lang("CPU Used")'

old_text_2='"RAM Used"'
new_text_2='lang("RAM Used")'

old_text_3='"Swap Used"'
new_text_3='lang("Swap Used")'

old_text_4='"Disk Used"'
new_text_4='lang("Disk Used")'

old_text_5='"Total: ",this.state.cores," Cores"'
new_text_5='lang("CPU Total: "),this.state.cores,lang(" Cores")'

old_text_6='"Total: ",Math.round(this.state.total_ram/1024),"MB"'
new_text_6='lang("RAM Total: "),Math.round(this.state.total_ram/1024),lang("MB")'


old_text_7='"Total: ",Math.round(this.state.total_swap/1024),"MB"'
new_text_7='lang("SWAP Total: "),Math.round(this.state.total_swap/1024),lang("MB")'

old_text_8='"Total: ",this.state.total_disk'
new_text_8='lang("DISK Total: "),this.state.total_disk'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
sed -i "s|$old_text_5|$new_text_5|g" "$file_path"
sed -i "s|$old_text_6|$new_text_6|g" "$file_path"
sed -i "s|$old_text_7|$new_text_7|g" "$file_path"
sed -i "s|$old_text_8|$new_text_8|g" "$file_path"

LAB内节点管理/系统状态

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

修改文件路径:

vim /opt/unetlab/html/store/public/react/js/lab.js

image-20231203210624172

  • 关键字1

    搜索:"CPU Used"

    修改为:lang("CPU Used")

  • 关键字2

    搜索:"RAM Used"

    修改为:lang("RAM Used")

  • 关键字3

    搜索:"Swap Used"

    修改为:lang("Swap Used")

  • 关键字4

    搜索:"Disk Used"

    修改为:lang("Disk Used")

  • 关键字5

    搜索:lang("Total"),": ",this.state.cores," Cores"

    修改为:lang("CPU Total: "),this.state.cores,lang(" Cores")

  • 关键字6

    搜索:lang("Total"),": ",Math.round(this.state.total_ram/1024),"MB"

    修改为:lang("RAM Total: "),Math.round(this.state.total_ram/1024),lang("MB")

  • 关键字7

    搜索:lang("Total"),": ",Math.round(this.state.total_swap/1024),"MB"

    修改为:lang("SWAP Total: "),Math.round(this.state.total_swap/1024),lang("MB")

  • 关键字8

    搜索:lang("Total"),": ",this.state.total_disk

    修改为:lang("DISK Total: "),this.state.total_disk

脚本

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/lab.js"

old_text_1='"CPU Used"'
new_text_1='lang("CPU Used")'

old_text_2='"RAM Used"'
new_text_2='lang("RAM Used")'

old_text_3='"Swap Used"'
new_text_3='lang("Swap Used")'

old_text_4='"Disk Used"'
new_text_4='lang("Disk Used")'

old_text_5='lang("Total"),": ",this.state.cores," Cores"'
new_text_5='lang("CPU Total: "),this.state.cores,lang(" Cores")'

old_text_6='lang("Total"),": ",Math.round(this.state.total_ram/1024),"MB"'
new_text_6='lang("RAM Total: "),Math.round(this.state.total_ram/1024),lang("MB")'


old_text_7='lang("Total"),": ",Math.round(this.state.total_swap/1024),"MB"'
new_text_7='lang("SWAP Total: "),Math.round(this.state.total_swap/1024),lang("MB")'

old_text_8='lang("Total"),": ",this.state.total_disk'
new_text_8='lang("DISK Total: "),this.state.total_disk'

old_text_9='" Refresh"'
new_text_9='lang(" Refresh")'

old_text_10='"Refresh"'
new_text_10='lang("Refresh")'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
sed -i "s|$old_text_5|$new_text_5|g" "$file_path"
sed -i "s|$old_text_6|$new_text_6|g" "$file_path"
sed -i "s|$old_text_7|$new_text_7|g" "$file_path"
sed -i "s|$old_text_8|$new_text_8|g" "$file_path"
sed -i "s|$old_text_9|$new_text_9|g" "$file_path"
sed -i "s|$old_text_10|$new_text_10|g" "$file_path"

报错信息

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

提示

基于PHP源码修改的,修改后,切换语言为英文后,修改部分也会是中文显示

?>该文件下载到本地后自行翻译后替换原文件即可。

/opt/unetlab/html/includes/messages_en.php

修改文件路径:

/opt/unetlab/html/store/app/Services/Auth/JwtGuard.php
  • 关键字1

    搜索:You do not have access

    修改为:[权限错误] 未授权访问

  • 关键字2

    搜索:You cannot login yet, your Account will take effect from:

    修改为:[权限错误] 用户未生效,生效时间:

  • 关键字3

    搜索:You can not login, your account has been out of date from:

    修改为:[权限错误] 用户以过期,过期时间:

  • 关键字4

    搜索:Y-m-d H:i

    修改为:Y年m月d日 H:i

#!/bin/bash

file_path="/opt/unetlab/html/store/app/Services/Auth/JwtGuard.php"

old_text_1='You do not have access'
new_text_1='[权限错误] 未授权访问'

old_text_2='You cannot login yet, your Account will take effect from:'
new_text_2='[权限错误] 用户未生效,生效时间:'

old_text_3='You can not login, your account has been out of date from:'
new_text_3='[权限错误] 用户以过期,过期时间:'

old_text_4='Y-m-d H:i'
new_text_4='Y年m月d日 H:i'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
/opt/unetlab/html/includes/functions.php
#!/bin/bash

file_path="/opt/unetlab/html/includes/functions.php"

old_text_1='You do not have permission to access folder '
new_text_1='[权限错误] 禁止访问文件夹:'

old_text_2='You do not have permission to Open this Lab'
new_text_2='[权限错误] 禁止创建新的沙箱会话'

old_text_3='You do not have permission to Edit this Lab'
new_text_3='[权限错误] 禁止编辑该沙箱'

old_text_4='"You do not have permission"'
new_text_4='"[权限错误] 未授权"'

old_text_3='You do not have permission to Join this Lab'
new_text_3='[权限错误] 禁止加入该沙箱会话'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"
sed -i "s|$old_text_4|$new_text_4|g" "$file_path"
/opt/unetlab/html/store/app/Http/Controllers/Auth/LoginController.php 
#!/bin/bash

file_path="/opt/unetlab/html/store/app/Http/Controllers/Auth/LoginController.php"

old_text_1='Username is not existed'
new_text_1='用户名或密码错误'

old_text_2='Password is Wrong'
new_text_2='用户名或密码错误'

old_text_3='Username or Password empty'
new_text_3='用户名或密码未输入'
sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"
sed -i "s|$old_text_2|$new_text_2|g" "$file_path"
sed -i "s|$old_text_3|$new_text_3|g" "$file_path"

提示信息

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

/opt/unetlab/html/store/public/react/js/app.js
#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/app.js"

old_text_1='"Warning!"'
new_text_1='lang("Warning!")'

sed -i.bak "s|$old_text_1|$new_text_1|g" "$file_path"

image-20240102163031148

其他

警告

修改前请备份原文件

提示

教程基于PNETLAB版本:v6.0.0-100

节点之类连线


image-20230812193148513

语言文件json添加

common.json

"Source ID": "本地节点ID",
"Source Name": "本地节点名称",
"Choose Interface for": "选择节点端口 - ",
"type -": "节点类型-"

脚本

/opt/unetlab/html/themes/default/js/functions.js

#!/bin/bash

file_path="/opt/unetlab/html/themes/default/js/functions.js"

old_text_1="Source ID:"
new_text_1="' + lang('Source ID') + ': "
old_text_2="Source Name:"
new_text_2="' + lang('Source Name') + ': "
old_text_3="Choose Interface for '"
new_text_3="' + lang('Choose Interface for')"
old_text_4="type - '"
new_text_4="' + lang('type -')"

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"

实验手册添加


image-20230813143218737

json

"Workbook: ": "实验手册:",
	"Add Workbook": "添加新的实验手册",
	"Add Page": "新建页",
	"Are you sure?": "你确定要删除吗?",
	"You won't be able to revert this!": "删除后无法还原!",
	"Yes, delete it!": "确定",
"Cancel": "取消",

脚本(脚本有问题!)

手动修改建议下载到本地修改,文件太大远程修改过于卡顿。

/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-LabsWorkbook-js.js

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-LabsWorkbook-js.js"

old_text_1='"Add Workbook"'
new_text_1='lang("Add Workbook")'
old_text_2='"Add Page"'
new_text_2='lang("Add Page")'
old_text_3='"Save"), " ", r.createElement("div",'
new_text_3='lang("Save")), " ", r.createElement("div",'
old_text_4='"Are you sure?"'
new_text_4='lang("Are you sure?")'
old_text_5='"You won\'t be able to revert this!"'
new_text_5='lang("You won\'t be able to revert this!")'
old_text_6='Yes, delete it!'
new_text_6='lang("Yes, delete it!")'
old_text_7='"Workbook: "'
new_text_7='lang("Workbook: ")'
#"Workbook: "
#old_text_7='label: "Cancel"'
#new_text_7='label: lang("Cancel")'

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"
sed -i "s/$old_text_5/$new_text_5/g" "$file_path"
sed -i "s/$old_text_6/$new_text_6/g" "$file_path"
sed -i "s/$old_text_7/$new_text_7/g" "$file_path"

系统设置页面


image-20230813143424809

image-20230813143447962

json

"Choose folders to share with all users": "选择要与用户共享的文件夹",
"Fixpermissions successfully": "权限以修复!",
"Stop all Nodes successfully": "所有节点已关闭",
"Restart Database Service successfully": "数据库服务已重启",
"Restart HTML Console Service successfully": "HTML控制台服务已重启",
"Restart Docker Service successfully": "Dokcer服务已重启",
"Restart Cloud NAT Service successfully": "NAT云网络已重启"

脚本(未测试脚本,以手动修改)

/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-SystemView-js.js

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-SystemView-js.js"

old_text_1='"Choose folders to share with all users"'
new_text_1='lang("Choose folders to share with all users")'
old_text_2='"Fixpermissions successfully"'
new_text_2='lang("Fixpermissions successfully")'

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"

智能网桥

image-20230813000123318

json

"Smart Bridge (Experimental)": "智能网桥(实验功能)",
"Enable 802.1ad (Experimental)": "开启802.1ad (实验功能)",
"Node Id": "节点ID",
"Node Name": "节点名称",
"Interface Id": "接口ID",
"Interface Name": "接口名称"

脚本(未测试,以手动修改)

/opt/unetlab/html/themes/default/js/functions.js

#!/bin/bash

file_path="/opt/unetlab/html/themes/default/js/functions.js"

old_text_1="Smart Bridge (Experimental)"
new_text_1="' + lang('Smart Bridge (Experimental)') + '"

old_text_2="Enable 802.1ad (Experimental)"
new_text_2="' + lang('Enable 802.1ad (Experimental)') + '"

old_text_3="Node Id"
new_text_3="' + lang('Node Id') + '"

old_text_4="Node Name"
new_text_4="' + lang('Node Name') + '"

old_text_5="Interface Id"
new_text_5="' + lang('Interface Id') + '"

old_text_6="Interface Name"
new_text_6="' + lang('Interface Name') + '"

old_text_7="MESSAGES[47]"
new_text_7="lang('Save')"

old_text_8="MESSAGES[18]"
new_text_8="lang('Cancel')"

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"
sed -i "s/$old_text_5/$new_text_5/g" "$file_path"
sed -i "s/$old_text_6/$new_text_6/g" "$file_path"
sed -i "s/$old_text_7/$new_text_7/g" "$file_path"
sed -i "s/$old_text_8/$new_text_8/g" "$file_path"

线类型(放弃)


翻译过来过于奇怪,不搞了

JSON

"Straight": "直线",
"Bezier": "贝塞尔曲线",
"Flowchart": "流程图",
"State Machine": "状态机",

脚本

/opt/unetlab/html/store/public/react/pages/admin-Lab_sessionsView-js.js


系统模式


image-20230813144958639

JSON

" Online": " 在线模式",
	" Offline": " 离线模式",
	"Online Mode": "在线模式",
		"Owner": "所有者",
	"Offline Mode": "离线模式",
		"Captcha": "验证码"

脚本(未测试)

/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-ModeView-js.js

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/store/public/react/pages/admin-ModeView-js.js"

old_text_1='" Online"'
new_text_1='lang(" Online")'

old_text_2='" Offline"'
new_text_2='lang(" Offline")'

old_text_3='"Online Mode"'
new_text_3='lang("Online Mode")'

old_text_4='"Offline Mode"'
new_text_4='lang("Offline Mode")'

old_text_5='"Captcha"'
new_text_5='lang("Captcha")'

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"
sed -i "s/$old_text_5/$new_text_5/g" "$file_path"

杂项修改

image-20230813151635610

JSON

"Node Size (px)": "节点大小(px)",
"Link Width (px)": "链路宽度(px)",
"Label Size (px)": "标签大小(px)",
"Hide Labels : ": "隐藏标签",
"Hide Port Labels : ": "隐藏端口标签",

脚本(未测试)

手动修改建议下载到本地修改,文件太大远程修改过于卡顿。

/opt/unetlab/html/store/public/react/js/lab.js

#!/bin/bash

file_path="/opt/unetlab/html/store/public/react/js/lab.js"

old_text_1="Node Size (px)"
new_text_1="' + lang('Node Size (px)') + '"

old_text_2="Link Width (px)"
new_text_2="' + lang('Link Width (px)') + '"

old_text_3="Label Size (px)"
new_text_3="' + lang('Label Size (px)') + '"

old_text_4="Hide Labels : "
new_text_4="' + lang('Hide Labels : ') + '"

old_text_5="Hide Port Labels : "
new_text_5="' + lang('Hide Port Labels : ') + '"

sed -i.bak "s/$old_text_1/$new_text_1/g" "$file_path"
sed -i "s/$old_text_2/$new_text_2/g" "$file_path"
sed -i "s/$old_text_3/$new_text_3/g" "$file_path"
sed -i "s/$old_text_4/$new_text_4/g" "$file_path"
sed -i "s/$old_text_5/$new_text_5/g" "$file_path"