Skip to content

Commit

Permalink
add support to add genders to runames (#676)
Browse files Browse the repository at this point in the history
## About The Pull Request
Гендеримся
larentoun authored Nov 9, 2024
1 parent 747a9a1 commit 0bef13a
Showing 19 changed files with 218 additions and 65 deletions.
3 changes: 0 additions & 3 deletions code/__DEFINES/bandastation/pronouns.dm
Original file line number Diff line number Diff line change
@@ -13,6 +13,3 @@
#define INSTRUMENTAL "творительный"
/// Предложный: Прохладная история о ком? О клоуне и об ассистухе.
#define PREPOSITIONAL "предложный"

/// Макрос для упрощения создания листа падежей для объекта
#define RU_NAMES_LIST(base, nominative, genitive, dative, accusative, instrumental, prepositional) (list("base" = base, NOMINATIVE = nominative, GENITIVE = genitive, DATIVE = dative, ACCUSATIVE = accusative, INSTRUMENTAL = instrumental, PREPOSITIONAL = prepositional))
2 changes: 1 addition & 1 deletion code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
@@ -314,7 +314,7 @@ Behavior that's still missing from this component that original food items had t
original_atom.reagents.copy_to(this_food, original_atom.reagents.total_volume / chosen_processing_option[TOOL_PROCESSING_AMOUNT], 1)

if(original_atom.name != initial(original_atom.name))
this_food.ru_names_rename(RU_NAMES_LIST("slice of [original_atom.name]", "кусочек [original_atom.declent_ru(GENITIVE)]", "кусочка [original_atom.declent_ru(GENITIVE)]", "кусочку [original_atom.declent_ru(GENITIVE)]", "кусочек [original_atom.declent_ru(GENITIVE)]", "кусочком [original_atom.declent_ru(GENITIVE)]", "кусочке [original_atom.declent_ru(GENITIVE)]"))
this_food.ru_names_rename(ru_names_toml("slice of", suffix = " [original_atom.declent_ru(GENITIVE)]", override_base = "slice of [original_atom.name]"))
this_food.name = "slice of [original_atom.name]"
if(original_atom.desc != initial(original_atom.desc))
this_food.desc = "[original_atom.desc]"
4 changes: 2 additions & 2 deletions code/game/machinery/camera/presets.dm
Original file line number Diff line number Diff line change
@@ -198,17 +198,17 @@
return

if(name == initial(name))
ru_names_rename(ru_names_toml("motion-sensitive security camera"))
name = "motion-sensitive security camera"
ru_names_rename(ru_names_toml(name))
if(!proximity_monitor)
proximity_monitor = new(src)
camera_upgrade_bitflags |= CAMERA_UPGRADE_MOTION
create_prox_monitor()

/obj/machinery/camera/proc/removeMotion()
if(name == "motion-sensitive security camera")
ru_names_rename(ru_names_toml("security camera"))
name = "security camera"
ru_names_rename(ru_names_toml(name))
camera_upgrade_bitflags &= ~CAMERA_UPGRADE_MOTION
if(!area_motion)
QDEL_NULL(proximity_monitor)
6 changes: 3 additions & 3 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
@@ -556,7 +556,7 @@ Possible to do for anyone motivated enough:
hologram.layer = FLY_LAYER //Above all the other objects/mobs. Or the vast majority of them.
SET_PLANE_EXPLICIT(hologram, ABOVE_GAME_PLANE, src)
hologram.set_anchored(TRUE)//So space wind cannot drag it.
hologram.ru_names_rename(RU_NAMES_LIST("[user.name] (Hologram)", "голограмма [user.declent_ru(GENITIVE)]", "голограммы [user.declent_ru(GENITIVE)]", "голограмме [user.declent_ru(GENITIVE)]", "голограмму [user.declent_ru(GENITIVE)]", "голограммой [user.declent_ru(GENITIVE)]", "голограмме [user.declent_ru(GENITIVE)]"))
hologram.ru_names_rename(ru_names_toml("hologram", suffix = " [user.declent_ru(GENITIVE)]", override_base = "[user.name] (Hologram)"))
hologram.name = "[user.name] (Hologram)"//If someone decides to right click.
set_holo(user, hologram)

@@ -745,7 +745,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
SET_PLANE_EXPLICIT(hologram, ABOVE_GAME_PLANE, src)
hologram.set_anchored(TRUE)//So space wind cannot drag it.
hologram.ru_names_rename(RU_NAMES_LIST("[record.caller_name] (Hologram)", "голограмма [record.caller_name]", "голограммы [record.caller_name]", "голограмме [record.caller_name]", "голограмму [record.caller_name]", "голограммой [record.caller_name]", "голограмме [record.caller_name]"))
hologram.ru_names_rename(ru_names_toml("hologram", suffix = " [record.caller_name]", override_base = "[record.caller_name] (Hologram)"))
hologram.name = "[record.caller_name] (Hologram)"//If someone decides to right click.
set_holo(record, hologram)

@@ -837,7 +837,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
replay_holo.icon_state = work_off.icon_state
replay_holo.copy_overlays(work_off, TRUE)
if(HOLORECORD_RENAME)
replay_holo.ru_names_rename(RU_NAMES_LIST(entry[2] + " (Hologram)", "голограмма [entry[2]]", "голограммы [entry[2]]", "голограмме [entry[2]]", "голограмму [entry[2]]", "голограммой [entry[2]]", "голограмме [entry[2]]"))
replay_holo.ru_names_rename(ru_names_toml("hologram", suffix = " [entry[2]]", override_base = entry[2] + " (Hologram)"))
replay_holo.name = entry[2] + " (Hologram)"
.(entry_number+1)

2 changes: 1 addition & 1 deletion code/game/objects/structures/beds_chairs/chair.dm
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
/obj/structure/chair/Initialize(mapload)
. = ..()
if(prob(0.2))
ru_names_rename(RU_NAMES_LIST("tactical [name]", "тактический стул", "тактического стула", "тактическому стулу", "тактический стул", "тактическим стулом", "тактическом стуле"))
ru_names_rename(ru_names_list("tactical [name]", "тактический [declent_ru(NOMINATIVE)]", "тактического [declent_ru(GENITIVE)]", "тактическому [declent_ru(DATIVE)]", "тактический [declent_ru(ACCUSATIVE)]", "тактическим [declent_ru(INSTRUMENTAL)]", "тактическом [declent_ru(PREPOSITIONAL)]", gender = declent_ru("gender")))
name = "tactical [name]"
fishing_modifier -= 8
MakeRotate()
4 changes: 2 additions & 2 deletions code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm)
set_panel_open(TRUE)

if(name == initial(name))
ru_names_rename(RU_NAMES_LIST("[get_area_name(src)] Air Alarm", "воздушная сигнализация [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]", "воздушную сигнализацию [get_area_name(src)]", "воздушной сигнализацией [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]"))
ru_names_rename(ru_names_toml("air alarm", suffix = " ([get_area_name(src)])", override_base = "[get_area_name(src)] Air Alarm"))
name = "[get_area_name(src)] Air Alarm"

tlv_collection = list()
@@ -175,7 +175,7 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm)

/obj/machinery/airalarm/update_name(updates)
. = ..()
ru_names_rename(RU_NAMES_LIST("[get_area_name(my_area)] Air Alarm", "воздушная сигнализация [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]", "воздушную сигнализацию [get_area_name(src)]", "воздушной сигнализацией [get_area_name(src)]", "воздушной сигнализации [get_area_name(src)]"))
ru_names_rename(ru_names_toml("air alarm", suffix = " ([get_area_name(my_area)])", override_base = "[get_area_name(my_area)] Air Alarm"))
name = "[get_area_name(my_area)] Air Alarm"

/obj/machinery/airalarm/on_exit_area(datum/source, area/area_to_unregister)
2 changes: 1 addition & 1 deletion code/modules/clothing/chameleon/_chameleon_action.dm
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@
PROTECTED_PROC(TRUE) // Call update_look, not this!

var/atom/atom_target = target
atom_target.ru_names_rename(RU_NAMES_LIST(picked_item::name, declent_ru_initial(picked_item::name, NOMINATIVE), declent_ru_initial(picked_item::name, GENITIVE), declent_ru_initial(picked_item::name, DATIVE), declent_ru_initial(picked_item::name, ACCUSATIVE), declent_ru_initial(picked_item::name, INSTRUMENTAL), declent_ru_initial(picked_item::name, PREPOSITIONAL)))
atom_target.ru_names_rename(ru_names_toml(picked_item::name))
atom_target.name = initial(picked_item.name)
atom_target.desc = initial(picked_item.desc)
atom_target.icon_state = initial(picked_item.icon_state)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/alien/adult/queen.dm
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
continue
if(Q.client)
var/number = rand(1, 999) // BANDASTATION EDIT
ru_names_rename(RU_NAMES_LIST("alien princess ([number])", "принцесса Чужих ([number])", "принцессы Чужих ([number])", "принцессе Чужих ([number])", "принцессу Чужих ([number])", "принцессой Чужих ([number])", "принцессе Чужих ([number])"))
ru_names_rename(ru_names_toml("alien princess", suffix = " ([number])", override_base = "alien princess ([number])"))
name = "alien princess ([number])" //if this is too cutesy feel free to change it/remove it.
break

2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/alien/alien.dm
Original file line number Diff line number Diff line change
@@ -164,8 +164,8 @@ Des: Removes all infected images from the alien.

if(old_identifier != 0)
identifier = old_identifier
ru_names_rename(ru_names_toml(src::name))
name = initial(name) // prevent chicanery like two different numerical identifiers tied to the same mob
ru_names_rename(ru_names_toml(name))

set_name()

2 changes: 1 addition & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
@@ -1963,7 +1963,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
/mob/living/proc/set_name()
if(identifier == 0)
identifier = rand(1, 999)
ru_names_rename(RU_NAMES_LIST("[name] ([identifier])", "[declent_ru(NOMINATIVE)] ([identifier])", "[declent_ru(GENITIVE)] ([identifier])", "[declent_ru(DATIVE)] ([identifier])", "[declent_ru(ACCUSATIVE)] ([identifier])", "[declent_ru(INSTRUMENTAL)] ([identifier])", "[declent_ru(PREPOSITIONAL)] ([identifier])"))
ru_names_rename(ru_names_toml(name, suffix = " ([identifier])", override_base = "[name] ([identifier])"))
name = "[name] ([identifier])"
real_name = declent_ru(NOMINATIVE)

