Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added l10n support to server messages #19847

Merged
merged 2 commits into from Apr 3, 2022

Conversation

Mailaender
Copy link
Member

Last bit of engine support #10475 required.

@Mailaender Mailaender mentioned this pull request Dec 18, 2021
16 tasks
@pchote
Copy link
Member

pchote commented Dec 18, 2021

We really need a way to expose these string ids to the linter for this to be in any way maintainable (which is why it has been listed high #10475 from the start). I suggest that this could be done similarly to hotkeys, with a [Translation] attribute applied to TraitInfo fields covering those aspects of [HotkeyReference], and something similar to [ChromeLogicArgsHotkeys] to list the hardcoded references used inside chrome logic.

@Mailaender Mailaender force-pushed the fluent-server-orders branch 2 times, most recently from 137a0d8 to ac1b804 Compare December 20, 2021 16:44
@Mailaender
Copy link
Member Author

I updated this with typed arguments, a new TranslationAttribute and lint test. The downside is that it bloats up the effort by requiring a string to be referenced 3 times. Extracting the strings is error-prone and they tend to be duplicated in the existing code base, so some kind of lint check is definitely handy to check for problems.

OpenRA.Game/Network/Order.cs Outdated Show resolved Hide resolved
OpenRA.Game/Server/Server.cs Outdated Show resolved Hide resolved
@Mailaender
Copy link
Member Author

Updated. Also replaced my own basic .ftl parser with Fluent.Net which adds a syntax check.

@Mailaender Mailaender force-pushed the fluent-server-orders branch 5 times, most recently from 55c2773 to f0729a1 Compare December 21, 2021 17:31
@abcdefg30
Copy link
Member

This has conflicts.

@Mailaender
Copy link
Member Author

Rebased.

OpenRA.Game/Server/Server.cs Outdated Show resolved Hide resolved
OpenRA.Game/Server/Server.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs Outdated Show resolved Hide resolved
OpenRA.Game/Server/Server.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs Outdated Show resolved Hide resolved
@Mailaender Mailaender force-pushed the fluent-server-orders branch 2 times, most recently from 158172c to cbcb080 Compare March 13, 2022 10:26
RoosterDragon
RoosterDragon previously approved these changes Mar 16, 2022
OpenRA.Game/Server/Server.cs Outdated Show resolved Hide resolved
OpenRA.Game/Network/LocalizedMessage.cs Show resolved Hide resolved
@teinarss teinarss merged commit 0260884 into OpenRA:bleed Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants