Please check below detailed analysis supplied by our product team:
EffectiveLocaleId for spans in 4th paragraph (Das Arbeitsverhältnis…) is detected as EnglishUS.
In reveal formatting I see German language.
It is the reason why “the problem only occurs, if the german and english dictionaries are set together.”.
Aspose.Words tries to apply English hyphenation dictionary to words in 4th paragraph and it gives wrong hyphenation of the word “gesetzliche”.
MS Word shows this paragraph as US-ENGLISH. This is because it does not have w:lang specified but has w:rStyle “DefaultParagraphFont” which is most likely English. So I don’t think Aspose.Words’ model is at fault here. MS Word also uses red wavy underline for the paragraph to indicate that spell check failed.
Following code allows to make Aspose.Words to use German dictionary for 4th paragraph.
Document doc = new Document(MyDir + @“hyphenation.docx”);
// It seems, that the problem only occurs, if the german and english dictionaries are set together.
Hyphenation.RegisterDictionary(“de-DE”, MyDir + “hyph_de_DE.dic”);
Hyphenation.RegisterDictionary(“en-US”, MyDir + “hyph_de_DE.dic”);
doc.Save(MyDir + @“15.7.0.pdf”);
4th paragraph looks OK now, but the word “Altersrente” still hyphenated wrong in the last paragraph. It is quality problem of German hyphenation dictionary. We can resolve this problem by adding follow pattern into German dictionary
So, it might be that Open Office still recognizes this sentence as German and applies correct dictionary, or it might use different dictionary for English. The workaround is to apply German language to the paragraph in Word. It might also help to add patters presented above into the German dictionary.