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

CheckTranslationReference lint pass learns additional checks #21389

Merged
merged 4 commits into from Apr 24, 2024

Conversation

RoosterDragon
Copy link
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

Copy link
Member

@PunkPun PunkPun left a comment

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

- 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
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.

Copy link
Member

@PunkPun PunkPun left a comment

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
3 checks passed
@PunkPun
Copy link
Member

PunkPun commented Apr 24, 2024

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.

None yet

2 participants