Fluent Localisation Fixes (#3344)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
Remie Richards
2021-02-22 00:07:46 +00:00
committed by GitHub
parent 63947a6d35
commit 85916b87b4
31 changed files with 276 additions and 141 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Content.Client.GameObjects.Components.Arcade;
@@ -525,12 +525,12 @@ namespace Content.Client.Arcade
public void UpdatePoints(int points)
{
_pointsLabel.Text = Loc.GetString("Points: {0}", points);
_pointsLabel.Text = Loc.GetString("blockgame-points-label", ("points", points));
}
public void UpdateLevel(int level)
{
_levelLabel.Text = Loc.GetString("Level {0}", level + 1);
_levelLabel.Text = Loc.GetString("blockgame-level-label", ("level", level + 1));
}
public void UpdateHighscores(List<BlockGameMessages.HighScoreEntry> localHighscores,

View File

@@ -15,8 +15,8 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.Utility;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Enums;
using Robust.Shared.Localization;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
@@ -51,13 +51,14 @@ namespace Content.Client.UserInterface.Suspicion
}
var allies = string.Join(", ", role.Allies.Select(tuple => tuple.name));
var message = role.Allies.Count switch
{
0 => Loc.GetString("You have no allies"),
var n => Loc.GetPluralString("Your ally is {0}", "Your allies are {0}", n, allies),
};
role.Owner.PopupMessage(message);
role.Owner.PopupMessage(
Loc.GetString(
"suspicion-ally-count-display",
("allyCount", role.Allies.Count),
("allyNames", allies)
)
);
}
private bool TryGetComponent([NotNullWhen(true)] out SuspicionRoleComponent? suspicion)

View File

@@ -7,7 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using Content.Shared.Preferences;
using Microsoft.EntityFrameworkCore;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Enums;
using Robust.Shared.Maths;
using Robust.Shared.Network;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using Content.Server.GameObjects.EntitySystems.DoAfter;
@@ -80,12 +80,26 @@ namespace Content.Server.GameObjects.Components.Items.RCD
int mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default)
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
_mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
Owner.PopupMessage(eventArgs.User, Loc.GetString("The RCD is now set to {0} mode.", _mode)); //Prints an overhead message above the RCD
Owner.PopupMessage(eventArgs.User,
Loc.GetString(
"rcd-component-change-mode",
("mode", _mode.ToString())
)
); //Prints an overhead message above the RCD
}
public void Examine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), _ammo));
if (inDetailsRange)
{
message.AddMarkup(
Loc.GetString(
"rcd-component-examine-detail-count",
("mode", _mode),
("ammoCount", _ammo)
)
);
}
}
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
@@ -90,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
{
if (_utensilsNeeded != UtensilType.None)
{
eventArgs.User.PopupMessage(Loc.GetString("You need to use a {0} to eat that!", _utensilsNeeded));
eventArgs.User.PopupMessage(Loc.GetString("food-you-need-utensil", ("utensil", _utensilsNeeded)));
return false;
}
@@ -160,7 +160,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (!types.HasFlag(_utensilsNeeded))
{
trueTarget.PopupMessage(user, Loc.GetString("You need to be holding a {0} to eat that!", _utensilsNeeded));
trueTarget.PopupMessage(user, Loc.GetString("food-you-need-to-hold-utensil", ("utensil", _utensilsNeeded)));
return false;
}
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
@@ -107,12 +107,21 @@ namespace Content.Server.GameObjects.Components.Stack
if (stack.AvailableSpace == 0)
{
eventArgs.Using.SpawnTimer(300, () => popupPos.PopupMessage(eventArgs.User, "Stack is now full."));
eventArgs.Using.SpawnTimer(
300,
() => popupPos.PopupMessage(
eventArgs.User,
Loc.GetString("stack-component-becomes-full")
)
);
}
}
else if (toTransfer == 0 && stack.AvailableSpace == 0)
{
popupPos.PopupMessage(eventArgs.User, "Stack is already full.");
popupPos.PopupMessage(
eventArgs.User,
Loc.GetString("stack-component-already-full")
);
}
return true;
@@ -122,9 +131,13 @@ namespace Content.Server.GameObjects.Components.Stack
{
if (inDetailsRange)
{
message.AddMarkup(Loc.GetPluralString(
"There is [color=lightgray]1[/color] thing in the stack",
"There are [color=lightgray]{0}[/color] things in the stack.", Count, Count));
message.AddMarkup(
Loc.GetString(
"stack-component-examine-detail-count",
("count", Count),
("markupCountColor", "lightgray")
)
);
}
}
}

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
@@ -91,8 +91,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (--Uses == 0)
{
sprite.LayerSetState(0, "burnt");
Owner.PopupMessage(user, Loc.GetString("The flash burns out!"));
Owner.PopupMessage(user, Loc.GetString("flash-component-becomes-empty"));
}
else if (!_flashing)
{
@@ -136,7 +135,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (entity != user)
{
user.PopupMessage(entity, Loc.GetString("{0:TheName} blinds you with {1:theName}", user, Owner));
user.PopupMessage(entity,
Loc.GetString(
"flash-component-user-blinds-you",
("user", user)
)
);
}
}
@@ -144,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
if (!HasUses)
{
message.AddText("It's burnt out.");
message.AddText(Loc.GetString("flash-component-examine-empty"));
return;
}
@@ -152,9 +156,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
message.AddMarkup(
Loc.GetString(
"The flash has [color=green]{0}[/color] {1} remaining.",
Uses,
Loc.GetPluralString("use", "uses", Uses)
"flash-component-examine-detail-count",
("count", Uses),
("markupCountColor", "green")
)
);
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.GUI;
@@ -178,12 +178,15 @@ namespace Content.Server.GameTicking.GamePresets
public override string GetRoundEndDescription()
{
var traitorCount = _traitors.Count;
var result = Loc.GetString("There {0} {1} {2}.", Loc.GetPluralString("was", "were", traitorCount),
traitorCount, Loc.GetPluralString("traitor", "traitors", traitorCount));
var result = Loc.GetString(
"traitor-round-end-result",
("traitorCount", _traitors.Count)
);
foreach (var traitor in _traitors)
{
result += Loc.GetString("\n{0} was a traitor",traitor.Mind.Session.Name);
result += "\n"+Loc.GetString("traitor-user-was-a-traitor", ("user", traitor.Mind.Session.Name));
var objectives = traitor.Mind.AllObjectives.ToArray();
if (objectives.Length == 0)
{
@@ -191,17 +194,33 @@ namespace Content.Server.GameTicking.GamePresets
continue;
}
result += Loc.GetString(" and had the following objectives:");
result += Loc.GetString("traitor-objective-list-start");
foreach (var objectiveGroup in objectives.GroupBy(o => o.Prototype.Issuer))
{
result += $"\n[color=#87cefa]{Loc.GetString(objectiveGroup.Key)}[/color]";
result += $"\n[color=#87cefa]{objectiveGroup.Key}[/color]";
foreach (var objective in objectiveGroup)
{
foreach (var condition in objective.Conditions)
{
var progress = condition.Progress;
result +=
Loc.GetString("\n- {0} | {1}", condition.Title, (progress > 0.99f ? $"[color=green]{Loc.GetString("Success!")}[/color]" : $"[color=red]{Loc.GetString("Failed!")}[/color] ({(int) (progress * 100)}%)"));
if (progress > 0.99f)
{
result += "\n- " + Loc.GetString(
"traitor-objective-condition-success",
("condition", condition.Title),
("markupColor", "green")
);
}
else
{
result += "\n- " + Loc.GetString(
"traitor-objective-condition-fail",
("condition", condition.Title),
("progress", (int) (progress * 100)),
("markupColor", "red")
);
}
}
}
}

View File

@@ -23,23 +23,18 @@ namespace Content.Server.Mobs.Roles.Suspicion
public void GreetSuspicion(List<SuspicionTraitorRole> traitors, IChatManager chatMgr)
{
chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("You're a {0}!", Name));
chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("Objective: {0}", Objective));
chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("suspicion-role-greeting", ("roleName", Name)));
chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("suspicion-objective", ("objectiveText", Objective)));
if (traitors.Count == 1)
{
// Only traitor.
chatMgr.DispatchServerMessage(Mind.Session, Loc.GetString("You're on your own. Good luck!"));
return;
}
var allPartners = string.Join(", ", traitors.Where(p => p != this).Select(p => p.Mind.CharacterName));
var text = string.Join(", ", traitors.Where(p => p != this).Select(p => p.Mind.CharacterName));
var partnerText = Loc.GetString(
"suspicion-partners-in-crime",
("partnerCount", traitors.Count-1),
("partnerNames", allPartners)
);
var pluralText = Loc.GetPluralString("Your partner in crime is: {0}",
"Your partners in crime are: {0}",
traitors.Count-1, text);
chatMgr.DispatchServerMessage(Mind.Session, pluralText);
chatMgr.DispatchServerMessage(Mind.Session, partnerText);
}
}
}

View File

@@ -1,4 +1,4 @@
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
@@ -31,8 +31,12 @@ namespace Content.Shared.Construction
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(string.IsNullOrEmpty(Name)
? Loc.GetString("Next, insert an entity with a {0} component.", Component) // Terrible.
: Loc.GetString("Next, insert {0}", Name));
? Loc.GetString(
"construction-insert-entity-with-component",
("componentName", Component))// Terrible.
: Loc.GetString(
"construction-insert-exact-entity",
("entityName", Name)));
}
}
}

View File

@@ -1,4 +1,4 @@
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
@@ -24,8 +24,14 @@ namespace Content.Shared.Construction
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(string.IsNullOrEmpty(Name)
? Loc.GetString("Next, insert {0}", Prototype) // Terrible.
: Loc.GetString("Next, insert {0}", Name));
? Loc.GetString(
"construction-insert-prototype-no-name",
("prototypeName", Prototype) // Terrible.
)
: Loc.GetString(
"construction-insert-prototype",
("entityName", Name)
));
}
}
}

View File

@@ -6,7 +6,6 @@ using Content.Shared.Maps;
using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
@@ -20,17 +19,14 @@ namespace Content.Shared
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly ITextMacroFactory _textMacroFactory = default!;
[Dependency] private readonly IResourceManager _resourceManager = default!;
public override void PreInit()
{
IoCManager.InjectDependencies(this);
_textMacroFactory.DoAutoRegistrations();
// Default to en-US.
Loc.LoadCulture(_resourceManager, _textMacroFactory, new CultureInfo(Culture));
Loc.LoadCulture(_resourceManager, new CultureInfo(Culture));
}
public override void Init()

View File

