minetest / contentdb

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

Collection of string issues #539

Open Wuzzy2 opened 3 weeks ago

Wuzzy2 commented 3 weeks ago

Summary

After translating ContentDB strings again, I ran into a couple of low-quality strings so I suggest to fix/improve them.

Strings with syntax/grammar/spelling mistakes

Go to <a href='https://forum.minetest.net/ucp.php?i=profile&mode=signature'>User Control Panel > Profile > Edit signature</a>

[FIXED!] This string contains literal "greater than" signs inside HTML. This is a syntax error. Replace with the HTML escape code.

(Public, change from Profile > My Collections)

Not a problem with the string itself, but when I put the ">" sign in the translation in Weblate, it turns it into a HTML escape code, which then shows up literally when this message appears in ContentDB. I believe this needs to be fixed in Weblate settings or something, idk.

Mods and games that aim to simulate real life activity. Similar to SimCity/TheSims/OpenTTD/etc

[FIXED!] Replace "TheSims" with "The Sims" (official name). Replace "etc" with "etc.".

Requires futher installation steps, such as installing luarocks or editing the trusted mod setting

[FIXED!] Replace "luarocks" with "LuaRocks" (official name).

Focus on player chat/communication or who's primary function is interacting with the console.

[FIXED!] Poor/weird grammar. Suggestion: "Focus on player chat/communication or the primary function is console interaction."

For more information about what the cost of ContentDB and what rubenwardy does, see his donation page:

[FIXED!] Poor grammar. Suggestion: Remove the first "what".

Duplicate strings

Storage

[FIXED!] This string is used twice with two completely different contexts. The first context is for a tag for item storage like chests. The second context is storage of data. In German, it must be translated with 2 different words (there is no workaround, sorry).

Please use a gettext context or change one of the strings to fix the ambiguity.

Strings of low quality (debatable)

For content whose main utility / feature is in GUI/formspec form

[FIXED!] Too technical. Avoid the term "formspec". I suggest: "For content whose main utility about providing or improving the GUI, on-screen menus and the like"

Adds mobs, animals, and NPCs

[FIXED!] Replace "NPCs" with "non-player characters". Because this is the long description of a tag.

Forks of MTG

[FIXED!] This is a long tag description, so write it in full: "Forks of Minetest Game"

rubenwardy commented 3 weeks ago

I've fixed all the non-tag issues, I delegate the management of tags to others

This string is used twice with two completely different contexts. The first context is for a tag for item storage like chests. The second context is storage of data. In German, it must be translated with 2 different words (there is no workaround, sorry).

Please use a gettext context or change one of the strings to fix the ambiguity.

There are now gettext contexts for tags and content_warnings

Wuzzy2 commented 3 weeks ago

I just went ahead and edited the tag descriptions myself in the tag editor.

Now all strings should be fixed but Weblate needs another update for the tags.

OK, there is one exception. Maybe.

(Public, change from Profile > My Collections)

This string appears when I favourite something. Weblate still forces a HTML escape code for ">" in my translation. Any idea how to fix it?

Dragonop commented 3 weeks ago

I agree on most other stuff, but I'll comment on the GUI tag, since I'm the one that originally added that tag

For content whose main utility / feature is in GUI/formspec form

[FIXED!] Too technical. Avoid the term "formspec". I suggest: "For content whose main utility about providing or improving the GUI, on-screen menus and the like"

While it's true that it is technical, the suggested change doesn't reflect the actual use case of the GUI tag, this tag is meant for mods where the main mechanic or features they provide are accessed using a GUI (a graphical interface, contrary to world interaction), it is not for mods that improve on existing GUI's and inventories, that's what the Inventory tag is for

To build up on your suggestion, I suggest: "For content whose main utility or features are provided within a GUI, on-screen menu, or similar"

Dragonop commented 3 weeks ago

I just went ahead and edited the tag descriptions myself in the tag editor.

For reference what rubenwardy meant by "I delegate the management of tags to others" is that @Lemente (and sometimes me) are the one who takes care of it

Wuzzy2 commented 3 weeks ago

Feel free to edit the GUI description further. My only issue is the word "formspec" being too technical since players might not know what that is. "formspec" is a Minetest-only term.

rubenwardy commented 1 week ago
(Public, change from Profile > My Collections)

Not a problem with the string itself, but when I put the ">" sign in the translation in Weblate, it turns it into a HTML escape code, which then shows up literally when this message appears in ContentDB. I believe this needs to be fixed in Weblate settings or something, idk.

Looks like this is the only remaining issue here. Any idea what I need to do to tell weblate whether a string is html or plaintext?

Wuzzy2 commented 6 days ago

I dug through the documentation and I think I found the problem! The string has the flag "safe-html" set in Weblate. safe-html checks for "unsafe" HTML characters in the string. And apparently, safe-html comes with an autofixer. Obviously, we don't want this here.

https://docs.weblate.org/de/weblate-5.5.5/user/checks.html#check-safe-html

Note this can only be fixed in Weblate since this is Weblate behavior. It has nothing to do with the ContentDB itself.

To fix this, replace the flags with "ignore-safe-html". You can do this by navigating to the offending string in Weblate and then click the little edit button at the flags to the right.

rubenwardy commented 6 days ago

So my preference would be to use two different gettext functions in the app, one for plaintext and one for html. The html one would have safe-html to escape > to &gt;.

The Customizing behavior using flags section implies you can set flags from a translation file but the "Supported file formats" page doesn't say how to do it for Gettext:

Per-string flags extracted from the file format, see Supported file formats

Wuzzy2 commented 5 days ago

You can change it directly in the Weblate interface. But if you want to do this directly in the PO file, I don't know what to do.

Maybe ask #weblate on libera.chat IRC?