foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
336 stars 224 forks source link

canot open many compendium entrys on german language #2603

Closed R0TEAM closed 2 months ago

R0TEAM commented 11 months ago

error:

Uncaught (in promise) TypeError: undefined. m.replace is not a function [Detected 2 packages: FoundryVTT-dnd5e-DE, babele] at FieldMapping.convertSource [as converter] (dnd5e-de.js:546:46) at FieldMapping.translate (babele.js:1006:26) at FieldMapping.map (babele.js:989:28) at babele.js:1072:62 at Array.reduce () at CompendiumMapping.map (babele.js:1072:28) at TranslatedCompendium.translate (babele.js:1235:43) at Babele.translate (babele.js:763:19) at babele.js:78:54 at Array.map () at 🎁ClientDatabaseBackend.prototype._getDocuments#babele (babele.js:77:27) at async CompendiumCollection.getDocuments (foundry.js:16280:23) at async CompendiumCollection.getDocument (foundry.js:16252:23) at async Compendium._onClickEntryName (foundry.js:70218:57)

Thoeme77 commented 10 months ago

Having the same issue. Any plans for a fix of this?

dnd5e-de.js:546 Uncaught (in promise) TypeError: m.replace is not a function at FieldMapping.convertSource [as converter] (dnd5e-de.js:546:46) at FieldMapping.translate (babele.js:1006:26) at FieldMapping.map (babele.js:989:28) at babele.js:1072:62 at Array.reduce () at CompendiumMapping.map (babele.js:1072:28) at TranslatedCompendium.translate (babele.js:1235:43) at Babele.translate (babele.js:763:19) at babele.js:78:54 at Array.map () at 🎁ClientDatabaseBackend.prototype._getDocuments#babele (babele.js:77:27) at async CompendiumCollection.getDocuments (foundry.js:16280:23) at async CompendiumCollection.getDocument (foundry.js:16252:23) at async Compendium.clickCompendiumEntry (monks-enhanced-journal.js:794:30)

Edit: In case anyone is looking for a temporary fix, you can do the following.

  1. Open "dnd5e-de.js" (path should be something like this /YourFoundryInstall/Data/modules/FoundryVTT-dnd5e-DE/...)
  2. Navigate to line 546 and change the line to:

translation = translation + ' (' + m.toString().replace('pg.', 'S.').replace('PG.', 'S.') + ')';

The error seems to be that sometimes 'm' isn't a string therefore 'replace' is failing. Keep in mind this is only a temporary fix, but you should be able to open the compendium entries again. Also I have no idea if this breaks anything else, but so far it seemed to work for me.

arbron commented 10 months ago

This would be a problem with the German translation module, not the system. You should bring this issue up on their repo.

Looks like there is already an issue open: https://github.com/mhilbrunner/foundryvtt-dnd5e-lang-de/issues/8

Thoeme77 commented 10 months ago

Alright, thanks for letting me know and already checking the other issues. I hope you don't mind if the "quick fix" stays here in case someone else needs it. At least until there is an update from the devs.