Saibot393 / enhancedcombathud-pf2e

GNU General Public License v3.0
2 stars 3 forks source link

No translation when using Argon HUD #31

Closed Lioheart closed 4 months ago

Lioheart commented 4 months ago

When using Argon HUD and system translation at the same time, translations of some actions displayed in Argon HUD do not appear.

obraz

When the module is disabled, the Hide action is translated correctly. This applies to system translations in all languages.

Saibot393 commented 4 months ago

Hmm, strange, i think what happens is, that Argon PF2E loads some of the actions before the translations modules hvae time to translate them and thereby completely stops the translation, i will see if i can find a work around

Lioheart commented 4 months ago

Thanks, I'd appreciate it

Lioheart commented 4 months ago

The Russian translators tried to solve this by adding the following code

Hooks.on('babele.ready', () => {
  for (const pack of game.packs.values()) {
    if (pack.size > 0) {
      for (const k of pack.keys()) {
        pack.delete(k);
      }
    }
   }
 })
Saibot393 commented 4 months ago

Thank you, i will play around with the code, seems to be a good start

Cuingamehtar commented 4 months ago

To be more specific, I used that to sort-of solve the general Babele issue where the item is cached in the compendium before it is translated by Babele (in case it's linked in chat history, for example). It doesn't look like game.pf2e.actions.get(action) actually creates such cache, so I'm not sure that'll work.

Saibot393 commented 4 months ago

For the in panel actions i am actually using the action items. From my testing the game.pf2e.actions.get(action) do actually not seem to havy any problem with the translations so i might need to change the panel actions to those

Cuingamehtar commented 4 months ago

It might be better to do that, I think, as those get their names and content from core i18n subsystem, and don't depend on the behavior of third party modules.

Saibot393 commented 4 months ago

The bug should be solved with v1.8.5, actions are now loaded from game.pf2e.actions instead of the item compendium, this will also make it easier to implement "on the fly" changing of the actions in the future