Skip to content

Commit

Permalink
fax translate
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Jul 23, 2024
1 parent e296e5f commit b6cb24f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Content.Client/Fax/UI/FaxWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void UpdateWarps(IEnumerable<GhostWarp> 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;
}
Expand Down
15 changes: 15 additions & 0 deletions Resources/Locale/ru-RU/fax/fax.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = Офис ГВ
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/warps/warp-point-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = Маяк
Expand Down

0 comments on commit b6cb24f

Please sign in to comment.