Skip to content

Commit

Permalink
ru-names - fixes improper check and check if value exists (#766)
Browse files Browse the repository at this point in the history
## About The Pull Request
Добавляет пустые поля для секурыты (я к ним вернусь)
Добавляет поддержку, если есть пустые поля в ru_names.toml
  • Loading branch information
larentoun authored Nov 19, 2024
1 parent a08d918 commit 166df12
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 8 deletions.
114 changes: 114 additions & 0 deletions modular_bandastation/translations/code/data/ru_names.toml
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,15 @@ instrumental = "лазерным карабином"
prepositional = "лазерном карабине"
gender = "male"

["practice laser gun"]
nominative = "учебный лазерный карабин"
genitive = "учебного лазерного карабина"
dative = "учебному лазерному карабину"
accusative = "учебный лазерный карабин"
instrumental = "учебным лазерным карабином"
prepositional = "учебном лазерном карабине"
gender = "male"

["laser carbine"]
nominative = "автоматический лазерный карабин"
genitive = "автоматического лазерного карабина"
Expand All @@ -938,6 +947,15 @@ instrumental = "автоматическим лазерным карабином
prepositional = "автоматическом лазерном карабине"
gender = "male"

["practice laser carbine"]
nominative = "учебный автоматический лазерный карабин"
genitive = "учебного автоматического лазерного карабина"
dative = "учебному автоматическому лазерному карабину"
accusative = "учебный автоматический лазерный карабин"
instrumental = "учебным автоматическим лазерным карабином"
prepositional = "учебном автоматическом лазерном карабине"
gender = "male"

["miniature energy gun"]
nominative = "миниатюрный энергетический пистолет"
genitive = "миниатюрного энергетического пистолета"
Expand Down Expand Up @@ -1064,6 +1082,15 @@ instrumental = "боевым дробовиком"
prepositional = "боевом дробовике"
gender = "male"

["compact shotgun"]
nominative = "компактный дробовик"
genitive = "компактного дробовика"
dative = "компактному дробовику"
accusative = "компактный дробовик"
instrumental = "компактным дробовиком"
prepositional = "компактном дробовике"
gender = "male"

["stun baton"]
nominative = "оглушающая дубинка"
genitive = "оглушающей дубинки"
Expand Down Expand Up @@ -1264,6 +1291,93 @@ instrumental = "коробкой пончиков"
prepositional = "коробке пончиков"
gender = "female"

["zipties"]
["flash"]
["donut"]
["evidence bag box"]
["seclite"]
["energy bola"]
["enhanced retrieval gloves"]
["security holobarrier projector"]
["security webbing"]
["antag token"]
["blue helmet"]
["security gloves"]
["large armor vest"]
["stingbang"]
["anti-tider-2500 supression backpack"]
["energy shoulder holsters"]
["security officer's locker"]
["armor vest"]
["security radio headset"]
["security bowman headset"]
["security HUDSunglasses"]
["security belt"]
["security beret"]
["security cap"]
["striped security bandana"]
["security uniform"]
["security skirt"]
["grey security jumpsuit"]
["slacks"]
["blue shirt and tie"]
["security jacket"]
["security winter jacket"]
["jackboots"]
["security backpack"]
["security satchel"]
["security duffel bag"]
["security messenger bag"]
["security officer's formal uniform"]
["security officer's jacket"]
["recharger"]
["training bomb"]
["sunglasses"]
["earmuffs"]
["box of spare zipties"]
["box of flashbangs (WARNING)"]
["security gas mask"]

# Warden
["warden's garment bag"]
["krav maga gloves"]
["warden's jacket"]
["warden's police hat"]
["warden's campaign hat"]
["warden's beret"]
["warden's armored jacket"]
["warden's formal uniform"]
["warden's suitskirt"]

# HoS
["head of security's locker"]
["pinpointer"]
["head of security data disk"]
["the head of security's headset"]
["the head of security's bowman headset"]
["head of security's garment bag"]
["security medal box"]
["security megaphone"]
["lockbox of mindshield implants"]
["telescopic shield"]
["photo album (Head of Security)"]
["head of security cap"]
["SWAT mask"]
["head of security's cloak"]
["armored greatcoat"]
["Head of Security's parade jacket"]
["head of security's winter trenchcoat"]
["security overcoat"]
["eyepatch HUD"]
["giga HUD gar glasses"]
["head of security's beret"]
["gorilla gloves"]
["head of security's parade uniform"]
["head of security's grey jumpsuit"]
["head of security's turtleneck skirt"]
["head of security's turtleneck"]
["head of security's skirt"]

# MARK: Kitchen

["pepper mill"]
Expand Down
17 changes: 9 additions & 8 deletions modular_bandastation/translations/code/ru_names/ru_name_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ GLOBAL_LIST_EMPTY(ru_names)

/proc/ru_names_toml(name, prefix, suffix, override_base)
. = list()
var/formatted_name = format_text(name)
if(!length(GLOB.ru_names))
var/toml_path = "[PATH_TO_TRANSLATE_DATA]/ru_names.toml"
if(!fexists(file(toml_path)))
GLOB.ru_names = list("ERROR" = "File not found!")
return .
GLOB.ru_names = rustg_read_toml_file("[PATH_TO_TRANSLATE_DATA]/ru_names.toml")
if(GLOB.ru_names[name])
if(GLOB.ru_names[formatted_name])
var/base = override_base || "[prefix][name][suffix]"
. = ru_names_list(
base,
"[prefix][GLOB.ru_names[name]["nominative"]][suffix]",
"[prefix][GLOB.ru_names[name]["genitive"]][suffix]",
"[prefix][GLOB.ru_names[name]["dative"]][suffix]",
"[prefix][GLOB.ru_names[name]["accusative"]][suffix]",
"[prefix][GLOB.ru_names[name]["instrumental"]][suffix]",
"[prefix][GLOB.ru_names[name]["prepositional"]][suffix]",
gender = "[GLOB.ru_names[name]["gender"]]",)
"[prefix][GLOB.ru_names[formatted_name]["nominative"] || name][suffix]",
"[prefix][GLOB.ru_names[formatted_name]["genitive"] || name][suffix]",
"[prefix][GLOB.ru_names[formatted_name]["dative"] || name][suffix]",
"[prefix][GLOB.ru_names[formatted_name]["accusative"] || name][suffix]",
"[prefix][GLOB.ru_names[formatted_name]["instrumental"] || name][suffix]",
"[prefix][GLOB.ru_names[formatted_name]["prepositional"] || name][suffix]",
gender = "[GLOB.ru_names[formatted_name]["gender"] || null]",)

/atom/Initialize(mapload, ...)
. = ..()
Expand Down

0 comments on commit 166df12

Please sign in to comment.