Skip to content
Browse files

Adjust translation file search logic to account for running from svn …

…checkout.

git-svn-id: http://svn.php.net/repository/pear/packages/Date_Holidays/trunk@321620 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 2500f08 commit 901e7b6c8c6663959135b5acfeee793d66cff027 Daniel Convissor committed
Showing with 16 additions and 9 deletions.
  1. +16 −9 Date/Holidays/Driver.php
View
25 Date/Holidays/Driver.php
@@ -306,18 +306,25 @@ function addTranslation($locale)
$matches = array();
$loaded = false;
- //Christian driver is exceptional...
- if ($this->_driverName == 'Christian') {
- $stubdir = "$data_dir/Date_Holidays/lang/Christian/";
+ if ($data_dir == '@'.'DATA-DIR'.'@') {
+ $data_dir = dirname(dirname(dirname(__FILE__)));
+ $stubdirs = array(
+ "$data_dir/lang/{$this->_driverName}/",
+ "$data_dir/lang/Christian/");
} else {
- $stubdir = "$data_dir/Date_Holidays_{$this->_driverName}/lang/{$this->_driverName}/";
- if (! is_dir($stubdir)) {
- $stubdir = $data_dir . "/Date_Holidays/lang/";
+ //Christian driver is exceptional...
+ if ($this->_driverName == 'Christian') {
+ $stubdir = "$data_dir/Date_Holidays/lang/Christian/";
+ } else {
+ $stubdir = "$data_dir/Date_Holidays_{$this->_driverName}/lang/{$this->_driverName}/";
+ if (! is_dir($stubdir)) {
+ $stubdir = $data_dir . "/Date_Holidays/lang/";
+ }
}
+ $stubdirs = array(
+ $stubdir,
+ "$data_dir/Date_Holidays_{$this->_driverName}/lang/Christian/");
}
- $stubdirs = array(
- $stubdir,
- "$data_dir/Date_Holidays_{$this->_driverName}/lang/Christian/");
foreach ($stubdirs as $stubdir) {
if (is_dir($stubdir)) {

0 comments on commit 901e7b6

Please sign in to comment.
Something went wrong with that request. Please try again.