Commit aac2217c authored by Goutte's avatar Goutte

Clean up.

parent e80edc8c
...@@ -157,23 +157,21 @@ class M3P2Plugin extends Plugin ...@@ -157,23 +157,21 @@ class M3P2Plugin extends Plugin
// $route = '/' . $language . $route_suffix; // $route = '/' . $language . $route_suffix;
// $route = $route_suffix; // $route = $route_suffix;
// FIXME: nope. language-selector does this the hard way, by instantiating Page objects // Nope. language-selector does this the hard way, by instantiating Page objects
//$translation = $page->find($route); //$translation = $page->find($route);
// … so we're falling back on the old school too // … so we're falling back on the old school too
$translation_path = $page->path() . DS . $page_name_without_ext . '.' . $language . '.md'; $translation_path = $page->path() . DS . $page_name_without_ext . '.' . $language . '.md';
if (file_exists($translation_path)) { if ( ! file_exists($translation_path)) {
$translation = new Page();
$translation->init(new \SplFileInfo($translation_path), $language . '.md');
// $translated_pages[$language] = $translation;
} else {
continue; continue;
} }
$translation = new Page();
$translation->init(new \SplFileInfo($translation_path), $language . '.md');
// var_dump($route); // var_dump($route);
// die(var_dump($route)); // die(var_dump($route));
// die(var_dump($translation)); // die(var_dump($translation));
if ($language == $current_language) { if ($language == $current_language) {
array_unshift($translations, $translation); array_unshift($translations, $translation);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment