diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 391aeb34464..9b239336c9d 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -125,7 +125,16 @@ /proc/seconds_to_time(var/seconds as num) var/numSeconds = seconds % 60 var/numMinutes = (seconds - numSeconds) / 60 - return "[numMinutes] [numMinutes > 1 ? "minutes" : "minute"] and [numSeconds] seconds" + return "[numMinutes] [declension_ru(numMinutes, "минуту", "минуты", "минут")]" + +/proc/seconds_to_time_ru(num, single_name, double_name, multiple_name) + if(!isnum(num) || round(num) != num) + return double_name + if(((num % 10) == 1) && ((num % 100) != 11)) + return single_name + if(((num % 10) in 2 to 4) && !((num % 100) in 12 to 14)) + return double_name + return multiple_name //Take a value in seconds and makes it display like a clock /proc/seconds_to_clock(var/seconds as num) @@ -141,8 +150,7 @@ var/hour = null var/day = null - if(!second) - return "0 seconds" + if(second >= 60) minute = round_down(second / 60) second = round(second - (minute * 60), 0.1) @@ -151,24 +159,24 @@ second_adjusted = round(second) //used to prevent '1 seconds' being shown if(day || hour || minute) if(second_adjusted == 1 && second >= 1) - second = " and 1 second" + second = " и 1 секунду" else if(second > 1) - second = " and [second_adjusted] seconds" + second = " и [second_adjusted] секунд" else //shows a fraction if seconds is < 1 if(second_rounded) //no sense rounding again if it's already done - second = " and [second] seconds" + second = " и [second] секунд" else - second = " and [round(second, 0.1)] seconds" + second = " и [round(second, 0.1)] секунд" else if(second_adjusted == 1 && second >= 1) - second = "1 second" + second = "1 секунду" else if(second > 1) - second = "[second_adjusted] seconds" + second = "[second_adjusted] секунд" else if(second_rounded) - second = "[second] seconds" + second = "[second] секунд" else - second = "[round(second, 0.1)] seconds" + second = "[round(second, 0.1)] секунд" else second = null @@ -180,18 +188,18 @@ if(minute) //alot simpler from here since you don't have to worry about fractions if(minute != 1) if((day || hour) && second) - minute = ", [minute] minutes" + minute = ", [minute] минут" else if((day || hour) && !second) - minute = " and [minute] minutes" + minute = " и [minute] минут" else - minute = "[minute] minutes" + minute = "[minute] минут" else if((day || hour) && second) - minute = ", 1 minute" + minute = ", 1 минуту" else if((day || hour) && !second) - minute = " and 1 minute" + minute = " и 1 минуту" else - minute = "1 minute" + minute = "1 минута" else minute = null @@ -203,27 +211,27 @@ if(hour) if(hour != 1) if(day && (minute || second)) - hour = ", [hour] hours" + hour = ", [hour] часов" else if(day && (!minute || !second)) - hour = " and [hour] hours" + hour = " и [hour] часов" else - hour = "[hour] hours" + hour = "[hour] часов" else if(day && (minute || second)) - hour = ", 1 hour" + hour = ", 1 час" else if(day && (!minute || !second)) - hour = " and 1 hour" + hour = " и 1 час" else - hour = "1 hour" + hour = "1 час" else hour = null if(!day) return "[hour][minute][second]" if(day > 1) - day = "[day] days" + day = "[day] дня" else - day = "1 day" + day = "1 день" return "[day][hour][minute][second]" diff --git a/code/game/machinery/computer/brigcells.dm b/code/game/machinery/computer/brigcells.dm index ace3d9f823e..1e1f7fe59d5 100644 --- a/code/game/machinery/computer/brigcells.dm +++ b/code/game/machinery/computer/brigcells.dm @@ -1,6 +1,6 @@ /obj/machinery/computer/brigcells name = "cell management computer" - desc = "Используется для управления тюремными камерами." + desc = "Используется для дистанционного управления камерами заключённых." icon_keyboard = "security_key" icon_screen = "cell_monitor" use_power = IDLE_POWER_USE @@ -64,7 +64,7 @@ var/obj/machinery/door_timer/T = locate(ref) if (T) T.timer_end() - T.Radio.autosay("Timer stopped manually from a cell management console.", T.name, "Security", list(z)) + T.Radio.autosay("Таймер был вручную остановлен через консоль.", T.name, "Security", list(z)) return TRUE return FALSE diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 89747e01965..5f6411e1e1e 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -13,7 +13,15 @@ name = "door timer" icon = 'icons/obj/status_display.dmi' icon_state = "frame" - desc = "A remote control for a door." + desc = "Дистанционное управление камерой заключения." + ru_names = list( + NOMINATIVE = "Таймер", + GENITIVE = "Таймера", + DATIVE = "Таймера", + ACCUSATIVE = "Таймер", + INSTRUMENTAL = "Таймером", + PREPOSITIONAL = "Таймера" + ) req_access = list(ACCESS_BRIG) anchored = TRUE // can't pick it up density = FALSE // can walk through it. @@ -96,16 +104,16 @@ for(var/obj/machinery/computer/prisoner/C in GLOB.prisoncomputer_list) var/obj/item/paper/P = new /obj/item/paper(C.loc) - P.name = "[id] log - [occupant] [station_time_timestamp()]" - P.info = "
[id] - Brig record



