Skip to content

CheckTranslationReference lint pass learns additional checks#21389

Merged
PunkPun merged 4 commits into
OpenRA:bleedfrom
RoosterDragon:translation-lint-min
Apr 24, 2024
Merged

CheckTranslationReference lint pass learns additional checks#21389
PunkPun merged 4 commits into
OpenRA:bleedfrom
RoosterDragon:translation-lint-min

Conversation

@RoosterDragon

Copy link
Copy Markdown
Member
  • Test all translation languages, not just English.
  • Report any fields marked with TranslationReferenceAttribute that the lint pass lacked the knowledge to check.
  • Improve context provided by lint messages.
  • Restructure code for readability.

Additionally:

  • Fix some bugs in Translation.
  • Tweak some UI Yaml files.
  • Inject platform dependency in SpriteFont.

Assists with #10475. Split from #21293

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is quite wordy 😅

OpenRA.Utility(1,1): Warning: Missing attribute description of key dropdown-map-creeps in en language in mod translation files required by Actor world trait MapCreeps.CheckboxDescription

it also seems that there's a wording missmatch

Testing map: Atreides 01a
OpenRA.Utility(1,1): Warning: Missing key dropdown-map-creeps.description in en language in map translation files required by Actor world trait MapCreeps.CheckboxDescription

When I tried to overwrite a key in fort lonestar I got spammed with errors. There should be just 3
Screenshot 2024-04-06 at 12 55 59

Comment thread OpenRA.Mods.Common/Lint/CheckTranslationReference.cs
- Increase space of some elements to fit their text.
- Remove editor text that aren't translation keys. The text will be set in code anyway.
- Remove some unused elements.
- Provide a translation key for the port separator, to avoid log warnings.
This avoids needing to access the global Game.Renderer.
- Use error.Message to reports errors, as error.ToString isn't overridden.
- Ensure multiple translation languages are handled correctly, we need to use a list to maintain English being the first one.
- Test all translation languages, not just English.
- Report any fields marked with TranslationReferenceAttribute that the lint pass lacked the knowledge to check.
- Improve context provided by lint messages.

Restructure code for readability.
@RoosterDragon

Copy link
Copy Markdown
Member Author

this is quite wordy 😅

Open to wording suggestions, I wanted to ensure the message provided plenty of detail so naturally it's not a short message.

it also seems that there's a wording missmatch

Unified to "Missing key " for both cases.

When I tried to overwrite a key in fort lonestar I got spammed with errors. There should be just 3

Fixed.

Thanks for the review, this certainly tidies up a few rough edges.

@PunkPun PunkPun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGETM

@PunkPun
PunkPun merged commit 10d7436 into OpenRA:bleed Apr 24, 2024
@PunkPun

PunkPun commented Apr 24, 2024

Copy link
Copy Markdown
Member

changelog

@RoosterDragon
RoosterDragon deleted the translation-lint-min branch April 24, 2024 17:45
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.

2 participants