forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Declent_ru updates and add support for reagent desc (#820)
## About The Pull Request Добавляет поддержку для описаний химикатов Обновляет логику деклентов Добавляет поддержку наличия ТОЛЬКО именительного падежа fixes #777
- Loading branch information
Showing
6 changed files
with
100 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 14 additions & 8 deletions
22
modular_bandastation/translations/code/ru_names/ru_name_materials.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
/datum/material/declent_ru(case_id, list/ru_names_override) | ||
/datum/material | ||
/// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный", "gender") | ||
var/list/ru_names | ||
|
||
/datum/material/New() | ||
. = ..() | ||
ru_names = ru_names_toml(name) | ||
|
||
/datum/material/declent_ru(declent) | ||
. = name | ||
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) | ||
if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id]) | ||
return list_to_use[case_id] | ||
return name | ||
if(declent == "gender") | ||
. = NEUTER | ||
if(!length(ru_names) || ru_names["base"] != name) | ||
return . | ||
return get_declented_value(ru_names, declent, .) |
16 changes: 9 additions & 7 deletions
16
modular_bandastation/translations/code/ru_names/ru_name_orderables.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
/datum/orderable_item | ||
var/use_translate = TRUE | ||
/// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный", "gender") | ||
var/list/ru_names | ||
|
||
/datum/orderable_item/New() | ||
. = ..() | ||
ru_names = ru_names_toml(purchase_path::name) | ||
if(!use_translate) | ||
return | ||
name = capitalize(declent_ru(NOMINATIVE)) | ||
|
||
/datum/orderable_item/declent_ru(case_id, list/ru_names_override) | ||
/datum/orderable_item/declent_ru(declent) | ||
. = 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 | ||
if(declent == "gender") | ||
. = NEUTER | ||
if(!length(ru_names)) | ||
return . | ||
return get_declented_value(ru_names, declent, .) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
modular_bandastation/translations/code/translation_data/ru_reagents.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
["reagents_desc"] | ||
#"Oxygen" = "Описание кислорода" |