Skip to content

Commit

Permalink
declent orderable items (#775)
Browse files Browse the repository at this point in the history
## About The Pull Request
ру неймы
  • Loading branch information
larentoun authored Nov 20, 2024
1 parent 3433b84 commit 9968109
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions modular_bandastation/translations/_translations.dme
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
#include "code/translate_verbs.dm"
#include "code/ru_names/ru_name_base.dm"
#include "code/ru_names/ru_name_materials.dm"
#include "code/ru_names/ru_name_orderables.dm"

#include "code/~undefs.dm"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if(!ispath(sheet_type))
CRASH("Sheet type couldn't be declented because it's not a path!")
var/atom/sheet = sheet_type
var/list/list_to_use = ru_names_override || ru_names_toml(name) || ru_names_toml(sheet:name)
var/list/list_to_use = ru_names_override || ru_names_toml(name) || ru_names_toml(sheet::name)
if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id])
return list_to_use[case_id]
return name
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/orderable_item
var/use_translate = TRUE

/datum/orderable_item/New()
. = ..()
if(!use_translate)
return
name = capitalize(declent_ru(NOMINATIVE))

/datum/orderable_item/declent_ru(case_id, list/ru_names_override)
. = name
if(!ispath(purchase_path))
CRASH("Purchase type couldn't be declented because it's not a path!")
var/list/list_to_use = ru_names_override || ru_names_toml(purchase_path::name)
if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id])
return list_to_use[case_id]
return name

0 comments on commit 9968109

Please sign in to comment.