minetest / contentdb

A content database for Minetest mods, games, and more
https://content.minetest.net
GNU Affero General Public License v3.0
92 stars 45 forks source link

Shows translations of "game", "mod", "texture pack" in lowercase #355

Closed Wuzzy2 closed 1 month ago

Wuzzy2 commented 2 years ago

Summary

In some cases, the words "game", "mod" and "texture pack" in the translated versions are always written in lowercase, even if the translation starts with an uppercase letter.

This is the case in the searchbar ("Search X") or the rank ("Y has a game ranked #1") info and possibly other places.

Example: In German, what should be “Spiel” (game) becomes “spiel”.

rubenwardy commented 2 years ago

What are the rules for whether it should be uppercase or lowercase? In English, it's just the first letter of a sentence and proper nouns.

Types are currently translated with two strings, one for singular and one for plural.

Examples of singular:

A release is a single downloadable version of your game.
Top game
Top 5 game
You can include a .cdb.json file in your game to update these details automatically.

Example of plural:

Search games

The code currently does .lower() on the types inserted into a sentence in the middle

rubenwardy commented 2 years ago

The places where ContentDB doesn't lower the type name includes:

Wuzzy2 commented 2 years ago

In general, just don't make any blind assumptions about other languages if you don't know them. You will just stumble again and again and again, lol.

Assuming that certain words are always in lowercase in an unknown latin-script language is wrong. Automatically forcing lower case is VERY wrong.

One solution would be to provide additional strings, depending on whether it's a "title word" or a word in a sentence.

As for German, all nouns are uppercase, so it's always "Spiel" (for "game"), not "spiel".

rubenwardy commented 2 years ago

It's very hard not to make assumptions, especially when translation was added to ContentDB after the fact

I'll add variations based on whether it's a title word or in a sentence

Wuzzy2 commented 2 years ago

A better (and maybe simpler?) solution: Add a separate full sentence string for each content type instead of inserting single words into the sentence. As there are only 3 (or so) content types, this should be OK. I do this strategy for my projects all the time. This also solves possible grammar problems in certain languages.

So like, don't make the string "Do you recommend this %s?" (where %s is "game", "mod" or "texture pack") translatable, but make 3 sentences "Do you recommend this game?", "Do you recommend this mod?" and "Do you recommend this texture pack?".

Wuzzy2 commented 1 month ago

Thanks for your work! As soon I saw this update, I immediately went to work and updated German. I also saw the update a few minutes later, so I believe the changes are now live.

But this issue is still not fully fixed.

This string still writes the content type in lowercase:

Do you recommend this %(type)s?

In German becomes:

Empfehlen Sie dieses spiel?

Although the word "game" is translated "Spiel" in German.