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

Similar items share translation strings, which is inappropriate for languages with gendered nouns #9260

Open
2 tasks done
felix-schneider opened this issue Nov 7, 2024 · 3 comments
Labels
bug Something doesn't work translation Things related to languages and translations
Milestone

Comments

@felix-schneider
Copy link
Contributor

Preliminary checks

Platform

Windows

Describe the bug

Consider these two items from the OG:
image
image
In English these two items (the Dragon Sword of Dominion and the Power Axe of Dominion) use the same translation string: The %{name} increases the hero's attack skill by %{count}, but in German the Axe is grammatically female and the Sword is grammatically neutral, requiring a different translation. The OG has separate strings for these.

Maybe related #5248

Save file

N/A

Additional info

No response

@felix-schneider felix-schneider added the bug Something doesn't work label Nov 7, 2024
@zenseii zenseii added the translation Things related to languages and translations label Nov 7, 2024
@zenseii zenseii added this to the 1.2.0 milestone Nov 7, 2024
@zenseii
Copy link
Collaborator

zenseii commented Nov 7, 2024

This is relevant for all current translations.

This issue is both due to limitations in gettext which is what we use for localizations, and our choice to not generate unique strings for every instance of a text which only changes an object in it. I don't think the solution would be to make all strings like the issue example unique for every possible artifact.

Perhaps we should investigate a separate solution/library to this or see if we can expand the functionality of gettext to do this.

@felix-schneider
Copy link
Contributor Author

felix-schneider commented Nov 7, 2024

While I'm not very familiar with i18n solutions for C++, I don't think there is a library that would make this case significantly easier. You could avoid some redundancy by having a field for "definite form of artifact name" (i.e. with the article) and just the bare name, but then you are just inviting yourself for the next pitfall of a language where the third-person singular form of the verb is also gendered (which I'm sure exists).

Realistically, I don't think there is a better solution than having the artifact description strings be translatable in their entirety, and having only the numerical value of the bonus as a replacement variable.

Edit: At this time,

  • 7 artifacts share the attack skill description
  • 4 artifacts share the defense skill description (plus the breastplate of Anduran, which is missing the word "skill")
  • 6 artifacts share the spell power description
  • 5 artifacts share the knowledge description

I do not necessarily see this as an unacceptable amount of duplication, should all of these be fully spelled out.

@zenseii
Copy link
Collaborator

zenseii commented Nov 9, 2024

As discussed in Discord, for German the solution requiring least amount of work and least amount of code changes with an acceptable result is the one we have used for languages facing similar problems, like French, Norwegian, Spanish.

The solution is to include the definite article ("The" or "Das" etc.") within the artifact name's string. The slight downside to this is that artifact headers in fheroes2 will include the definite article, whereas originally they didn't. This isn't grammatically wrong, but for some players that could notice this change, it could look a bit unusual.

Example:
Compare this solution to the first image in the opening post:
image

As for languages that might have further requirements, we don't currently support any of those as far as I'm aware, and I don't think we should approach these language problems as if we will include support for every current or future language in the world, I believe a more pragmatic approach is better considering our resources and the size of the project.

With that said, I believe we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work translation Things related to languages and translations
Projects
None yet
Development

No branches or pull requests

2 participants