From b6cb24f24030b927ebea91aaf714b932b2b90a47 Mon Sep 17 00:00:00 2001 From: Rinary Date: Tue, 23 Jul 2024 21:19:29 +0300 Subject: [PATCH] fax translate --- Content.Client/Fax/UI/FaxWindow.xaml.cs | 7 +++++-- .../Ghost/Controls/GhostTargetWindow.xaml.cs | 2 +- Resources/Locale/ru-RU/fax/fax.ftl | 15 +++++++++++++++ .../Locale/ru-RU/warps/warp-point-component.ftl | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Content.Client/Fax/UI/FaxWindow.xaml.cs b/Content.Client/Fax/UI/FaxWindow.xaml.cs index b809af7f4ae..7b489afa7ce 100644 --- a/Content.Client/Fax/UI/FaxWindow.xaml.cs +++ b/Content.Client/Fax/UI/FaxWindow.xaml.cs @@ -4,6 +4,8 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface; +using System; +using System.Text.RegularExpressions; namespace Content.Client.Fax.UI; @@ -38,7 +40,7 @@ public void UpdateState(FaxUiState state) { CopyButton.Disabled = !state.CanCopy; SendButton.Disabled = !state.CanSend; - FromLabel.Text = state.DeviceName; + FromLabel.Text = Loc.GetString($"fax-label-{Regex.Replace(state.DeviceName, @"[*?!'%\s]", string.Empty).ToLower()}"); if (state.IsPaperInserted) { @@ -85,7 +87,8 @@ public void UpdateState(FaxUiState state) private int AddPeerSelect(string name, string address) { - PeerSelector.AddItem(name); + var loc = Loc.GetString($"fax-label-{Regex.Replace(name, @"[*?!'%\s]", string.Empty).ToLower()}"); + PeerSelector.AddItem(loc); PeerSelector.SetItemMetadata(PeerSelector.ItemCount - 1, address); return PeerSelector.ItemCount - 1; } diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs index 28f8e53deb2..00c39820a36 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs @@ -45,7 +45,7 @@ public void UpdateWarps(IEnumerable warps) private string GetLocalizedName(string displayName) { - var locationKey = $"location-{displayName.Replace(" ", "-").ToLower()}"; + var locationKey = $"location-{displayName.Replace(" ", "-").ToLower().Replace("'", "-")}"; var localizedName = Loc.GetString(locationKey); return localizedName == locationKey ? displayName : localizedName; } diff --git a/Resources/Locale/ru-RU/fax/fax.ftl b/Resources/Locale/ru-RU/fax/fax.ftl index 47a3d3c41fa..124231b7388 100644 --- a/Resources/Locale/ru-RU/fax/fax.ftl +++ b/Resources/Locale/ru-RU/fax/fax.ftl @@ -22,3 +22,18 @@ fax-machine-ui-paper-inserted = Бумага в лотке fax-machine-ui-paper-not-inserted = Нет бумаги fax-machine-chat-notify = Получено новое сообщение с "{ $fax }" факса fax-machine-printed-paper-name = распечатанная бумага + +fax-lable-err = ОШИБКА*?*%! +fax-label-captainsoffice = Кабинет капитана +fax-label-centralcommand = Центральное коммандование +fax-label-hop = Глава персонала +fax-label-lawoffice = Юридический офис +fax-label-bridge = Мостик +fax-label-science = Научный отдел +fax-label-detectiveoffice = Офис детектива +fax-label-cargo = Карго +fax-label-security = Служба безопасности +fax-label-library = Библиотека +fax-label-psych = Психолог +fax-label-Chaplain = Священник +fax-label-cmooffice = Офис ГВ \ No newline at end of file diff --git a/Resources/Locale/ru-RU/warps/warp-point-component.ftl b/Resources/Locale/ru-RU/warps/warp-point-component.ftl index ebc55bc7b8d..85aba71b959 100644 --- a/Resources/Locale/ru-RU/warps/warp-point-component.ftl +++ b/Resources/Locale/ru-RU/warps/warp-point-component.ftl @@ -4,7 +4,7 @@ warp-point-component-on-examine-success = ID данной локации: { $loc location-nuke-disk = Ядерный диск location-nuclear-bomb = Ядерная боеголовка location-centcomm = Центральное коммандование -location-nar'sie = Нар'Си +location-nar-sie = Нар'Си location-ratvar = Ратвар location-bombing-target = Цель бомбардировки location-beacon = Маяк