Hello mcmorry, are you still working on this?
Mind creating a repo on github for this module, so we can collaborate more easily on this? (If you want, I could create one on my account.
However...
While playing around with multilang and this module I found a simple way to use sanitizer (which Ryan already modified to allow replacements).
The slug method can be changed to:
public function toSlug($str) {
$str = mb_strtolower($str); // needed for uppercase cyrillic chars
$str = $this->sanitizer->pageName($str, Sanitizer::translate);
return $str;
}Also has to change or add various code to support urlSegments and pageNum. So it doesn't throw an 404 but load the page before it reaches segments that aren't solved.
I also changed the hook to
$this->addHookAfter('Page::path', $this, 'mlUrl');So the system internally also works, and no change is required to use mlUrl. It works great so far.
I kinda collaborated with MadeMyDay over the weekend on this, as he's doing a website using this language urls together with the multisite module. So we made similar changes, altought he got more I think. He got it also working using both modules. So this could turn into an interesting alternative to multilanguage sites.
Edit::
I also tried to find easy solution for defining published languages. So I created a page field that returns the proxy language pages as checkboxes. So you can turn a language off. The module then looks for this and throws an 404. To get this to work, navigation code, language switch, and all list generation has to consider those, but it works ok.
A language switch would be a simple as:
$lang = $user->language;
$langname = $lang->name == 'default' ? 'en' : $lang->name;
$user->language = $languages->get("default");
$st = $langname == 'en' ? " class='on'" : '';
echo $page->language_published->has($pages->get("/en/")) ? "<li><a$st href='{$page->url}'>EN</a></li>" : '';
$user->language = $languages->get("de");
$st = $langname == 'de' ? " class='on'" : '';
echo $page->language_published->has($pages->get("/de/")) ? "<li><a$st href='{$page->url}'>DE</a></li>" : '';
$user->language = $lang;