Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions GameData/ORANGES/Localization/en-us.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Localization
{
en-us
{
#LOC_oranges_ET_Inline_title = ET Inline
#LOC_oranges_ET_Inline_description = placeholder

#LOC_oranges_ET_SRB_Mount_title = SRB Mount
#LOC_oranges_ET_SRB_Mount_description = Placeholder

#LOC_oranges_ET_STS_title = ET
#LOC_oranges_ET_STS_description = placeholder

#LOC_oranges_ET_STS_Decoupler_title = Placeholder
#LOC_oranges_ET_STS_Decoupler_description = Placeholder

#LOC_oranges_generic_S2_engineMount_title = SDVLUS Upper Stage Engine Mount
#LOC_oranges_generic_S2_engineMount_description = Structural base with mounting points for large upper stages.

#LOC_oranges_generic_S2_tank_title = Upper Stage Liquid Fuel Tank
#LOC_oranges_generic_S2_tank_description = Large 5m fuel tank designed for SDLV upper stages. Includes height, color, and style variants.

#LOC_oranges_interstage_5p0m_title = SDLV 5m Interstage
#LOC_oranges_interstage_5p0m_description = Interstage for 5m vehicles

#LOC_oranges_NLS1_enginemount_title = NLS-1 Engine Mount
#LOC_oranges_NLS1_enginemount_description = Structural base with mounting points for RMM-122T engines for the NLS-1 vehicle.

#LOC_oranges_NLS2_boostermount_title = NLS-2 Booster Skirt
#LOC_oranges_NLS2_boostermount_description = Large engine mount for the NLS-2 vehicle. This booster skirt is staged with the outer four engines during the burn, turning the booster into a stage-and-a-half configuration.

#LOC_oranges_NLS2_sustainermount_title = NLS-2 Sustainer Mount
#LOC_oranges_NLS2_sustainermount_description = Large sustainer mount for the center engines in the NLS-2 vehicle. Attach the booster skirt to the top of the sustainer mount, and stage them when sufficient thrust is reached.

#LOC_oranges_NLS_3p125_avionics_title = NLS 5m-3.125m Avionics Unit
#LOC_oranges_NLS_3p125_avionics_description = A large and advanced avionics compartment for NLS vehicles.

#LOC_oranges_NLS_5m_avionics_title = NLS 5m Avionics Unit
#LOC_oranges_NLS_5m_avionics_description = A large and advanced avionics compartment for NLS vehicles.

#LOC_oranges_NLS_5m_interstage_title = NLS 5m Interstage (DEPRECATED)
#LOC_oranges_NLS_5m_interstage_description = DEPRECATED

#LOC_oranges_NLS3_adapter_title = NLS3 3.75m Adapter
#LOC_oranges_NLS3_adapter_description = A generic structural adapter for NLS-3 vehicles.

#LOC_oranges_NLS3_interstage_3p75m_title = NLS-3 3.75m Interstage Adapter
#LOC_oranges_NLS3_interstage_3p75m_description = An interstage for attaching larger upper stages to the NLS-3 vehicle..

#LOC_oranges_NLS3_nosecone_title = NLS-3 Nosecone
#LOC_oranges_NLS3_nosecone_description = An nosecone for NLS-3 LRBs.

#LOC_oranges_NLS3_radialDecoupler_title = NLS-3 3.75m Radial Decoupler
#LOC_oranges_NLS3_radialDecoupler_description = Large radial decoupler for separating 3.75m boosters and core from each other. The diagonal struts should point up and away from the core.

#LOC_oranges_NLS3_S1_enginemount_title = NLS-3 Engine Mount
#LOC_oranges_NLS3_S1_enginemount_description = Structural base with mounting points for RMM-122T engines for the NLS-3 vehicle.

#LOC_oranges_NLS3_S1_Tank_title = NLS3 Liquid Fuel Tank
#LOC_oranges_NLS3_S1_Tank_description = Large 3.75m fuel tank designed for the NLS3 first stage. Includes three different height variants.

#LOC_oranges_NLSUS_A_title = NLSUS-A Cryogenic Upper Stage
#LOC_oranges_NLSUS_A_description = NLS Upper Stage. A mid-sized cryogenic upper stage with avionics and attitude control thrusters, only missing an engine.

#LOC_oranges_NLSUS_B_enginemount_title = NLSUS-B Engine Mount
#LOC_oranges_NLSUS_B_enginemount_description = Structural base with mounting points for engines for the NLSUS-B upper stage.

#LOC_oranges_NLSUS_B_Tank_title = NLSUS-B Liquid Fuel Tank
#LOC_oranges_NLSUS_B_Tank_description = 2.5m fuel tank designed for the NLSUS-B. Includes three different length variants.

#LOC_oranges_NLSUS_fairingBase_3p125m_title = NLS-3 3.125m Fairing Base SAF
#LOC_oranges_NLSUS_fairingBase_3p125m_description = 3.125m fairing base used for 2.5m stacks with a lightweight structural adapter that goes on top of your upper stage to help mount payloads. Include three different endcap diameters.

#LOC_oranges_NLSUS_interstage_title = NLSUS Interstage Adapter
#LOC_oranges_NLSUS_interstage_description = An interstage for the National Launch System Upper Stage.

#LOC_oranges_NLSUS_PayloadAdapter_2p5m_title = NLSUS 2.5m Payload Adapter
#LOC_oranges_NLSUS_PayloadAdapter_2p5m_description = This lightweight structural adapter goes on top of your upper stage to help mount payloads. Include three different endcap diameters.

#LOC_oranges_NLSUS_trussinterstage_title = NLSUS Truss Interstage Adapter.
#LOC_oranges_NLSUS_trussinterstage_description = An truss interstage for the National Launch System Upper Stage. Includes three length variants.

#LOC_oranges_NLSUS_XL_title = NLSUS-XL Cryogenic Upper Stage
#LOC_oranges_NLSUS_XL_description = NLS Upper Stage. A larger cryogenic upper stage with avionics and attitude control thrusters, only missing an engine.

#LOC_oranges_fairingBase_5p0m_SAF_title = ORANGES 5m Fairing Base SAF
#LOC_oranges_fairingBase_5p0m_SAF_description = 3.75m fairing base with integrated payload base.

#LOC_oranges_NLS3_fairing_25_SAF_title = NLSUS 2.5m Fairing Base Adapter SAF
#LOC_oranges_NLS3_fairing_25_SAF_description = 2.5m fairing base with a lightweight structural adapter that goes on top of your upper stage to help mount payloads. Include three different endcap diameters.

#LOC_oranges_NLS3_fairing_3125_SAF_title = NLSUS 3.125m Fairing Base
#LOC_oranges_NLS3_fairing_3125_SAF_description = 3.125m fairing base used for 2.5m stacks with a lightweight structural adapter that goes on top of your upper stage to help mount payloads. Include three different endcap diameters.

#LOC_oranges_NLS3_fairing_375_SAF-3125_title = NLS 3.75m Fairing 3.125m Base SAF
#LOC_oranges_NLS3_fairing_375_SAF-3125_description = 3.75m fairing base with integrated 3.125m payload base.

#LOC_oranges_NLS3_fairing_375_SAF_title = NLS 3.75m Fairing Base SAF
#LOC_oranges_NLS3_fairing_375_SAF_description = 3.75m fairing base with integrated payload base.

#LOC_oranges_NLS_fairing_SAF_title = NLS 3.125m Fairing Base SAF
#LOC_oranges_NLS_fairing_SAF_description = 3.125m fairing base with integrated payload base.

}
}
105 changes: 105 additions & 0 deletions GameData/ORANGES/Localization/zh-cn.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Localization
{
zh-cn
{
#LOC_oranges_ET_Inline_title = ET Inline
#LOC_oranges_ET_Inline_description = placeholder

#LOC_oranges_ET_SRB_Mount_title = SRB Mount
#LOC_oranges_ET_SRB_Mount_description = Placeholder

#LOC_oranges_ET_STS_title = ET
#LOC_oranges_ET_STS_description = placeholder

#LOC_oranges_ET_STS_Decoupler_title = Placeholder
#LOC_oranges_ET_STS_Decoupler_description = Placeholder

#LOC_oranges_generic_S2_engineMount_title = SDVLUS 上级发动机支架
#LOC_oranges_generic_S2_engineMount_description = 带有安装点的结构底座,用于安装大型末级。

#LOC_oranges_generic_S2_tank_title = 上层液体燃料箱
#LOC_oranges_generic_S2_tank_description = 为SDLV上部级别设计的大型 5m燃料箱。包括高度、颜色和样式变体。

#LOC_oranges_interstage_5p0m_title = SDLV 5m 级间段
#LOC_oranges_interstage_5p0m_description = 5m载具的级间段

#LOC_oranges_NLS1_enginemount_title = NLS-1 发动机安装座
#LOC_oranges_NLS1_enginemount_description = 带有安装点的结构底座,用于安装NLS-1载具的RMM-122T发动机。

#LOC_oranges_NLS2_boostermount_title = NLS-2 助推器裙
#LOC_oranges_NLS2_boostermount_description = NLS-2运载火箭的大型发动机安装座。在燃烧过程中,该助推器裙部与外侧的四个发动机分级,将助推器变为分级半配置。

#LOC_oranges_NLS2_sustainermount_title = NLS-2 维持器安装座
#LOC_oranges_NLS2_sustainermount_description = 用于NLS-2运载火箭中央发动机的大型维持器安装座。将助推器裙部安装到维持器支架的顶部,当达到足够的推力时将其升空。

#LOC_oranges_NLS_3p125_avionics_title = NLS 5m-3.125m 航空电子设备
#LOC_oranges_NLS_3p125_avionics_description = 用于NLS载具的大型先进航空电子设备舱。

#LOC_oranges_NLS_5m_avionics_title = NLS 5m 航空电子设备
#LOC_oranges_NLS_5m_avionics_description = 用于NLS载具的大型先进航空电子设备舱。

#LOC_oranges_NLS_5m_interstage_title = NLS 5m Interstage (DEPRECATED)
#LOC_oranges_NLS_5m_interstage_description = DEPRECATED

#LOC_oranges_NLS3_adapter_title = NLS3 3.75m 适配器
#LOC_oranges_NLS3_adapter_description = 用于NLS-3载具的通用结构适配器。

#LOC_oranges_NLS3_interstage_3p75m_title = NLS-3 3.75m 级间适配器
#LOC_oranges_NLS3_interstage_3p75m_description = 用于将较大的末级连接到NLS-3运载火箭上的级间段。

#LOC_oranges_NLS3_nosecone_title = NLS-3 鼻锥
#LOC_oranges_NLS3_nosecone_description = NLS-3 LRBs的一个鼻锥。

#LOC_oranges_NLS3_radialDecoupler_title = NLS-3 3.75m径向分离器
#LOC_oranges_NLS3_radialDecoupler_description = 用于将3.75m助推器和核心相互分离的大型径向分离器。对角支撑应指向上方并远离核心。

#LOC_oranges_NLS3_S1_enginemount_title = NLS-3 发动机安装座
#LOC_oranges_NLS3_S1_enginemount_description = 带有安装点的结构底座,用于安装NLS-3运载火箭的RMM-122T发动机。

#LOC_oranges_NLS3_S1_Tank_title = NLS3 液体燃料箱
#LOC_oranges_NLS3_S1_Tank_description = 3.75m长的大型燃料箱,专为NLS3一级设计。包括三种不同高度的变体。

#LOC_oranges_NLSUS_A_title = NLSUS-A 低温上面级
#LOC_oranges_NLSUS_A_description = NLS上面级。中型低温上面级,配有航空电子设备和姿态控制推进器,只缺少一个发动机。

#LOC_oranges_NLSUS_B_enginemount_title = NLSUS-B 发动机安装座
#LOC_oranges_NLSUS_B_enginemount_description = 带有NLSUS-B末级发动机安装点的结构底座。

#LOC_oranges_NLSUS_B_Tank_title = NLSUS-B 液体燃料箱
#LOC_oranges_NLSUS_B_Tank_description = 2.5m长的油箱专为NLSUS-B设计。包括三种不同长度的变体。

#LOC_oranges_NLSUS_fairingBase_3p125m_title = NLS-3 3.125m 整流罩底座 SAF
#LOC_oranges_NLSUS_fairingBase_3p125m_description = 用于2.5m堆栈的3.125m整流罩底座,带有轻质结构适配器,可安装在末级顶部,帮助安装有效载荷。包括三种不同直径的端盖。

#LOC_oranges_NLSUS_interstage_title = NLSUS 级间适配器
#LOC_oranges_NLSUS_interstage_description = National Launch System末级的中间级。

#LOC_oranges_NLSUS_PayloadAdapter_2p5m_title = NLSUS 2.5m 有效载荷适配器
#LOC_oranges_NLSUS_PayloadAdapter_2p5m_description = 这种轻型结构适配器可安装在末级顶部,帮助安装有效载荷。包括三种不同直径的端盖。

#LOC_oranges_NLSUS_trussinterstage_title = NLSUS 桁架式级间适配器
#LOC_oranges_NLSUS_trussinterstage_description = National Launch System上面级的桁架中间级。包括三种长度变体。

#LOC_oranges_NLSUS_XL_title = NLSUS-XL 低温上面级
#LOC_oranges_NLSUS_XL_description = NLS上面级。一个更大的低温末级,配有航空电子设备和姿态控制推进器,只缺少一个发动机。

#LOC_oranges_fairingBase_5p0m_SAF_title = ORANGES 5m 整流罩底座 SAF
#LOC_oranges_fairingBase_5p0m_SAF_description = 3.75m整流罩底座,配有集成有效载荷底座。

#LOC_oranges_NLS3_fairing_25_SAF_title = NLSUS 2.5m 整流罩底座适配器 SAF
#LOC_oranges_NLS3_fairing_25_SAF_description = 2.5m整流罩底座,配有轻质结构适配器,可安装在末级顶部,帮助安装有效载荷。包括三种不同直径的端盖。

#LOC_oranges_NLS3_fairing_3125_SAF_title = NLSUS 3.125m 整流罩底座
#LOC_oranges_NLS3_fairing_3125_SAF_description = 用于2.5m堆栈的3.125m整流罩底座,带有轻质结构适配器,可安装在末级顶部,帮助安装有效载荷。包括三种不同直径的端盖。

#LOC_oranges_NLS3_fairing_375_SAF-3125_title = NLS 3.75m 整流罩 3.125m 底座 SAF
#LOC_oranges_NLS3_fairing_375_SAF-3125_description = 3.75m整流罩底座,配有集成3.125m有效载荷底座。

#LOC_oranges_NLS3_fairing_375_SAF_title = NLS 3.75m 整流罩底座 SAF
#LOC_oranges_NLS3_fairing_375_SAF_description =3.75m整流罩底座,配有集成有效载荷底座。

#LOC_oranges_NLS_fairing_SAF_title = NLS 3.125m 整流罩底座 SAF
#LOC_oranges_NLS_fairing_SAF_description = 3.125m整流罩底座,配有集成有效载荷底座。

}
}
38 changes: 38 additions & 0 deletions program_changeFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#Modify the cfg text for each part.
import os

