]> Kevux Git Server - koopa/commitdiff
Update: implement custom language support in regular paths in the same way internal...
authorKevin Day <thekevinday@gmail.com>
Wed, 26 Apr 2017 15:09:57 +0000 (10:09 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 26 Apr 2017 15:09:57 +0000 (10:09 -0500)
12 files changed:
common/base/classes/base_path.php
program/reservation/internal/ja/access_denied.php
program/reservation/internal/ja/bad_method.php
program/reservation/internal/ja/not_found.php
program/reservation/internal/ja/server_error.php
program/reservation/paths/u/dashboard.php
program/reservation/paths/u/ja/dashboard.php [new file with mode: 0644]
program/reservation/paths/u/ja/login.php [new file with mode: 0644]
program/reservation/paths/u/ja/logout.php [new file with mode: 0644]
program/reservation/paths/u/login.php
program/reservation/paths/u/logout.php
program/reservation/reservation_paths.php

index c3cde253dc558e297dd37de0e4d2cfe368de47ef..87380ecaea393adab4b14f3d186b88705f5f278e 100644 (file)
@@ -84,7 +84,8 @@ class c_base_path extends c_base_rfc_string {
   protected $date_changed = NULL;
   protected $date_locked  = NULL;
 
-  protected $include = NULL;
+  protected $include_directory = NULL;
+  protected $include_name      = NULL;
 
   /**
    * Class constructor.
@@ -109,7 +110,8 @@ class c_base_path extends c_base_rfc_string {
     $this->date_changed = NULL;
     $this->date_locked  = NULL;
 
-    $this->include = NULL;
+    $this->include_directory = NULL;
+    $this->include_name      = NULL;
   }
 
   /**
@@ -132,7 +134,8 @@ class c_base_path extends c_base_rfc_string {
     unset($this->date_changed);
     unset($this->date_locked);
 
-    unset($this->include);
+    unset($this->include_directory);
+    unset($this->include_name);
 
     parent::__destruct();
   }
@@ -682,21 +685,44 @@ class c_base_path extends c_base_rfc_string {
   }
 
   /**
-   * Assign an include file needed to process this path.
+   * Assign an include path directory needed to process this path.
    *
-   * @param string $path
+   * This is the prefix part of the path.
+   *
+   * @param string|null $directory
    *   A path to a file that may be found via the PHP search path.
    *
    * @return c_base_return_status
    *   TRUE on success, FALSE otherwise.
    */
-  public function set_include($path) {
-    if (!is_string($path)) {
-      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+  public function set_include_directory($directory) {
+    if (!is_string($directory) && !is_null($directory)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_directory' => 'directory', ':function_directory' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+      return c_base_return_error::s_false($error);
+    }
+
+    $this->include_directory = $directory;
+    return new c_base_return_true();
+  }
+
+  /**
+   * Assign an include path name needed to process this path.
+   *
+   * This is the suffix part of the path.
+   *
+   * @param string|null $path
+   *   A path to a file that may be found via the PHP search path.
+   *
+   * @return c_base_return_status
+   *   TRUE on success, FALSE otherwise.
+   */
+  public function set_include_name($name) {
+    if (!is_string($name) && !is_null($name)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
       return c_base_return_error::s_false($error);
     }
 
-    $this->include = $path;
+    $this->include_name = $name;
     return new c_base_return_true();
   }
 
@@ -892,19 +918,39 @@ class c_base_path extends c_base_rfc_string {
   }
 
   /**
-   * Get the assigned include path.
+   * Get the assigned include path directory.
+   *
+   * This is the prefix part of the path.
    *
    * @return c_base_return_string|c_base_return_null
    *   Include path string on success.
    *   NULL is returned if the include path is not assigned.
    *   Error bit is set on error.
    */
-  public function get_include() {
-    if (!is_string($this->include)) {
+  public function get_include_directory() {
+    if (!is_string($this->include_directory)) {
       return new c_base_return_null();
     }
 
-    return c_base_return_string::s_new($this->include);
+    return c_base_return_string::s_new($this->include_directory);
+  }
+
+  /**
+   * Get the assigned include path name.
+   *
+   * This is the suffix part of the path.
+   *
+   * @return c_base_return_string|c_base_return_null
+   *   Include path string on success.
+   *   NULL is returned if the include path is not assigned.
+   *   Error bit is set on error.
+   */
+  public function get_include_name() {
+    if (!is_string($this->include_name)) {
+      return new c_base_return_null();
+    }
+
+    return c_base_return_string::s_new($this->include_name);
   }
 
   /**
@@ -924,13 +970,13 @@ class c_base_path extends c_base_rfc_string {
    *   An executed array object with error bit set is returned on error.
    */
   public function do_execute(&$http, &$database, &$session, $settings = array()) {
-    if (!($database instanceof c_base_database)) {
-      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+    if (!($http instanceof c_base_http)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'http', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
       return c_base_return_error::s_value(array(), 'c_base_path_executed', $error);
     }
 
-    if (!($http instanceof c_base_http)) {
-      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'http', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+    if (!($database instanceof c_base_database)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'database', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
       return c_base_return_error::s_value(array(), 'c_base_path_executed', $error);
     }
 
@@ -1210,18 +1256,24 @@ class c_base_paths extends c_base_return {
    *
    * @todo: should redirect and alias booleans be added as parameters?
    *
+   * @pram string $directory
+   *   The first part of the file path
    * @pram string $path
    *   The url path in which the handler applies to.
    * @param string $handler
    *   The name of an implementation of c_base_path.
-   * @param string|null $include
-   *   (optional) The file path (relative to the PHP includes) to include that contains the requested path.
+   * @param string|null $directory
+   *   (optional) The prefix path (relative to the PHP includes) to include that contains the requested path.
+   *   When not NULL, both $directory and $name must not be NULL.
+   * @param string|null $name
+   *   (optional) The suffix path (relative to the PHP includes) to include that contains the requested path.
+   *   When not NULL, both $directory and $name must not be NULL.
    *
    * @return c_base_return_status
    *   TRUE is returned on success.
    *   FALSE with error bit set is returned on error.
    */
-  public function set_path($path, $handler, $include = NULL) {
+  public function set_path($path, $handler, $include_directory = NULL, $include_name = NULL) {
     if (!is_string($path)) {
       $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'path', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
       return c_base_return_error::s_false($error);
@@ -1232,13 +1284,18 @@ class c_base_paths extends c_base_return {
       return c_base_return_error::s_false($error);
     }
 
-    if (!is_null($include) && !is_string($include)) {
-      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'include', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+    if ((!is_null($include_directory) || (is_null($include_directory) && !is_null($include_name))) && !is_string($include_directory)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'include_directory', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
+      return c_base_return_error::s_false($error);
+    }
+
+    if ((!is_null($include_name) || (is_null($include_name) && !is_null($include_directory))) && !is_string($include_name)) {
+      $error = c_base_error::s_log(NULL, array('arguments' => array(':argument_name' => 'include_name', ':function_name' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
       return c_base_return_error::s_false($error);
     }
 
     if (mb_strlen($path) == 0) {
-      $this->root = array('handler' => $handler, 'include' => $include, 'is_root' => TRUE);
+      $this->root = array('handler' => $handler, 'include_directory' => $include_directory, 'include_name' => $include_name, 'is_root' => TRUE);
       return new c_base_return_true();
     }
 
@@ -1288,7 +1345,8 @@ class c_base_paths extends c_base_return {
     $depth_total = count($path_parts);
     foreach ($path_parts as $path_part) {
       if ($depth_current == $depth_total) {
-        $path_tree['include'] = $include;
+        $path_tree['include_directory'] = $include_directory;
+        $path_tree['include_name'] = $include_name;
         $path_tree['handler'] = $handler;
         break;
       }
@@ -1296,7 +1354,8 @@ class c_base_paths extends c_base_return {
       if (!isset($path_tree['paths'][$path_part])) {
         $path_tree['paths'][$path_part] = array(
           'paths' => array(),
-          'include' => NULL,
+          'include_directory' => NULL,
+          'include_name' => NULL,
           'handler' => NULL,
         );
       }
@@ -1322,7 +1381,8 @@ class c_base_paths extends c_base_return {
    *
    * @return c_base_return_array|c_base_return_int|c_base_return_null
    *   An array containing:
-   *   - 'include': the file to include that contains the handler class implementation.
+   *   - 'include_directory': the prefix path of the file to include that contains the handler class implementation.
+   *   - 'include_name': the suffix path of the file to include that contains the handler class implementation.
    *   - 'handler': the name of the handler class.
    *   - 'redirect': if specified, then a redirect path (instead of include/handler).
    *   - 'code': if redirect is specified, then the http response code associated with the redirect.
@@ -1388,7 +1448,7 @@ class c_base_paths extends c_base_return {
     foreach ($path_parts as $path_part) {
       if ($depth_current == $depth_total) {
         if (isset($path_tree['handler'])) {
-          $found = array('include' => $path_tree['include'], 'handler' => $path_tree['handler']);
+          $found = array('include_directory' => $path_tree['include_directory'], 'include_name' => $path_tree['include_name'], 'handler' => $path_tree['handler']);
           break;
         }
       }
@@ -1396,7 +1456,7 @@ class c_base_paths extends c_base_return {
       if (!isset($path_tree['paths'][$path_part])) {
         if ($depth_current == $depth_total) {
           if (isset($path_tree['handler'])) {
-            $found = array('include' => $path_tree['include'], 'handler' => $path_tree['handler']);
+            $found = array('include_directory' => $path_tree['include_directory'], 'include_name' => $path_tree['include_name'], 'handler' => $path_tree['handler']);
             break;
           }
         }
index b197b8c765054fe77c2635df188e6fe918aa7b0f..f7914d0845cabc1dadac955fb966ed5c6d745a44 100644 (file)
@@ -4,7 +4,11 @@
  * Provides path handler for the access denied pages.
  */
 
+/**
+ * Implements c_reservation_path_access_denied().
+ */
 final class c_reservation_path_access_denied_ja extends c_reservation_path_access_denied {
+
   /**
    * Implements pr_get_title().
    */
index 07dad1c4995b0f8d9445b245deba7ed90341a554..1850130ebc0e9e7613a3d5b52d885f18c5a7a250 100644 (file)
@@ -4,7 +4,11 @@
  * Provides path handler for the not found pages.
  */
 
+/**
+ * Implements c_reservation_path_bad_method().
+ */
 final class c_reservation_path_bad_method_ja extends c_reservation_path_bad_method {
+
   /**
    * Implements pr_get_title().
    */
index f3a24cb4f913f447e1ef4d126cb99bd7b26ccc86..51865ffe0c874256804a3524aab7908c05cfd08b 100644 (file)
@@ -4,7 +4,11 @@
  * Provides path handler for the not found pages.
  */
 
+/**
+ * Implements c_reservation_path_not_found().
+ */
 final class c_reservation_path_not_found_ja extends c_reservation_path_not_found {
+
   /**
    * Implements pr_get_title().
    */
index a2271b2b09be66147a49c4537862239fcd0435be..13e778ab77e9b24da196644e1a5e301eb4f0357a 100644 (file)
@@ -4,7 +4,11 @@
  * Provides path handler for the server error pages.
  */
 
+/**
+ * Implements c_reservation_path_server_error().
+ */
 final class c_reservation_path_server_error_ja extends c_reservation_path_server_error {
+
   /**
    * Implements pr_get_title().
    */
index 1e481876dcec8be2e19ebb453ee376373b2430e4..e3811d9502b166d4be68e24ca4d925d132de044b 100644 (file)
@@ -7,13 +7,11 @@
 require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_path.php');
-require_once('common/base/classes/base_html.php');
-require_once('common/base/classes/base_cookie.php');
-require_once('common/base/classes/base_session.php');
 
 require_once('common/theme/classes/theme_html.php');
 
 class c_reservation_path_user_dashboard extends c_base_path {
+
   /**
    * Implements do_execute().
    */
@@ -48,7 +46,7 @@ class c_reservation_path_user_dashboard extends c_base_path {
     unset($roles_object);
 
     $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER);
-    $tag->set_text($this->pr_get_text(2) . $settings['database_user']);
+    $tag->set_text($this->pr_get_text(2) . ' ' . $settings['database_user']);
     $wrapper->set_tag($tag);
     unset($tag);
 
@@ -132,7 +130,7 @@ class c_reservation_path_user_dashboard extends c_base_path {
       case 1:
         return 'All links will go here.';
       case 2:
-        return 'You are currently logged in as: ';
+        return 'You are currently logged in as:';
       case 3:
         return 'You are currently assigned the following roles:';
       case 4:
diff --git a/program/reservation/paths/u/ja/dashboard.php b/program/reservation/paths/u/ja/dashboard.php
new file mode 100644 (file)
index 0000000..8af1d4a
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/**
+ * @file
+ * Provides path handler for the user dashboard.
+ */
+
+/**
+ * Implements c_reservation_path_user_dashboard().
+ */
+class c_reservation_path_user_dashboard_ja extends c_reservation_path_user_dashboard {
+
+  /**
+   * Implements pr_get_text().
+   */
+  protected function pr_get_text($code) {
+    switch ($code) {
+      case 0:
+        return 'ダッシュボード';
+      case 1:
+        // note: currently not converting this because all text in this area will undergo major changes.
+        return parent::pr_get_text($code);
+      case 2:
+        return 'あなたは現在次のようにログインしています:';
+      case 3:
+        return '現在、次の役割が割り当てられています。';
+      case 4:
+        return 'パブリック';
+      case 5:
+        return 'ユーザー';
+      case 6:
+        return 'リクエスタ';
+      case 7:
+        return 'ドレイター';
+      case 8:
+        return '編集者';
+      case 9:
+        return 'レビューア';
+      case 10:
+        return 'ファイナンサー';
+      case 11:
+        return '保険会社';
+      case 12:
+        return '出版社';
+      case 13:
+        return '審査員';
+      case 14:
+        return 'マネージャー';
+      case 15:
+        return '管理者';
+    }
+
+    return '';
+  }
+}
diff --git a/program/reservation/paths/u/ja/login.php b/program/reservation/paths/u/ja/login.php
new file mode 100644 (file)
index 0000000..45759c4
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file
+ * Provides path handler for the login process.
+ */
+
+
+/**
+ * Implements c_reservation_path_user_login().
+ */
+class c_reservation_path_user_login_ja extends c_reservation_path_user_login {
+
+  /**
+   * Implements pr_get_text().
+   */
+  protected function pr_get_text($code) {
+    switch ($code) {
+      case 0:
+        return 'システムへのログイン';
+      case 1:
+        return 'ユーザー名';
+      case 2:
+        return 'パスワード';
+    }
+
+    return '';
+  }
+}
diff --git a/program/reservation/paths/u/ja/logout.php b/program/reservation/paths/u/ja/logout.php
new file mode 100644 (file)
index 0000000..1e83fbe
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @file
+ * Provides path handler for the logout process.
+ */
+
+
+/**
+ * Implements c_reservation_path_user_logout().
+ */
+class c_reservation_path_user_logout_ja extends c_reservation_path_user_logout {
+
+  /**
+   * Implements pr_get_text().
+   */
+  protected function pr_get_text($code) {
+    switch ($code) {
+      case 0:
+        return 'あなたはログアウトしました';
+      case 1:
+        return 'あなたはシステムからログアウトされています。';
+    }
+
+    return '';
+  }
+}
index dcbd7eb39cc95588ddf1da36a91b45725c733b2a..60af3450768bacde556f4be17daee561b3117d1b 100644 (file)
@@ -8,6 +8,7 @@ require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_path.php');
 require_once('common/base/classes/base_http_status.php');
+require_once('common/base/classes/base_cookie.php');
 
 require_once('common/theme/classes/theme_html.php');
 
index 4e165ad45213750e84e3363ae8c77e997349b946..067146549bb344336645b0acdfe8ce8a09dccfd6 100644 (file)
@@ -8,6 +8,7 @@ require_once('common/base/classes/base_error.php');
 require_once('common/base/classes/base_return.php');
 require_once('common/base/classes/base_path.php');
 require_once('common/base/classes/base_http_status.php');
+require_once('common/base/classes/base_cookie.php');
 
 require_once('common/theme/classes/theme_html.php');
 
index e6ee1babfc1ce9b32ce8bda44ded3e2df9948434..4ea62b46b012b40d00204dbb5935b44e30a31e4e 100644 (file)
@@ -39,7 +39,11 @@ class c_reservation_paths {
   private $session   = NULL;
   private $output    = NULL;
   private $logged_in = NULL;
-  private $paths     = NULL;
+
+  private $paths = NULL;
+  private $path  = NULL;
+
+  private $alias = NULL;
 
   /**
    * Class constructor.
@@ -51,8 +55,11 @@ class c_reservation_paths {
     $this->session   = NULL;
     $this->output    = NULL;
     $this->logged_in = NULL;
-    $this->paths     = NULL;
-    $this->path      = NULL;
+
+    $this->paths = NULL;
+    $this->path  = NULL;
+
+    $this->alias = NULL;
   }
 
   /**
@@ -64,8 +71,11 @@ class c_reservation_paths {
     unset($this->session);
     unset($this->output);
     unset($this->logged_in);
+
     unset($this->paths);
     unset($this->path);
+
+    unset($this->alias);
   }
 
   /**
@@ -122,6 +132,7 @@ class c_reservation_paths {
     $this->output = NULL;
     $this->logged_in = $logged_in;
 
+    $this->p_get_language_alias();
 
     // require HTTPS for access to any part of this website.
     if (!isset($_SERVER["HTTPS"])) {
@@ -183,20 +194,50 @@ class c_reservation_paths {
       return $redirect->do_execute($this->http, $this->database, $this->session, $this->settings);
     }
     else {
-      if (!empty($handler_settings['include']) && is_string($handler_settings['include'])) {
-        require_once($handler_settings['include']);
+      if (!empty($handler_settings['include_name']) && is_string($handler_settings['include_name'])) {
+        require_once($handler_settings['include_directory'] . $handler_settings['include_name']);
+      }
+
+      // execute path handler, using custom-language if defined.
+      if (empty($handler_settings['handler'])) {
+        $server_error = $this->p_get_path_server_error();
+        return $server_error->do_execute($this->http, $this->database, $this->session, $this->settings);
       }
+      elseif (is_string($this->alias)) {
+        @include_once($handler_settings['include_directory'] . $this->alias . '/' . $handler_settings['include_name']);
 
-      if (empty($handler_settings['handler']) || !class_exists($handler_settings['handler'])) {
-        $not_found = $this->p_get_path_server_error();
-        return $not_found->do_execute($this->http, $this->database, $this->session, $this->settings);
+        $handler_class = $handler_settings['handler'] . '_' . $this->alias;
+        if (class_exists($handler_class)) {
+          $this->path = new $handler_class();
+
+          unset($handler_class);
+        }
+        else {
+          unset($handler_class);
+
+          // attempt to fallback to default handler if the language-specific handler class is not found.
+          if (!class_exists($handler_settings['handler'])) {
+            $server_error = $this->p_get_path_server_error();
+            return $server_error->do_execute($this->http, $this->database, $this->session, $this->settings);
+          }
+          else {
+            $this->path = new $handler_settings['handler']();
+          }
+        }
       }
       else {
-        $this->path = new $handler_settings['handler']();
-        if (isset($handler_settings['is_root']) && $handler_settings['is_root']) {
-          $this->path->set_is_root(TRUE);
+        if (class_exists($handler_settings['handler'])) {
+          $this->path = new $handler_settings['handler']();
+        }
+        else {
+          $server_error = $this->p_get_path_server_error();
+          return $server_error->do_execute($this->http, $this->database, $this->session, $this->settings);
         }
       }
+
+      if (isset($handler_settings['is_root']) && $handler_settings['is_root']) {
+        $this->path->set_is_root(TRUE);
+      }
     }
     unset($handler_settings);
 
@@ -236,14 +277,14 @@ class c_reservation_paths {
     $this->paths = new c_base_paths();
 
     // set root path to be the user dashboard.
-    $this->paths->set_path('', 'c_reservation_path_user_dashboard', 'program/reservation/paths/u/dashboard.php');
+    $this->paths->set_path('', 'c_reservation_path_user_dashboard', 'program/reservation/paths/u/', 'dashboard.php');
 
     // create login/logout paths
-    $this->paths->set_path('/u/login', 'c_reservation_path_user_login', 'program/reservation/login.php');
-    $this->paths->set_path('/u/logout', 'c_reservation_path_user_logout', 'program/reservation/logout.php');
+    $this->paths->set_path('/u/login', 'c_reservation_path_user_login', 'program/reservation/', 'login.php');
+    $this->paths->set_path('/u/logout', 'c_reservation_path_user_logout', 'program/reservation/', 'logout.php');
 
     // user dashboard
-    $this->paths->set_path('/u/dashboard', 'c_reservation_path_user_dashboard', 'program/reservation/paths/u/dashboard.php');
+    $this->paths->set_path('/u/dashboard', 'c_reservation_path_user_dashboard', 'program/reservation/paths/u/', 'dashboard.php');
   }
 
   /**
@@ -391,6 +432,43 @@ class c_reservation_paths {
   }
 
   /**
+   * Load and save the current preferred language alias.
+   *
+   * This will be stored in $this->alias.
+   */
+  private function p_get_language_alias() {
+    $aliases = array();
+    $languages = $this->http->get_response_content_language()->get_value_exact();
+    if (is_array($languages) && !empty($languages)) {
+      $language = reset($languages);
+
+      // us-english is the default, so do not attempt to include any external files.
+      if ($language == i_base_language::ENGLISH_US || $language == i_base_language::ENGLISH) {
+        unset($language);
+        unset($aliases);
+        unset($languages);
+
+        $this->alias = NULL;
+        return;
+      }
+
+      $aliases = c_base_defaults_global::s_get_languages()::s_get_aliases_by_id($language)->get_value_exact();
+    }
+    unset($language);
+
+    // use default if no aliases are found.
+    if (empty($aliases)) {
+      unset($aliases);
+      unset($languages);
+
+      $this->alias = NULL;
+      return;
+    }
+
+    $this->alias = end($aliases);
+  }
+
+  /**
    * Will include a custom language path if one exists.
    *
    * The default language files ends in "${path}${name}.php".
@@ -415,43 +493,18 @@ class c_reservation_paths {
   private function p_include_path($path, $name, $class) {
     require_once($path . $name . '.php');
 
-    $aliases = array();
-    $languages = $this->http->get_response_content_language()->get_value_exact();
-    if (is_array($languages) && !empty($languages)) {
-      $language = reset($languages);
-
-      // us-english is the default, so do not attempt to include any external files.
-      if ($language == i_base_language::ENGLISH_US || $language == i_base_language::ENGLISH) {
-        unset($language);
-        unset($aliases);
-        unset($languages);
-        return new $class();
-      }
-
-      $aliases = c_base_defaults_global::s_get_languages()::s_get_aliases_by_id($language)->get_value_exact();
-    }
-    unset($language);
-
     // use default if no aliases are found.
-    if (empty($aliases)) {
-      unset($aliases);
-      unset($languages);
+    if (is_null($this->alias)) {
       return new $class();
     }
 
-    $alias = end($aliases);
-    unset($aliases);
-
     // use include_once instead of require_require to allow for failsafe behavior.
-    @include_once($path . $alias . '/' . $name . '.php');
+    @include_once($path . $this->alias . '/' . $name . '.php');
 
-    $language_class = $class . '_' . $alias;
+    $language_class = $class . '_' . $this->alias;
     if (class_exists($language_class)) {
-      unset($alias);
-
       return new $language_class();
     }
-    unset($alias);
     unset($language_class);
 
     // if unable to find, fallback to original class