@@ -1,14 +1,14 @@
using System;
using System;
using Content.Shared.Preferences;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.GameObjects.Components.Mobs
{
public abstract class SharedHumanoidAppearanceComponent : Component, IGenderable
public abstract class SharedHumanoidAppearanceComponent : Component
{
private HumanoidCharacterAppearance _appearance;
private Sex _sex;

View File

@@ -1,4 +1,5 @@
using System;
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
@@ -49,7 +50,11 @@ namespace Content.Shared.GameObjects.Components
public override string ToString()
{
return Loc.GetString("{0}: {1:0.##} mol", Name, Amount);
// e.g. "Plasma: 2000 mol"
return Loc.GetString(
"gas-entry-info",
("gasName", Name),
("gasAmount", Amount));
}
}

View File

@@ -6,9 +6,9 @@ using Content.Shared.GameTicking;
using Content.Shared.Prototypes;
using Content.Shared.Roles;
using Content.Shared.Utility;
using Robust.Shared.Enums;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -19,7 +19,7 @@ namespace Content.Shared.Preferences
/// Character profile. Looks immutable, but uses non-immutable semantics internally for serialization/code sanity purposes.
/// </summary>
[Serializable, NetSerializable]
public class HumanoidCharacterProfile : ICharacterProfile, IGenderable
public class HumanoidCharacterProfile : ICharacterProfile
{
private readonly Dictionary<string, JobPriority> _jobPriorities;
private readonly List<string> _antagPreferences;
@@ -286,7 +286,12 @@ namespace Content.Shared.Preferences
}
public string Summary =>
Loc.GetString(" This is {0}. {2:They} {2:are} {1} years old.", Name, Age, this);
Loc.GetString(
"humanoid-character-profile-summary",
("name", Name),
("gender", Gender.ToString().ToLowerInvariant()),
("age", Age)
);
public bool MemberwiseEquals(ICharacterProfile maybeOther)
{

View File

@@ -9,8 +9,9 @@ using Content.Shared.Preferences;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using Robust.Shared;
using Robust.Shared.Enums;
using Robust.Shared.IoC;
using Robust.Shared.Localization.Macros;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;

View File

@@ -0,0 +1,5 @@
### UI
# Used for GasEntry.ToString()
gas-entry-info = {$gasName}: {$gasAmount} mol

View File

@@ -0,0 +1,8 @@
### UI
# Current game score
blockgame-points-label = Points: {$points}
# Current game level
blockgame-level-label = Level: {$level}

View File

@@ -0,0 +1,19 @@
### UI
# Shown when an empty flash is examined at any range
flash-component-examine-empty = It's burnt out!
# Shown when a flash is examined in details range
flash-component-examine-detail-count = The flash has [color={$markupCountColor}]{$count}[/color] {$count ->
[one] use
*[other] uses
} remaining.
### Interaction Messages
# Shown when someone flashes you with a flash
flash-component-user-blinds-you = {$user} blinds you with the flash!
# Shown when a flash runs out of uses
flash-component-becomes-empty = The flash burns out!

View File

@@ -0,0 +1,14 @@
### UI
# Shown when an RCD is examined in details range
rcd-component-examine-detail-count = It's currently on {$mode} mode, and holds {$ammoCount ->
*[zero] no charges.
[one] one charge.
[other] {$ammoCount} charges.
}
### Interaction Messages
# Shown when changing RCD Mode
rcd-component-change-mode = The RCD is now set to {$mode} mode.

View File

@@ -0,0 +1,16 @@
### UI
# Shown when a stack is examined in details range
stack-component-examine-detail-count = {$count ->
[one] There is [color={$markupCountColor}]{$count}[/color] thing
*[other] There are [color={$markupCountColor}]{$count}[/color] things
} in the stack.
### Interaction Messages
# Shown when attempting to add to a stack that is full
stack-component-already-full = Stack is already full.
# Shown when a stack becomes full
stack-component-becomes-full = Stack is now full.

View File

@@ -0,0 +1,15 @@
### Interaction Messages
# Shown when examining an in-construction object
construction-insert-prototype-no-name = Next, insert {$prototypeName}.
# Shown when examining an in-construction object
construction-insert-prototype = Next, insert {$entityName}.
# Shown when examining an in-construction object
construction-insert-entity-with-component = Next, insert an entity with a {$componentName} component.
# Shown when examining an in-construction object
construction-insert-exact-entity = Next, insert {$entityName}.

View File

@@ -0,0 +1,9 @@
### Interaction Messages
# When trying to eat food without the required utensil
food-you-need-utensil = You need to use a {$utensil} to eat that!
# When trying to eat food without the required utensil... but you gotta hold it
food-you-need-to-hold-utensil = You need to be holding a {$utensil} to eat that!

View File

@@ -0,0 +1,22 @@
### UI
# Shown when clicking your Role Button in Suspicion
suspicion-ally-count-display = {$allyCount ->
*[zero] You have no allies
[one] Your ally is {$allyNames}
[other] Your allies are {$allyNames}
}
# Shown when greeted with the Suspicion role
suspicion-role-greeting = You're a {$roleName}!
# Shown when greeted with the Suspicion role
suspicion-objective = Objective: {$objectiveText}
# Shown when greeted with the Suspicion role
suspicion-partners-in-crime = {$partnersCount ->
*[zero] You're on your own. Good luck!
[one] Your partner in crime is {$partnerNames}.
[other] Your partners in crime are {$partnerNames}.
}

View File

@@ -0,0 +1,20 @@
### UI
# Shown at the end of a round of Traitor
traitor-round-end-result = {$traitorCount ->
[one] There was one traitor.
*[other] There were {$traitorCount} traitors.
}
# Shown at the end of a round of Traitor
traitor-user-was-a-traitor = {$user} was a traitor.
# Shown at the end of a round of Traitor
traitor-objective-list-start = and had the following objectives:
# Shown at the end of a round of Traitor
traitor-objective-condition-success = {$condition} | [color={$markupColor}]Success![/color]
# Shown at the end of a round of Traitor
traitor-objective-condition-fail = {$condition} | [color={$markupColor}]Failure![/color] ({$progress}%)

View File

@@ -0,0 +1,10 @@
### UI
# Displayed in the Character prefs window
humanoid-character-profile-summary =
This is {$name}. {$gender ->
[male] He is
[female] She is
*[other] They are
} {$age} years old.

View File

@@ -1,43 +0,0 @@
- msgid: New Game
msgstr: Nuova Partita
- msgid: Scoreboard
msgstr: Classifica
- msgid: Pause
msgstr: Pausa
- msgid: Unpause
msgstr: Riprendi
- msgid: Gameover!
msgstr: Partita Finita!
- msgid: Highscores
msgstr: Record
- msgid: Back
msgstr: Indietro
- msgid: Next
msgstr: Prossimo
- msgid: Hold
msgstr: Conservato
- msgid: Global
msgstr: Globale
- msgid: Local
msgstr: Locale
- msgid: Points
msgstr: Punti
- msgid: Level
msgstr: Livello
- msgid: Station
msgstr: Stazione

View File

@@ -1,19 +0,0 @@
# Example Dutch translations
- msgid: wrench
msgstr: moersleutel
- msgid: welding tool
msgstr: lasapparaat
- msgid: crowbar
msgstr: koevoet
- msgid: screwdriver
msgstr: schroevendraaier
- msgid: wirecutters
msgstr: draadtang
- msgid: multitool
msgstr: multi tool # This is what google translate gives me idk.

View File

@@ -41,5 +41,3 @@
baseSprintSpeed: 14
baseWalkSpeed: 7
- type: MovementIgnoreGravity
- type: Grammar
proper: true

View File

@@ -327,5 +327,3 @@
- type: Appearance
visuals:
- type: RotationVisualizer
- type: Grammar
proper: true