|
| 1 | +namespace RustPlusBot.Features.Switches.Rendering; |
| 2 | + |
| 3 | +/// <summary>The in-memory string catalog for Smart Switches: culture -> (key -> value). English is the fallback.</summary> |
| 4 | +internal sealed class SwitchLocalizationCatalog |
| 5 | +{ |
| 6 | + /// <summary>culture -> key -> value.</summary> |
| 7 | + public required IReadOnlyDictionary<string, IReadOnlyDictionary<string, string>> Strings { get; init; } |
| 8 | + |
| 9 | + /// <summary>The built-in EN/FR catalog.</summary> |
| 10 | + public static SwitchLocalizationCatalog Default { get; } = new() |
| 11 | + { |
| 12 | + Strings = new Dictionary<string, IReadOnlyDictionary<string, string>>(StringComparer.Ordinal) |
| 13 | + { |
| 14 | + ["en"] = new Dictionary<string, string>(StringComparer.Ordinal) |
| 15 | + { |
| 16 | + ["switch.status.on"] = "⚡ ON", |
| 17 | + ["switch.status.off"] = "⭘ OFF", |
| 18 | + ["switch.status.unreachable"] = "⚠️ Unreachable", |
| 19 | + ["switch.button.on"] = "Turn on", |
| 20 | + ["switch.button.off"] = "Turn off", |
| 21 | + ["switch.button.strobe"] = "Strobe", |
| 22 | + ["switch.button.rename"] = "Rename", |
| 23 | + ["switch.embed.footer"] = "Entity {0}", |
| 24 | + ["switch.prompt.title"] = "New switch detected", |
| 25 | + ["switch.prompt.body"] = "Detected a new Smart Switch ({0}). Add it?", |
| 26 | + ["switch.prompt.accept"] = "Accept", |
| 27 | + ["switch.prompt.dismiss"] = "Dismiss", |
| 28 | + ["switch.prompt.dismissed"] = "Dismissed.", |
| 29 | + ["switch.rename.modal.title"] = "Rename switch", |
| 30 | + ["switch.rename.input.label"] = "Switch name", |
| 31 | + ["switch.unreachable.ephemeral"] = "Switch is unreachable right now.", |
| 32 | + }, |
| 33 | + ["fr"] = new Dictionary<string, string>(StringComparer.Ordinal) |
| 34 | + { |
| 35 | + ["switch.status.on"] = "⚡ ALLUMÉ", |
| 36 | + ["switch.status.off"] = "⭘ ÉTEINT", |
| 37 | + ["switch.status.unreachable"] = "⚠️ Injoignable", |
| 38 | + ["switch.button.on"] = "Allumer", |
| 39 | + ["switch.button.off"] = "Éteindre", |
| 40 | + ["switch.button.strobe"] = "Stroboscope", |
| 41 | + ["switch.button.rename"] = "Renommer", |
| 42 | + ["switch.embed.footer"] = "Entité {0}", |
| 43 | + ["switch.prompt.title"] = "Nouvel interrupteur détecté", |
| 44 | + ["switch.prompt.body"] = "Nouvel interrupteur connecté détecté ({0}). L'ajouter ?", |
| 45 | + ["switch.prompt.accept"] = "Accepter", |
| 46 | + ["switch.prompt.dismiss"] = "Ignorer", |
| 47 | + ["switch.prompt.dismissed"] = "Ignoré.", |
| 48 | + ["switch.rename.modal.title"] = "Renommer l'interrupteur", |
| 49 | + ["switch.rename.input.label"] = "Nom de l'interrupteur", |
| 50 | + ["switch.unreachable.ephemeral"] = "L'interrupteur est injoignable pour le moment.", |
| 51 | + }, |
| 52 | + }, |
| 53 | + }; |
| 54 | +} |
0 commit comments