Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 12 additions & 8 deletions Content.Shared/Localizations/ContentLocalizationManager.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using Robust.Shared.Log;
using Robust.Shared.Log; // LuaM
using Robust.Shared.Utility;

namespace Content.Shared.Localizations
{
public sealed partial class ContentLocalizationManager
{
[Dependency] private ILocalizationManager _loc = default!;
[Dependency] private ILogManager _logManager = default!;
[Dependency] private ILogManager _logManager = default!; // LuaM

// If you want to change your codebase's language, do it here.
private const string Culture = "ru-RU";
private const string FallbackCulture = "en-US";
private const string Culture = "ru-RU"; // LuaM
private const string FallbackCulture = "en-US"; // LuaM: Culture > FallbackCulture

/// <summary>
/// Custom format strings used for parsing and displaying minutes:seconds timespans.
Expand All @@ -28,14 +28,16 @@ public sealed partial class ContentLocalizationManager

public void Initialize()
{
_logManager.GetSawmill("loc").Level = LogLevel.Error;
_logManager.GetSawmill("loc").Level = LogLevel.Error; // LuaM
var culture = new CultureInfo(Culture);
var fallbackCulture = new CultureInfo(FallbackCulture);
var fallbackCulture = new CultureInfo(FallbackCulture); // LuaM

_loc.LoadCulture(culture);
// LuaM-start:
_loc.LoadCulture(fallbackCulture);
_loc.SetFallbackCluture(fallbackCulture);
_loc.AddFunction(culture, "MANY", FormatMany);
// LuaM-end.
_loc.AddFunction(culture, "PRESSURE", FormatPressure);
_loc.AddFunction(culture, "POWERWATTS", FormatPowerWatts);
_loc.AddFunction(culture, "POWERJOULES", FormatPowerJoules);
Expand All @@ -58,6 +60,7 @@ public void Initialize()

_loc.AddFunction(cultureEn, "MAKEPLURAL", FormatMakePlural);
_loc.AddFunction(cultureEn, "MANY", FormatMany);
// LuaM-start:
_loc.AddFunction(cultureEn, "PRESSURE", FormatPressure);
_loc.AddFunction(cultureEn, "POWERWATTS", FormatPowerWatts);
_loc.AddFunction(cultureEn, "POWERJOULES", FormatPowerJoules);
Expand All @@ -69,6 +72,7 @@ public void Initialize()
_loc.AddFunction(cultureEn, "NATURALPERCENT", FormatNaturalPercent);
_loc.AddFunction(cultureEn, "PLAYTIME", FormatPlaytime);
_loc.AddFunction(cultureEn, "GASQUANTITY", FormatGasQuantity);
// LuaM-end.
}

private ILocValue FormatMany(LocArgs args)
Expand Down Expand Up @@ -136,8 +140,8 @@ public static string FormatList(List<string> list)
{
<= 0 => string.Empty,
1 => list[0],
2 => $"{list[0]} {Loc.GetString("comp-hands-examine-and")} {list[1]}",
_ => $"{string.Join(", ", list.GetRange(0, list.Count - 1))}, {Loc.GetString("comp-hands-examine-and")} {list[^1]}"
2 => $"{list[0]} {Loc.GetString("comp-hands-examine-and")} {list[1]}", // LuaM: and > {Loc.GetString("comp-hands-examine-and")}
_ => $"{string.Join(", ", list.GetRange(0, list.Count - 1))}, {Loc.GetString("comp-hands-examine-and")} {list[^1]}" // LuaM: and > {Loc.GetString("comp-hands-examine-and")}
};
}

Expand Down
15 changes: 0 additions & 15 deletions Resources/Locale/ru-RU/_ADT/production.ftl

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions Resources/Locale/ru-RU/_ADT/prototypes/Body/Parts/demon.ftl

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading