League-of-Foundry-Developers / torch

Simple torch module for Foundry VTT
10 stars 20 forks source link

Translation: Also translate the item / spell names #86

Closed yourfate closed 2 months ago

yourfate commented 2 months ago

I use german item and spell names in my game, and it seems torch doesn't detect my items or spells, it always shows the question mark. If I add a torch to a characters inventory with the original english name it seems to work.

Is there currenlty a way to get this to work other than manually adding the translated item / spell names as additional light sources?

I think the most elegant solution would be to somehow use the babele translation for them items in this module too, that way there would be no need to manually translate the items here too (duplicate work)

lupestro commented 2 months ago

Unfortunately, I can't guarantee that all modules use Babele or any other particular approach (although Babele is very likely), so the elegant cross-system solution might be hit or miss.

Nobody wants their game to get cluttered with objects with strange foreign names. ;) I did include the "aliases" key on the JSON or YAML file to use with the "Additional Light Sources" setting for just this issue. A light sources file just containing aliases would look something like:

".json" file:

{
  "dnd5e": {
    "aliases": {
      "Fackel": "Torch",
      "Kerze": "Candle"
    },
}

".yml" file - a bit simpler but indentation matters):

---
dnd5e:
  aliases:
    Fackel: Torch
    Kerze: Candle

This will recognize that a "Fackel" has the same settings as "Torch" and will recognize the presence of a Fackel in your equipment. Let me know if this helps. It's a little bit of setup, but not as intrusive as making items with translated names.

yourfate commented 2 months ago

Your json example is missing a closing curly brace for the "dnd5e" level, With that added it works well, thank you!

This is a lot easier than adding all the light sources in with all their properties, and it works for now. I only really need 2-3 sources tbh.

Should we leave this open for discussion of an automated translation system implementation in the future, or close it?

lupestro commented 2 months ago

Your json example is missing a closing curly brace for the "dnd5e" level.

Oops, sorry! By this, you can probably tell that, for the example, I was winging it. Glad you figured it out, though.

The trouble with automated translation is that you aren't just translating for a person to read, you're trying to nail the letter-perfect translation used by the system you're running in. Different tools will use different translation mechanisms, which may deliver different results. Translations can be hand-adjusted by the system developers, etc. Then we'd have to find what well they were drawing from.

Trying to do this could probably be made to work for 80-95% of the cases - and we'd be fielding bug reports for every last one of the exceptions. ;) I think this is probably safer to leave this to the alias mechanism, which users can make 100% accurate for their game. So I think we can close this one.