ben / foundry-ironsworn

Ironsworn and Starforged, for Foundry VTT
Other
68 stars 42 forks source link

Assets translation #118

Open sharak opened 3 years ago

sharak commented 3 years ago

Hello.

I'm finishing translating the CORE file to spanish (with the new updates) and I see that the moves are loaded through a JSON file. As far as I can see, the same mechanics are not implemented for translating the assets (or the rest of the elements). Is something similar going to be implemented or do I just translate the compendiums with Babele? Or even easier, how should I translate the assets?

Thanks!

ben commented 3 years ago

Hey, it's great to hear from you!

Sadly, Foundry's translation system doesn't allow for multilingual compendia. All the built-in moves and oracles are run through the translation calls before they're displayed, but the content in the built-in compendia (assets, delve themes/domains, foes, etc.) is and always will be in English.

I'm not sure of the best way forward. I don't think it makes a ton of sense to clutter every user's compendium tab with 20+ compendia in languages they don't know how to read. Maybe we do separate modules? That way you could install "ironsworn-es" to get the Spanish compendium content.

Anyways, for now, if you translate the content that's in en.json, it should show up in the main character sheet. I'll look into ways we can include the built-in content without using compendium items, that way the work you're doing will be used more universally.

– Ben

On Sat, Aug 21, 2021 at 9:50 AM Roberto Lorite @.***> wrote:

Hello.

I'm finishing translating the CORE file to spanish (with the new updates) and I see that the movements are loaded through a JSON file. As far as I can see, the same mechanics are not implemented for translating the assets (or the rest of the elements). Is something similar going to be implemented or do I just translate the compendiums with Babele? Or even easier, how should I translate the assets?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ben/foundry-ironsworn/issues/118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJXXWI3VY5DSSS6I6HR5DT57KMTANCNFSM5CSAKWZQ .

sharak commented 3 years ago

Hi Ben.

Do you know Babele? https://gitlab.com/riccisi/foundryvtt-babele

It is a module for Foundry that allows the translation of compendiums.

At first I was thinking of making a translation module through Babele. So you don't have to include a dependency in your project, since the dependency is only for translating. But I saw the use that you make of the moves and the JSON files that you use for the importDatasworn function and i was not very sure the use that you want to make of the compendiums. If the assets, foes, etc., go through compendiums without any "magic" behind, I can translate them with Babele. But I didn't want to do it without first understanding your intentions with the assets.json, foes.json files and so on.

Thank you very much Roberto

aldarion-jdr commented 2 years ago

Hello Ben ! I'd like to translate your system in french. I know already how to use Babele for Compendia but I couldn't find World's Truth. Where xould they be accessible?

em-squared commented 2 years ago

Hi @aldarion-jdr the World's Truth content is translatable without babele: https://github.com/ben/foundry-ironsworn/blob/main/system/lang/en.json#L1004. Just add /lang/fr.json and reference it in system.json.