folder_path = r'C:\Games\KSP\1.12.5 Stock\GameData\ORANGES\Parts'
field_name_1 = 'title'
field_name_2 = 'description'
field_name_3 = 'name'

for dirpath, dirnames, filenames in os.walk(folder_path):
folder_name = os.path.basename(dirpath)
for filename in filenames:
if filename.endswith('.cfg'):
with open(os.path.join(dirpath, filename), 'r') as file:
content = file.read()
lines = content.split('\n')
field_value_3 = ''
found_field_1 = False
found_field_2 = False
found_field_3 = False
flag = False
for i, line in enumerate(lines):
if field_name_1 in line and not found_field_1:
lines[i] = f'\ttitle = #LOC_{field_value_3}_title'
found_field_1 = True
if field_name_2 in line and not found_field_2:
lines[i] = f'\tdescription = #LOC_{field_value_3}_description'
found_field_2 = True
if flag == False:
if field_name_3 in line and not found_field_3:
field_value_3 = line.split('=')[1].strip()
found_field_3 = True
flag = True
if found_field_1 and found_field_2 and found_field_3:
break
content = '\n'.join(lines)
with open(os.path.join(dirpath, filename), 'w') as file:
file.write(content)

41 changes: 41 additions & 0 deletions program_en-us.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#Extraction of titles and abstracts.
import os

folder_path = r'C:\Games\KSP\1.12.5 Stock\GameData\ORANGES\Parts'
field_name_1 = 'title'
field_name_2 = 'description'
field_name_3 = 'name'
output_file = 'en-us.cfg'

with open(output_file, 'w') as out:
out.write('Localization\n{\n\ten-us\n\t{\n')
for dirpath, dirnames, filenames in os.walk(folder_path):
folder_name = os.path.basename(dirpath)
for filename in filenames:
if filename.endswith('.cfg'):
with open(os.path.join(dirpath, filename), 'r') as file:
found_field_1 = False
found_field_2 = False
found_field_3 = False
field_value_3 = ''
flag = False
for line in file:
if field_name_1 in line:
field_value = line.split('=')[1].strip()
out.write(f'\t\t#LOC_{field_value_3}_title = {field_value}\n')
found_field_1 = True
if field_name_2 in line:
field_value = line.split('=')[1].strip()
out.write(f'\t\t#LOC_{field_value_3}_description = {field_value}\n\n')
found_field_2 = True
if flag == False:
if field_name_3 in line:
field_value_3 = line.split('=')[1].strip()
found_field_3 = True
flag = True
if found_field_1 and found_field_2 and found_field_3:
break
out.write('\t}\n}')