" - P.info += {"
[station_name()] - Security Department

-
Admission data:

- Log generated at: [station_time_timestamp()]
- Detainee: [occupant]
- Duration: [seconds_to_time(timetoset / 10)]
- Charge(s): [crimes]
- Arresting Officer: [usr.name]


- This log file was generated automatically upon activation of a cell timer."} + P.name = "Запись [id] - [occupant] [station_time_timestamp()]" + P.info = "
[id] - Записи Службы Безопасности



" + P.info += {"
[station_name()] - Служба Безопасности

+
Данные:

+ Запись создана в: [station_time_timestamp()]
+ Заключённый: [occupant]
+ Срок заключения: [seconds_to_time(timetoset / 10)]
+ Совершённые преступления: [crimes]
+ Задержание произвёл: [usr.name]


+ Записи были созданы автоматически путём активации таймера камеры."} playsound(C.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1) GLOB.cell_logs += P @@ -121,14 +129,14 @@ var/datum/data/record/R = find_security_record("name", occupant) - var/timetext = seconds_to_time(timetoset / 10) - var/announcetext = "Detainee [occupant] ([prisoner_drank]) has been incarcerated for [timetext] for the crime of: '[crimes]'. \ - Arresting Officer: [usr.name].[R ? "" : " Detainee record not found, manual record update required."]" + var/timetext = seconds_to_time_ru(timetoset / 10) + var/announcetext = "Заключённый [occupant] ([prisoner_drank]) был заключён на [timetext] за следующие преступления: [crimes]. \ + Задержание произвёл: [usr.name].[R ? "" : " Отсутствуют записи о заключённом, требуется обновление вручную."]" Radio.autosay(announcetext, name, "Security") // Notify the actual criminal being brigged. This is a QOL thing to ensure they always know the charges against them. // Announcing it on radio isn't enough, as they're unlikely to have sec radio. - notify_prisoner("You have been incarcerated for [timetext] for the crime of: '[crimes]'.") + notify_prisoner("Вы были заключены на [timetext] за следующие преступления: [crimes]") if(prisoner_trank != "unknown" && prisoner_trank != "Civilian") SSjobs.notify_dept_head(prisoner_trank, announcetext) @@ -144,16 +152,16 @@ rank = I.assignment if(!R.fields["comments"] || !islist(R.fields["comments"])) //copied from security computer code because apparently these need to be initialized R.fields["comments"] = list() - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]
Sentenced to [timetoset/10] seconds for the charges of \"[crimes]\" by [rank] [usr.name]." + R.fields["comments"] += "Автоматически сгенерировано [declent_ru(INSTRUMENTAL)] в [GLOB.current_date_string] [station_time_timestamp()]
Заключён на [seconds_to_time(timetoset / 10)] за следующие преступления: [crimes]. Задержание произвёл: [usr.name] ([rank])." update_all_mob_security_hud() return 1 /obj/machinery/door_timer/proc/notify_prisoner(notifytext) for(var/mob/living/carbon/human/H in range(4, get_turf(src))) if(occupant == H.name) - to_chat(H, "[src] beeps, \"[notifytext]\"") + to_chat(H, "[declent_ru(NOMINATIVE)] сообщает, \"[notifytext]\"") return - atom_say("[src] beeps, \"[occupant]: [notifytext]\"") + atom_say("[declent_ru(NOMINATIVE)] сообщает, \"[occupant]: [notifytext]\"") //Main door timer loop, if it's timing and time is >0 reduce time by 1. @@ -168,7 +176,7 @@ timer_end() return PROCESS_KILL if(timeleft() <= 0) - Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z)) + Radio.autosay("Время заключения истекло. Заключённый освобождён.", name, "Security", list(z)) occupant = CELL_NONE timer_end() // open doors, reset timer, clear status screen return PROCESS_KILL @@ -382,12 +390,22 @@ to_chat(usr, span_warning("Access denied.")) return . = TRUE + + var/seconds_to_time_ru = (num, single_name, double_name, multiple_name) + if(!isnum(num) || round(num) != num) + return double_name + if(((num % 10) == 1) && ((num % 100) != 11)) + return single_name + if(((num % 10) in 2 to 4) && !((num % 100) in 12 to 14)) + return double_name + return + switch(action) if("prisoner_name") if(params["prisoner_name"]) prisoner_name = params["prisoner_name"] else - var/new_name = tgui_input_text(usr, "Prisoner Name:", name, prisoner_name, MAX_NAME_LEN, encode = FALSE) + var/new_name = tgui_input_text(usr, "Имя заключённого:", name, prisoner_name, MAX_NAME_LEN, encode = FALSE) if(isnull(new_name)) return prisoner_name = new_name @@ -398,12 +416,12 @@ else prisoner_hasrecord = FALSE if("prisoner_charge") - var/new_charge = tgui_input_text(usr, "Prisoner Charge:", name, prisoner_charge, encode = FALSE) + var/new_charge = tgui_input_text(usr, "Обвиняется в:", name, prisoner_charge, encode = FALSE) if(isnull(new_charge)) return prisoner_charge = new_charge if("prisoner_time") - var/new_time = tgui_input_number(usr, "Prisoner Time (in minutes):", name, prisoner_time, PERMABRIG_TIME) + var/new_time = tgui_input_number(usr, "Время заключения (в минутах):", name, prisoner_time, PERMABRIG_TIME) if(isnull(new_time)) return prisoner_time = new_time @@ -419,56 +437,57 @@ timer_start() if("add_timer") if(timing) - var/add_reason = sanitize(copytext(input(usr, "Reason:", name, "") as text|null, 1, MAX_MESSAGE_LEN)) + var/add_reason = sanitize(copytext(input(usr, "Причина:", name, "") as text|null, 1, MAX_MESSAGE_LEN)) if(!add_reason) - to_chat(usr, span_warning("Must specify the reason!")) + to_chat(usr, span_warning("Необходимо указать причину!")) return FALSE - prisoner_time_add = input(usr, "Minutes to add:", name, prisoner_time_add) as num|null + prisoner_time_add = input(usr, "Время, которое будет добавлено (в минутах):", name, prisoner_time_add) as num|null prisoner_time_add = min(max(round(prisoner_time_add), 0), PERMABRIG_TIME) + if(!prisoner_time_add) - to_chat(usr, span_warning("Must specify the number!")) + to_chat(usr, span_warning("Время указывается числом!")) return FALSE prisoner_time_add = prisoner_time_add MINUTES if(timetoset + prisoner_time_add >= PERMABRIG_TIME MINUTES) - notify_prisoner("Timer is exceeding 60 minutes. Please, transfer the prisoner to the Permabrig!") + notify_prisoner("Таймер превышает 60 минут. Переместите заключённого в пермабриг!") return FALSE timetoset = timetoset + prisoner_time_add releasetime = releasetime + prisoner_time_add - var/addtext = isobserver(usr) ? "for: [add_reason]." : "by [usr.name] for: [add_reason]" - Radio.autosay("Prisoner [occupant] had their timer increased by [prisoner_time_add / 600] minutes [addtext]", name, "Security", list(z)) - notify_prisoner("Your brig timer has been increased by [prisoner_time_add / 600] minutes for: '[add_reason]'.") + Radio.autosay("Время заключения [occupant] было увеличено на [prisoner_time_add / 600] [declension_ru(prisoner_time_add / 600, "минуту", "минуты", "минут")] [addtext]", name, "Security", list(z)) + Radio.autosay("Время заключения [occupant] было увеличен на [prisoner_time_add / 600] [seconds_to_time_ru] [addtext]", name, "Security", list(z)) + notify_prisoner("Ваше время заключения было увеличено на [prisoner_time_add / 600] [declension_ru(prisoner_time_add / 600, "минуту", "минуты", "минут")] [add_reason]") var/datum/data/record/R = find_security_record("name", occupant) if(istype(R)) - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]Timer increased by [prisoner_time_add / 600] minutes [addtext]" + R.fields["comments"] += "Автоматически сгенерировано [declent_ru(INSTRUMENTAL)] в [GLOB.current_date_string] [station_time_timestamp()]. Время заключения увеличено на [prisoner_time_add / 600] [declension_ru(prisoner_time_add / 600, "минуту", "минуты", "минут")] [addtext]" else . = FALSE - + var/resettext = isobserver(usr) ? "по причине: [reset_reason]." : "сотрудником [usr.name] по причине: [reset_reason]." if("restart_timer") - if(timing) - var/reset_reason = tgui_input_text(usr, "Reason for resetting timer:", name) + notify_prisoner("Ваш таймер был перезапущен по причине: [reset_reason].") + var/reset_reason = tgui_input_text(usr, "Причина перезапуска таймера:", name) if(!reset_reason) - to_chat(usr, span_warning("Cancelled reset: reason field is required.")) + R.fields["comments"] += "Автоматически сгенерировано [declent_ru(INSTRUMENTAL)] в [GLOB.current_date_string] [station_time_timestamp()]. Таймер перезапущен [resettext]" return FALSE releasetime = world.timeofday + timetoset - var/resettext = isobserver(usr) ? "for: [reset_reason]." : "by [usr.name] for: [reset_reason]." - Radio.autosay("Prisoner [occupant] had their timer reset [resettext]", name, "Security", list(z)) - notify_prisoner("Your brig timer has been reset for: '[reset_reason]'.") - var/datum/data/record/R = find_security_record("name", occupant) + var/resettext = isobserver(usr) ? "по причине: [reset_reason]." : "сотрудником [usr.name] по причине: [reset_reason]." + Radio.autosay("Таймер заключённого [occupant] был перезапущен [resettext]", name, "Security", list(z)) + notify_prisoner("Ваш таймер был перезапущен по причине: [reset_reason].") + var/stoptext = isobserver(usr) ? "с помощью консоли управления камерой." : "сотрудником [usr.name]." if(istype(R)) - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]Timer reset [resettext]" + R.fields["comments"] += "Автоматически сгенерировано [declent_ru(INSTRUMENTAL)] в [GLOB.current_date_string] [station_time_timestamp()]. Таймер перезапущен [resettext]" else . = FALSE if("stop") if(timing) - timer_end() - var/stoptext = isobserver(usr) ? "from cell control." : "by [usr.name]." - Radio.autosay("Timer stopped manually [stoptext]", name, "Security", list(z)) + to_chat(usr, span_warning("Флешер перезаряжается!")) + var/stoptext = isobserver(usr) ? "с помощью консоли управления камерой." : "сотрудником [usr.name]." + Radio.autosay("Таймер принудительно остановлен [stoptext]", name, "Security", list(z)) else . = FALSE if("flash") for(var/obj/machinery/flasher/flasher in targets) if(flasher.last_flash && (flasher.last_flash + 15 SECONDS) > world.time) - to_chat(usr, span_warning("Flash is still recharging.")) + to_chat(usr, span_warning("Флешер перезаряжается!")) else flasher.flash() else @@ -483,32 +502,96 @@ /obj/machinery/door_timer/cell_1 name = "Cell 1" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 1" /obj/machinery/door_timer/cell_2 name = "Cell 2" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 2" /obj/machinery/door_timer/cell_3 name = "Cell 3" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 3" /obj/machinery/door_timer/cell_4 name = "Cell 4" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 4" /obj/machinery/door_timer/cell_5 name = "Cell 5" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 5" /obj/machinery/door_timer/cell_6 name = "Cell 6" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 6" /obj/machinery/door_timer/cell_7 name = "Cell 7" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 7" /obj/machinery/door_timer/cell_8 name = "Cell 8" + ru_names = list( + NOMINATIVE = "Камера 1", + GENITIVE = "Камеры 1", + DATIVE = "Камеры 1", + ACCUSATIVE = "Камера 1", + INSTRUMENTAL = "Камерой 1", + PREPOSITIONAL = "Камеры 1" + ) id = "Cell 8" diff --git a/tgui/packages/tgui/interfaces/BrigCells.js b/tgui/packages/tgui/interfaces/BrigCells.js index d135f8f42d5..7ed63a114ec 100644 --- a/tgui/packages/tgui/interfaces/BrigCells.js +++ b/tgui/packages/tgui/interfaces/BrigCells.js @@ -48,13 +48,13 @@ const BrigCellsTableRow = (properties, context) => { const BrigCellsTable = ({ cells }) => ( - Cell - Occupant - Crimes - Brigged By - Time Brigged For - Time Left - Release + Камера + Заключённый + Обвинения + Провёл задержание + Срок + Осталось + Выпустить {cells.map((cell) => ( diff --git a/tgui/packages/tgui/interfaces/BrigTimer.js b/tgui/packages/tgui/interfaces/BrigTimer.js index fe9519ccb63..4b4615bc427 100644 --- a/tgui/packages/tgui/interfaces/BrigTimer.js +++ b/tgui/packages/tgui/interfaces/BrigTimer.js @@ -26,45 +26,43 @@ export const BrigTimer = (props, context) => { return ( -
+
- {data.cell_id} - + {data.cell_id} + {data.nameText} - {data.crimes} - + {data.crimes} + {data.brigged_by} - - {data.time_set} - - + {data.time_set} + {data.time_left} - + <>
{!data.timing && ( -
+
- +