Let me know if you need help to translate Ironsworn system in french (I'm french too).

jesberpen commented 2 years ago

@aldarion-jdr and @em-squared I've been translating the compendia to spanish using Babele, but I'm having some issues. On the assets, the checkmarks are gone, this one is easy to overlook in any case, but with the delve domains and themes, it seems that Babele breaks the rolling tables from the script. I've been trying different things with no success, have you managed to get it all working in French?

@ben the delve domains and themes localisation part of the main json file is it used anywhere? because I did a translation in the es.json file matching all the lines from the en.json but it doesn't seem to have an effect on the themes and domains.

jesberpen commented 2 years ago

I've finished with the Babele translation, there are some issues as mentioned in my previous comment, but I managed to circumvent them, the solution is not perfect, but it works and you have the whole system in Spanish with the compendia. it should be up and running in foundry soon. I've used the same es.json file from my babele module to update the one in this project too, as is the same, so in case someone doesn't want the compendia translated, at least the spanish one is up to date with the system version.

aldarion-jdr commented 2 years ago

Hi guys, Thanks for your replies ! I'm working on Starfinder's french translation in priority. Though I started to work on the fr locale on the side.

I'll upload it asap after first tests on my PC. @em-squared I'd really appriciate some help !

@sharak For now I don't intend to translate Delve Domains and I'm not working with Babele and compendia in Ironsworn yet. Stil, I'm using it for Starfnder. Did you use items' ids in reference or their names? For checkmarks I use the HTML code, not some special character from windows or else. If you're talking about chekmark character of course, it might be a solution.

aldarion-jdr commented 2 years ago

Hi guys ! First version of french locale is ready, how can I push it on your repo? How do you proceeed?

Thanks for your help !

ben commented 2 years ago

To add a new translation file, you can make a PR that looks a lot like #14. For French, the file should probably be called fr.json.

aldarion-jdr commented 2 years ago

I have the fr.json file but I can't create a PR :/

aldarion-jdr commented 2 years ago

Hey @ben ! Sorry but it seems that I'm not authorized to create a pull request. What can I do?

ben commented 2 years ago

Sorry for the delay. Can you upload it somewhere I can download it, and I'll do the integration?

aldarion-jdr commented 2 years ago

Sure. But it's odd that I'm not able to register a PR.

Yaushee commented 1 year ago

Hello, I've started working on expanding the FR translation to other compendia items than the assets, through Babele. I've taken both the FR and ES files as reference, however I'm not sure why the translation of the names from the moves is working, but not the description content. Especially since @jesberpen mentioned being able to translate everything to Spanish?

I'm guessing it's something to do with the mapping, but after looking into the system's innards and trying other things, I can't seem to fix it, as the system seems to point to data.description anyway.

image image

image

I have very limited coding knowledge unfortunately, so any help would be appreciated.

ben commented 1 year ago

You're on the right track! The data you're looking at is for an older version of moves, though. The data layout changed to match Dataforged. The Face Danger move now includes the data pasted below. There are a bunch of fields, but here's a quick guide to how the ones you're concerned with are used:

It's occurring to me that I should write a localization guide in the wiki. Anyways, here's the data for Face Danger, as grabbed from the db file:

{
  "_id": "e6ed148eff82c171",
  "name": "Face Danger",
  "type": "sfmove",
  "img": "icons/dice/d10black.svg",
  "data": {
    "dfid": "Starforged/Moves/Adventure/Face_Danger",
    "Category": "Starforged/Moves/Adventure",
    "Progress Move": false,
    "Variant of": "",
    "Text": "**When you attempt something risky or react to an imminent threat**, envision your action and roll. If you act...\n\n  * With speed, mobility, or agility: Roll +edge\n  * With resolve, command, or sociability: Roll +heart\n  * With strength, endurance, or aggression: Roll +iron\n  * With deception, stealth, or trickery: Roll +shadow\n  * With expertise, focus, or observation: Roll +wits\n\nOn a **strong hit**, you are successful. Take +1 momentum.\n\nOn a **weak hit**, you succeed, but not without a cost. Make a suffer move (-1).\n\nOn a **miss**, you fail, or a momentary success is undermined by a dire turn of events. @Compendium[foundry-ironsworn.starforgedmoves.78baa51694fe37c5]{Pay the Price}.",
    "Trigger": {
      "Text": "When you attempt something risky or react to an imminent threat...",
      "Options": [
        {
          "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger/Options/1",
          "Text": "With speed, mobility, or agility",
          "Roll type": "Action roll",
          "Method": "Any",
          "Using": ["Edge"]
        },
        {
          "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger/Options/2",
          "Text": "With resolve, command, or sociability",
          "Roll type": "Action roll",
          "Method": "Any",
          "Using": ["Heart"]
        },
        {
          "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger/Options/3",
          "Text": "With strength, endurance, or aggression",
          "Roll type": "Action roll",
          "Method": "Any",
          "Using": ["Iron"]
        },
        {
          "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger/Options/4",
          "Text": "With deception, stealth, or trickery",
          "Roll type": "Action roll",
          "Method": "Any",
          "Using": ["Shadow"]
        },
        {
          "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger/Options/5",
          "Text": "With expertise, focus, or observation",
          "Roll type": "Action roll",
          "Method": "Any",
          "Using": ["Wits"]
        }
      ],
      "dfid": "Starforged/Moves/Adventure/Face_Danger/Trigger"
    },
    "Outcomes": {
      "Strong Hit": {
        "Text": "You are successful. Take +1 momentum.",
        "dfid": "Starforged/Moves/Adventure/Face_Danger/Outcomes/Strong_Hit"
      },
      "Weak Hit": {
        "Text": "You succeed, but not without a cost. Make a suffer move (-1).",
        "dfid": "Starforged/Moves/Adventure/Face_Danger/Outcomes/Weak_Hit"
      },
      "Miss": {
        "Text": "You fail, or a momentary success is undermined by a dire turn of events. @Compendium[foundry-ironsworn.starforgedmoves.78baa51694fe37c5]{Pay the Price}.",
        "dfid": "Starforged/Moves/Adventure/Face_Danger/Outcomes/Miss"
      },
      "dfid": "Starforged/Moves/Adventure/Face_Danger/Outcomes"
    },
    "Oracles": [],
    "Source": {
      "Title": "Ironsworn: Starforged Rulebook",
      "Authors": ["Shawn Tomkin"],
      "Date": "050622",
      "Page": 147
    },
    "Suggestions": {},
    "Name": "Face Danger",
    "Optional": false,
    "Display": { "Title": "Face Danger", "Color": "#3C70A4" }
  },
  "effects": [],
  "folder": null,
  "sort": 0,
  "permission": { "default": 0, "gXcI9ebHCY1jasJg": 3 },
  "flags": {}
}
ben commented 1 year ago

Bingo! https://github.com/ben/foundry-ironsworn/wiki/Localization Let me know if there's anything missing there and I'll try to make it more clear.

Yaushee commented 1 year ago

Thank you for your help!

Would it look something like that then, if I'm understanding the structure correctly?

{
    "label": "Ironsworn - Actions",
    "mapping": {
        "description": "data.Text",
        "trigger": "data.Trigger.Text",
        "strong": "data.Outcomes.Strong Hit.Text",
        "weak": "data.Outcomes.Weak Hit.Text",
        "miss": "data.Outcomes.Miss.Text"
    },

Because... That's not working xD (without data. either) Only the name gets translated still...

ben commented 1 year ago

🤔 According to what I'm reading on the babele site, that should work. One thing I'd recommend is taking the move sheet out of the equation, and opening up the moves compendium directly. If it works there but not in the system UI, then you can at least keep moving while I fix my issues.

Yaushee commented 1 year ago

Yep, unlocking the compendia and editing the moves directly in Foundry works at least! (the move sheet is updated after a reload).

In the meantime, I've updated the fr.json global translation, if you wanna include it in the next update! I don't really know how to create a pull request (if it's the right term) but I uploaded it here: https://github.com/ben/foundry-ironsworn/compare/main...Yaushee:foundry-ironsworn:main

Fixes:

There's still a lot of Delve content that's untranslated, but that's something at least :)

aldarion-jdr commented 1 year ago

Hello everyone ! Thanks for your help Yaushee ! If you want to create a pull request you'll need to "fork" the system on your Github and upload your updated file there. After that you will be able to create a Pull Request on Ben's Ironworn system repository that will check all diffrences. Ben will then have a notification for its validation. And "voilà".

Here you'll find all the details you'll need : https://docs.github.com/en/get-started/quickstart/fork-a-repo https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

I have a lot of work prepared and done on compendiums, if you'd like to help you'll be welcomed !