diff options
author | momo-i <webmaster@momo-i.org> | 2011-12-27 15:30:25 +0900 |
---|---|---|
committer | momo-i <webmaster@momo-i.org> | 2011-12-27 15:30:25 +0900 |
commit | 95620b40a19cf180babcbf1798ff5fdae36ecb75 (patch) | |
tree | 10141d5e4d7d5bb1f87ca8698847e3dafce90fcf /lib/class | |
parent | 9f491c064ab3f593f887b9da427529397b3fc53c (diff) | |
download | ampache-95620b40a19cf180babcbf1798ff5fdae36ecb75.tar.gz ampache-95620b40a19cf180babcbf1798ff5fdae36ecb75.tar.bz2 ampache-95620b40a19cf180babcbf1798ff5fdae36ecb75.zip |
Fixed messages translatable.
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/api.class.php | 6 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 24 | ||||
-rw-r--r-- | lib/class/config.class.php | 2 | ||||
-rw-r--r-- | lib/class/radio.class.php | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php index 2c0fd01c..61b071f6 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -132,7 +132,7 @@ class Api { if (intval($version) < self::$version) { debug_event('API', 'Login Failed: version too old', 1); - Error::add('api', 'Login Failed: version too old'); + Error::add('api', _('Login Failed: version too old')); return false; } @@ -140,7 +140,7 @@ class Api { if (($timestamp < (time() - 1800)) || ($timestamp > (time() + 1800))) { debug_event('API', 'Login Failed: timestamp out of range', 1); - Error::add('api', 'Login Failed: timestamp out of range'); + Error::add('api', _('Login Failed: timestamp out of range')); return false; } @@ -169,7 +169,7 @@ class Api { if (!$row['password']) { debug_event('API', 'Unable to find user with userid of ' . $user_id, 1); - Error::add('api','Invalid Username/Password'); + Error::add('api', _('Invalid Username/Password')); return false; } diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index f7783454..f4ff7be7 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -276,7 +276,7 @@ class Catalog extends database_object { // Make sure the path is readable/exists if (!is_readable($data['path']) AND $data['type'] == 'local') { - Error::add('general','Error: ' . scrub_out($data['path']) . ' is not readable or does not exist'); + Error::add('general', sprintf(_('Error: %s is not readable or does not exist'), scrub_out($data['path']))); return false; } @@ -285,7 +285,7 @@ class Catalog extends database_object { $db_results = Dba::read($sql); if (Dba::num_rows($db_results)) { - Error::add('general','Error: Catalog with ' . $path . ' already exists'); + Error::add('general', sprintf(_('Error: Catalog with %s already exists'), $path)); return false; } @@ -312,7 +312,7 @@ class Catalog extends database_object { $insert_id = Dba::insert_id(); if (!$insert_id) { - Error::add('general','Catalog Insert Failed check debug logs'); + Error::add('general', _('Catalog Insert Failed check debug logs')); debug_event('catalog','SQL Failed:' . $sql,'3'); return false; } @@ -496,14 +496,14 @@ class Catalog extends database_object { if (!is_resource($handle)) { debug_event('read', "Unable to open $path", 5,'ampache-catalog'); - Error::add('catalog_add',_('Error: Unable to open') . ' ' . $path); + Error::add('catalog_add', sprintf(_('Error: Unable to open %s'), $path)); return false; } /* Change the dir so is_dir works correctly */ if (!chdir($path)) { debug_event('read', "Unable to chdir $path", 2,'ampache-catalog'); - Error::add('catalog_add',_('Error: Unable to change to directory') . ' ' . $path); + Error::add('catalog_add', sprintf(_('Error: Unable to change to directory %s'), $path)); return false; } @@ -549,7 +549,7 @@ class Catalog extends database_object { /* Change the dir so is_dir works correctly */ if (!chdir($path)) { debug_event('read',"Unable to chdir $path",'2','ampache-catalog'); - Error::add('catalog_add',_('Error: Unable to change to directory') . ' ' . $path); + Error::add('catalog_add', sprintf(_('Error: Unable to change to directory %s'), $path)); } /* Skip to the next file */ @@ -586,7 +586,7 @@ class Catalog extends database_object { if (!$file_size) { debug_event('read',"Unable to get filesize for $full_file",'2','ampache-catalog'); /* HINT: FullFile */ - Error::add('catalog_add',sprintf(_('Error: Unable to get filesize for %s'), $full_file)); + Error::add('catalog_add', sprintf(_('Error: Unable to get filesize for %s'), $full_file)); } // file_size check if (!is_readable($full_file)) { @@ -1462,7 +1462,7 @@ class Catalog extends database_object { $file_info = filesize($results['file']); if (!file_exists($results['file']) || $file_info < 1) { debug_event('clean', 'File not found or empty: ' . $results['file'], 5, 'ampache-catalog'); - Error::add('general',_('Error File Not Found or 0 Bytes:') . $results['file']); + Error::add('general', sprintf(_('Error File Not Found or 0 Bytes: %s'), $results['file'])); // Store it in an array we'll delete it later... @@ -1479,7 +1479,7 @@ class Catalog extends database_object { if ($file_info == false) { /* Add Error */ - Error::add('general',_('Error Remote File Not Found or 0 Bytes:') . $results['file']); + Error::add('general', sprintf(_('Error Remote File Not Found or 0 Bytes: %s'), $results['file'])); // Store it in an array we'll delete it later... @@ -1895,7 +1895,7 @@ class Catalog extends database_object { $sql = "UPDATE `artist` SET `mbid`='$mbid' WHERE `id`='$artist_id'"; $db_results = Dba::write($sql); if (!$db_results) { - Error::add('general',"Updating Artist: $artist"); + Error::add('general', sprintf(_('Updating Artist: %s'), $artist)); } } } @@ -1916,7 +1916,7 @@ class Catalog extends database_object { $artist_id = Dba::insert_id(); if (!$db_results) { - Error::add('general',"Inserting Artist:$artist"); + Error::add('general', sprintf(_('Inserting Artist: %s'), $artist)); } } // not found @@ -2096,7 +2096,7 @@ class Catalog extends database_object { if (!$db_results) { debug_event('insert',"Unable to insert $file -- $sql" . Dba::error(),'5','ampache-catalog'); - Error::add('catalog_add','SQL Error Adding ' . $file); + Error::add('catalog_add', sprintf(_('SQL Error Adding %s'), $file)); } $song_id = Dba::insert_id(); diff --git a/lib/class/config.class.php b/lib/class/config.class.php index 4ac45469..e12fdedc 100644 --- a/lib/class/config.class.php +++ b/lib/class/config.class.php @@ -109,7 +109,7 @@ class Config { public static function set($name, $value, $clobber = 0) { if (isset(self::$_global[$name]) && !$clobber) { - Error::add('Config Global',"Trying to clobber'$name' without setting clobber"); + Error::add('Config Global', sprintf(_('Trying to clobber \'%s\' without setting clobber'), $name)); return; } else { diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php index b69f8a6e..46743614 100644 --- a/lib/class/radio.class.php +++ b/lib/class/radio.class.php @@ -144,7 +144,7 @@ class Radio extends database_object implements media { $elements = explode(":",$data['url']); if (!in_array($elements['0'],$allowed_array)) { - Error::add('url','Invalid URL must be http:// or https://'); + Error::add('url', _('Invalid URL must be http:// or https://')); } // Make sure it's a real catalog |