Closed dimovpetar closed 3 years ago
Hi
This is not implemented, yet. But I see the use case.
Would it be OK if Hyphenopoly automatically loads the .wasm file if you request
a hyphenator
with settings
for a specific language that has not been loaded?
I think I could implement that in a few days.Looks interesting...
Kind regards, Mathias
Hello @mnater ,
Thanks for the fast response! Yes, loading the .wasm file when the language is requested is exactly what I need. I would still need to use "leftmin", "rightmin", "minWordLength" and the other settings, and also to force the loading of the engine, like "FORCEHYPHENOPOLY" currently does.
Something like:
Hyphenopoly.loadHyphenEngine(lang, langSettings).then(function () {
Hyphenopoly.hyphenators[lang] // Promise that resolves with the hypenator or undefined if native CSS hyphenation is supported
});
where in langSettings
I can give the testing word (i.e. "FORCEHYPHENOPOLY") and etc. Not sure if this doesn't conflict with the global settings in window.Hyphenopoly.setup.
I'm looking forward to see if you like the idea.
Best regards, Petar
This is now available in v5
Hello,
Is it possible to initialize a language only if it's needed? I need to support a lot of languages and I don't want to load all the .wasm files if they won't be used. Also the language can change at any time. Currently I'm using Hyphenators and I'm following the instructions:
Is it possible to skip the "require" part of the Configuration and add it later?
Best regards, Petar