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

Clean up language definitions #208

Merged
merged 3 commits into from May 23, 2021
Merged

Clean up language definitions #208

merged 3 commits into from May 23, 2021

Conversation

frosch123
Copy link
Member

Recently some language definitions in OpenTTD changed.

  • There is a new plural form 14.
  • Romanian switched plural forms.
  • New languages were added.

This PR adapts NML for that:

  • The new plural form is added.
  • NML maintained its own list of language ids and plural forms.
    • This list is removed.
    • NML allowed using an iso-code as ##grflangid. This was undocumented, and probably only used in the regression tests. This features is removed.
    • NML validated the plural forms of translations against an internal list of all known languages. It errored hard, if they differed. I have no idea why this validation was added. But it is unnecessary, and rejecting old NewGRF sources because some language switched plural forms, is unreasonable. Thus, this validation is removed.

In theory, the language info can be extracted/generated from https://translator.openttd.org/language-list

  • Maintaining a list in NML sources is a burden, even when generated, and IMO not worth for the use cases.
  • Fetching the list at run-time is unusual for a compiler.

There is no need for NewGRF to use the same plural forms for languages as OpenTTD.
Sometimes the plural forms change, and when that happens erroring on existing NML NewGRF is unreasonable.
This 'feature' was undocumented, not used by eints, and probably only used in the regression tests.
Maintaining a list of all translations in NML source is not worth the effort.
@frosch123 frosch123 merged commit 20643ef into OpenTTD:master May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants