# How to define hyphenation for different languages in LuaLaTeX?

I want to define additional hyphenation rules for different languages in LuaLaTeX.

How should the hyphenation for English and German be defined in myhyphenations.tex in the following minimal working example?

\documentclass{minimal}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{german}
\usepackage{showhyphens}

\input{myhyphenations}

\begin{document}
\begin{german}[]
In \languagename~ schreiben wir: Hexakisoktaeder.
\end{german}

\begin{english}[]
In \languagename~ we write: hexoctahedron.
\end{english}

\end{document}


Idea of the myhyphenations.tex example file:

%German definitions
Hexa-kis-okta-eder

%English definitions
hex-octa-hedron


• Hyphenation rules are changed when you switch the language with sth like \begin{english}. What exactly are you interested in? A description of an intented output would be helpful. – Michael Fraiman Jan 23 '18 at 9:27
• it's not really any different to pdftex, but it is not clear what you are asking, do you want to know how to specify a language within latex (usually done via babel or polyglossia packages) or are you asking how to write the \patterns required to set up a completely new language (which is a completely different thing, and for some less regular languages like english requires access to published hyphenation dictionaries) – David Carlisle Jan 23 '18 at 9:33
• Maybe you want to know how to load at runtime patterns for a new language. Please, make your question more precise. – egreg Jan 23 '18 at 11:09
• Thank you for your comments, egreg, David and Michael. It helped me to rewrite my question. – Jonas Stein Jan 23 '18 at 15:00