4 changes: 2 additions & 2 deletions code/modules/power/apc/apc_main.dm
Original file line number Diff line number Diff line change
@@ -196,7 +196,7 @@
if(!req_access)
req_access = list(ACCESS_ENGINE_EQUIP)
if(auto_name)
ru_names_rename(RU_NAMES_LIST("\improper [get_area_name(area, TRUE)] APC", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]"))
ru_names_rename(ru_names_toml("area power controller", suffix = " ([get_area_name(area, TRUE)])", override_base = "\improper [get_area_name(area, TRUE)] APC"))
name = "\improper [get_area_name(area, TRUE)] APC"

//Initialize its electronics
@@ -267,7 +267,7 @@
/obj/machinery/power/apc/update_name(updates)
. = ..()
if(auto_name)
ru_names_rename(RU_NAMES_LIST("\improper [get_area_name(area, TRUE)] APC", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]", "ЛКП [get_area_name(area, TRUE)]"))
ru_names_rename(ru_names_toml("area power controller", suffix = " ([get_area_name(area, TRUE)])", override_base = "\improper [get_area_name(area, TRUE)] APC"))
name = "\improper [get_area_name(area, TRUE)] APC"

/obj/machinery/power/apc/proc/assign_to_area(area/target_area = get_area(src))
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
@@ -669,7 +669,7 @@ GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list(
SEND_SIGNAL(src, COMSIG_GUN_SAWN_OFF)
if(!handle_modifications)
return TRUE
ru_names_rename(RU_NAMES_LIST("sawn-off [src.name]", "обрез [declent_ru(GENITIVE)]", "обреза [declent_ru(GENITIVE)]", "обрезу [declent_ru(GENITIVE)]", "обрез [declent_ru(GENITIVE)]", "обрезом [declent_ru(GENITIVE)]", "обрезе [declent_ru(GENITIVE)]"))
ru_names_rename(ru_names_toml("sawn-off", suffix = " [declent_ru(GENITIVE)]", override_base = "sawn-off [src.name]"))
name = "sawn-off [src.name]"
desc = sawn_desc
update_weight_class(WEIGHT_CLASS_NORMAL)
2 changes: 1 addition & 1 deletion code/modules/surgery/bodyparts/_bodyparts.dm
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@
if(!IS_ORGANIC_LIMB(src))
grind_results = null

ru_names_rename(RU_NAMES_LIST("[limb_id] [parse_zone(body_zone)]", "[ru_parse_zone(body_zone, declent = NOMINATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = GENITIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = DATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = ACCUSATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = INSTRUMENTAL)] ([limb_id])", "[ru_parse_zone(body_zone, declent = PREPOSITIONAL)] ([limb_id])"))
ru_names_rename(ru_names_list("[limb_id] [parse_zone(body_zone)]", "[ru_parse_zone(body_zone, declent = NOMINATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = GENITIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = DATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = ACCUSATIVE)] ([limb_id])", "[ru_parse_zone(body_zone, declent = INSTRUMENTAL)] ([limb_id])", "[ru_parse_zone(body_zone, declent = PREPOSITIONAL)] ([limb_id])", gender = FEMALE))
name = "[limb_id] [parse_zone(body_zone)]"
update_icon_dropped()
refresh_bleed_rate()
2 changes: 1 addition & 1 deletion code/modules/surgery/bodyparts/dismemberment.dm
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@
if(pill)
pill.forceMove(src)

ru_names_rename(RU_NAMES_LIST("[owner.real_name]'s head", "голова [owner.real_name]", "головы [owner.real_name]", "голове [owner.real_name]", "голову [owner.real_name]", "головой [owner.real_name]", "голове [owner.real_name]"))
ru_names_rename(ru_names_toml("head", suffix = " [owner.real_name]", override_base = "[owner.real_name]'s head"))
name = "[owner.real_name]'s head"
return ..()

74 changes: 40 additions & 34 deletions modular_bandastation/translations/code/bodyparts.dm
Original file line number Diff line number Diff line change
@@ -3,58 +3,64 @@
/obj/item/bodypart
var/list/ru_plaintext_zone = list()

/obj/item/bodypart/head
ru_plaintext_zone = RU_NAMES_LIST("head", "голова", "головы", "голове", "голову", "головой", "голове")
/obj/item/bodypart/head/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("head")

/obj/item/bodypart/chest
ru_plaintext_zone = RU_NAMES_LIST("chest", "грудь", "груди", "груди", "грудь", "грудью", "груди")
/obj/item/bodypart/chest/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("chest")

/obj/item/bodypart/arm/left
ru_plaintext_zone = RU_NAMES_LIST("left arm", "левая рука", "левой руки", "левой руке", "левую руку", "левой рукой", "левой руке")
/obj/item/bodypart/arm/left/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("left arm")

/obj/item/bodypart/arm/right
ru_plaintext_zone = RU_NAMES_LIST("right arm", "правая рука", "правой руки", "правой руке", "правую руку", "правой рукой", "правой руке")
/obj/item/bodypart/arm/right/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("right arm")

/obj/item/bodypart/leg/left
ru_plaintext_zone = RU_NAMES_LIST("left leg", "левая нога", "левой ноги", "левой ноге", "левую ногу", "левой ногой", "левой ноге")
/obj/item/bodypart/leg/left/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("left leg")

/obj/item/bodypart/leg/right
ru_plaintext_zone = RU_NAMES_LIST("right leg", "правая нога", "правой ноги", "правой ноге", "правую ногу", "правой ногой", "правой ноге")
/obj/item/bodypart/leg/right/Initialize(mapload)
. = ..()
ru_plaintext_zone = ru_names_toml("right leg")

/proc/ru_parse_zone(zone, declent = NOMINATIVE)
var/static/list/chest = RU_NAMES_LIST("chest", "грудь", "груди", "груди", "грудь", "грудью", "груди")
var/static/list/head = RU_NAMES_LIST("head", "голова", "головы", "голове", "голову", "головой", "голове")
var/static/list/right_hand = RU_NAMES_LIST("right hand", "правое запястье", "правого запястья", "правому запястью", "правое запястье", "правым запястьем", "правом запястье")
var/static/list/left_hand = RU_NAMES_LIST("left hand", "левое запястье", "левое запястье", "левой руке", "левую руку", "левой рукой", "левой руке")
var/static/list/left_arm = RU_NAMES_LIST("left arm", "левая рука", "левой руки", "левой руке", "левую руку", "левой рукой", "левой руке")
var/static/list/right_arm = RU_NAMES_LIST("right arm", "правая рука", "правой руки", "правой руке", "правую руку", "правой рукой", "правой руке")
var/static/list/left_leg = RU_NAMES_LIST("left leg", "левая нога", "левой ноги", "левой ноге", "левую ногу", "левой ногой", "левой ноге")
var/static/list/right_leg = RU_NAMES_LIST("right leg", "правая нога", "правой ноги", "правой ноге", "правую ногу", "правой ногой", "правой ноге")
var/static/list/left_foot = RU_NAMES_LIST("left leg", "левая стопа", "левой стопы", "левой стопе", "левую стопу", "левой стопой", "левой стопе")
var/static/list/right_foot = RU_NAMES_LIST("left leg", "правая стопа", "правой стопы", "правой стопе", "правую стопу", "правой стопой", "правой стопе")
var/static/list/groin = RU_NAMES_LIST("groin", "паховая область", "паховой области", "паховой области", "паховую область", "паховой областью", "паховой области")
var/static/list/chest = ru_names_toml("chest")
var/static/list/head = ru_names_toml("head")
var/static/list/right_hand = ru_names_toml("right hand")
var/static/list/left_hand = ru_names_toml("left hand")
var/static/list/left_arm = ru_names_toml("left arm")
var/static/list/right_arm = ru_names_toml("right arm")
var/static/list/left_leg =ru_names_toml("left leg")
var/static/list/right_leg = ru_names_toml("right leg")
var/static/list/left_foot = ru_names_toml("left leg")
var/static/list/right_foot = ru_names_toml("left leg")
var/static/list/groin = ru_names_toml("groin")
switch(zone)
if(BODY_ZONE_CHEST)
return chest[declent]
return chest[declent] || zone
if(BODY_ZONE_HEAD)
return head[declent]
return head[declent] || zone
if(BODY_ZONE_PRECISE_R_HAND)
return right_hand[declent]
return right_hand[declent] || zone
if(BODY_ZONE_PRECISE_L_HAND)
return left_hand[declent]
return left_hand[declent] || zone
if(BODY_ZONE_L_ARM)
return left_arm[declent]
return left_arm[declent] || zone
if(BODY_ZONE_R_ARM)
return right_arm[declent]
return right_arm[declent] || zone
if(BODY_ZONE_L_LEG)
return left_leg[declent]
return left_leg[declent] || zone
if(BODY_ZONE_R_LEG)
return right_leg[declent]
return right_leg[declent] || zone
if(BODY_ZONE_PRECISE_L_FOOT)
return left_foot[declent]
return left_foot[declent] || zone
if(BODY_ZONE_PRECISE_R_FOOT)
return right_foot[declent]
return right_foot[declent] || zone
if(BODY_ZONE_PRECISE_GROIN)
return groin[declent]
return groin[declent] || zone
else
return zone
139 changes: 139 additions & 0 deletions modular_bandastation/translations/code/data/ru_names.toml
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
#accusative = "винительный"
#instrumental = "творительный"
#prepositional = "предложный"
#gender = "male"

# MARK: Uncategorized

@@ -15,6 +16,7 @@ dative = "челюстям жизни"
accusative = "челюсти жизни"
instrumental = "челюстями жизни"
prepositional = "челюстях жизни"
gender = "plural"

[holopad]
nominative = "голопад"
@@ -23,6 +25,7 @@ dative = "голопаду"
accusative = "голопад"
instrumental = "голопадом"
prepositional = "голопаде"
gender = "male"

["secure holopad"]
nominative = "защищенный голопад"
@@ -1184,6 +1187,33 @@ accusative = "шов"
instrumental = "швом"
prepositional = "шве"

["slice of"]
nominative = "кусочек"
genitive = "кусочка"
dative = "кусочку"
accusative = "кусочек"
instrumental = "кусочком"
prepositional = "кусочке"
gender = "male"

["hologram"]
nominative = "голограмма"
genitive = "голограммы"
dative = "голограмме"
accusative = "голограмму"
instrumental = "голограммой"
prepositional = "голограмме"
gender = "female"

["sawn-off"]
nominative = "обрез"
genitive = "обреза"
dative = "обрезу"
accusative = "обрез"
instrumental = "обрезом"
prepositional = "обрезе"
gender = "male"

# MARK: Mobs. Uncategorized

# MARK: Mobs. Aliens
@@ -1244,6 +1274,14 @@ accusative = "королеву Чужих"
instrumental = "королевой Чужих"
prepositional = "королеве Чужих"

["alien princess"]
nominative = "принцесса Чужих"
genitive = "принцессы Чужих"
dative = "принцессе Чужих"
accusative = "принцессу Чужих"
instrumental = "принцессой Чужих"
prepositional = "принцессе Чужих"

# MARK: Machinery Uncategorized

["slot machine"]
@@ -1673,3 +1711,104 @@ instrumental = "биогенератором"
prepositional = "биогенераторе"

# MARK: Tools

# MARK: Organs

["chest"]
nominative = "грудь"
genitive = "груди"
dative = "груди"
accusative = "грудь"
instrumental = "грудью"
prepositional = "груди"
gender = "female"

["head"]
nominative = "голова"
genitive = "головы"
dative = "голове"
accusative = "голову"
instrumental = "голове"
prepositional = "биогенераторе"
gender = "female"

["right arm"]
nominative = "правая рука"
genitive = "правой руки"
dative = "правой руке"
accusative = "правую руку"
instrumental = "правой рукой"
prepositional = "правой руке"
gender = "female"

["right hand"]
nominative = "правое запястье"
genitive = "правого запястья"
dative = "правому запястью"
accusative = "правое запястье"
instrumental = "правым запястьем"
prepositional = "правом запястье"
gender = "female"

["left arm"]
nominative = "левая рука"
genitive = "левой руки"
dative = "левой руке"
accusative = "левую руку"
instrumental = "левой рукой"
prepositional = "левой руке"
gender = "female"

["left hand"]
nominative = "левое запястье"
genitive = "левое запястье"
dative = "левой руке"
accusative = "левую руку"
instrumental = "левой рукой"
prepositional = "левой руке"
gender = "female"

["left leg"]
nominative = "левая нога"
genitive = "левой ноги"
dative = "левой ноге"
accusative = "левую ногу"
instrumental = "левой ногой"
prepositional = "левой ноге"
gender = "female"

["left foot"]
nominative = "левая стопа"
genitive = "левой стопы"
dative = "левой стопе"
accusative = "левую стопу"
instrumental = "левой стопой"
prepositional = "левой стопе"
gender = "female"

["right leg"]
nominative = "правая нога"
genitive = "правой ноги"
dative = "правой ноге"
accusative = "правую ногу"
instrumental = "правой ногой"
prepositional = "правой ноге"
gender = "female"

["right foot"]
nominative = "правая стопа"
genitive = "правой стопы"
dative = "правой стопе"
accusative = "правую стопу"
instrumental = "правой стопой"
prepositional = "правой стопе"
gender = "female"

["groin"]
nominative = "паховая область"
genitive = "паховой области"
dative = "паховой области"
accusative = "паховую область"
instrumental = "паховой областью"
prepositional = "паховой области"
gender = "female"
1 change: 0 additions & 1 deletion modular_bandastation/translations/code/defines.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#define RU_NAMES_LENGTH 7 // 6 падежей, 1 base
#define PATH_TO_TRANSLATE_DATA "modular_bandastation/translations/code/data"
29 changes: 21 additions & 8 deletions modular_bandastation/translations/code/ru_names/ru_name_base.dm
Original file line number Diff line number Diff line change
@@ -2,25 +2,34 @@ GLOBAL_LIST_EMPTY(ru_names)

/atom
// code\__DEFINES\bandastation\pronouns.dm for more info
/// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный")
/// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный", "gender")
var/list/ru_names

/proc/ru_names_toml(name, prefix, suffix)
/// Хелпер для создания склонений
/proc/ru_names_list(base, nominative, genitive, dative, accusative, instrumental, prepositional, gender)
if(!base || !nominative || !genitive || !dative || !accusative || !instrumental || !prepositional)
CRASH("ru_names_list() received incomplete declent list!")
return list("base" = base, NOMINATIVE = nominative, GENITIVE = genitive, DATIVE = dative, ACCUSATIVE = accusative, INSTRUMENTAL = instrumental, PREPOSITIONAL = prepositional, "gender" = gender)

/proc/ru_names_toml(name, prefix, suffix, override_base)
. = list()
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
return .
GLOB.ru_names = rustg_read_toml_file("[PATH_TO_TRANSLATE_DATA]/ru_names.toml")
if(GLOB.ru_names[name])
return RU_NAMES_LIST(
"[prefix][name][suffix]",
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]")
"[prefix][GLOB.ru_names[name]["prepositional"]][suffix]",
gender = "[GLOB.ru_names[name]["gender"]]",)

/atom/Initialize(mapload, ...)
. = ..()
@@ -40,9 +49,11 @@ GLOBAL_LIST_EMPTY(ru_names)
/atom/ru_names_rename(list/new_list)
if(!length(new_list))
return
if(length(new_list) != RU_NAMES_LENGTH)
CRASH("proc/ru_names_rename() received incorrect list!")
ru_names = new_list
if(new_list["gender"])
gender = new_list["gender"]
else
gender = src::gender

/**
* Процедура выбора правильного падежа для любого предмета, если у него указан словарь «ru_names», примерно такой:
@@ -56,6 +67,8 @@ GLOBAL_LIST_EMPTY(ru_names)
var/list/list_to_use = ru_names_override || ru_names
if(length(list_to_use) && list_to_use["base"] == ru_names["base"] && list_to_use[case_id])
return list_to_use[case_id]
if(case_id == "gender")
return
return name

/// Used for getting initial values, such as for recipies where resulted atom is not yet created.
1 change: 0 additions & 1 deletion modular_bandastation/translations/code/~undefs.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#undef RU_NAMES_LENGTH
#undef PATH_TO_TRANSLATE_DATA

0 comments on commit 0bef13a

Please sign in to comment.