summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/class/access.class.php36
-rw-r--r--lib/class/album.class.php6
-rw-r--r--lib/class/ampacherss.class.php12
-rw-r--r--lib/class/api.class.php16
-rw-r--r--lib/class/art.class.php2
-rw-r--r--lib/class/artist.class.php6
-rw-r--r--lib/class/browse.class.php30
-rw-r--r--lib/class/catalog.class.php70
-rw-r--r--lib/class/config.class.php2
-rw-r--r--lib/class/democratic.class.php14
-rw-r--r--lib/class/flag.class.php14
-rw-r--r--lib/class/localplay.class.php8
-rw-r--r--lib/class/playlist_object.abstract.php2
-rw-r--r--lib/class/query.class.php2
-rw-r--r--lib/class/radio.class.php12
-rw-r--r--lib/class/random.class.php8
-rw-r--r--lib/class/registration.class.php6
-rw-r--r--lib/class/search.class.php92
-rw-r--r--lib/class/update.class.php4
-rw-r--r--lib/class/user.class.php10
-rw-r--r--lib/class/video.class.php2
-rw-r--r--lib/general.lib.php2
-rw-r--r--lib/install.lib.php40
-rw-r--r--lib/javascript/search-data.php2
-rw-r--r--lib/preferences.php66
-rw-r--r--lib/rating.lib.php14
-rw-r--r--lib/ui.lib.php48
27 files changed, 263 insertions, 263 deletions
diff --git a/lib/class/access.class.php b/lib/class/access.class.php
index d2227701..578ba32b 100644
--- a/lib/class/access.class.php
+++ b/lib/class/access.class.php
@@ -160,17 +160,17 @@ class Access {
$end = @inet_pton($data['end']);
if (!$start AND $data['start'] != '0.0.0.0' AND $data['start'] != '::') {
- Error::add('start',_('Invalid IPv4 / IPv6 Address Entered'));
+ Error::add('start', T_('Invalid IPv4 / IPv6 Address Entered'));
return false;
}
if (!$end) {
- Error::add('end',_('Invalid IPv4 / IPv6 Address Entered'));
+ Error::add('end', T_('Invalid IPv4 / IPv6 Address Entered'));
return false;
}
if (strlen(bin2hex($start)) != strlen(bin2hex($end))) {
- Error::add('start',_('IP Address Version Mismatch'));
- Error::add('end',_('IP Address Version Mismatch'));
+ Error::add('start', T_('IP Address Version Mismatch'));
+ Error::add('end', T_('IP Address Version Mismatch'));
return false;
}
@@ -207,24 +207,24 @@ class Access {
$end = @inet_pton($data['end']);
if (!$start AND $data['start'] != '0.0.0.0' AND $data['start'] != '::') {
- Error::add('start',_('Invalid IPv4 / IPv6 Address Entered'));
+ Error::add('start', T_('Invalid IPv4 / IPv6 Address Entered'));
return false;
}
if (!$end) {
- Error::add('end',_('Invalid IPv4 / IPv6 Address Entered'));
+ Error::add('end', T_('Invalid IPv4 / IPv6 Address Entered'));
return false;
}
if (strlen(bin2hex($start)) != strlen(bin2hex($end))) {
- Error::add('start',_('IP Address Version Mismatch'));
- Error::add('end',_('IP Address Version Mismatch'));
+ Error::add('start', T_('IP Address Version Mismatch'));
+ Error::add('end', T_('IP Address Version Mismatch'));
return false;
}
// Check existing ACL's to make sure we're not duplicating values here
if (self::exists($data)) {
debug_event('ACL Create','Error: An ACL equal to the created one does already exist. Not adding another one: ' . $data['start'] . ' - ' . $data['end'],'1');
- Error::add('general',_('Duplicate ACL defined'));
+ Error::add('general', T_('Duplicate ACL defined'));
return false;
}
@@ -482,16 +482,16 @@ class Access {
public function get_level_name() {
if ($this->level >= '75') {
- return _('All');
+ return T_('All');
}
if ($this->level == '5') {
- return _('View');
+ return T_('View');
}
if ($this->level == '25') {
- return _('Read');
+ return T_('Read');
}
if ($this->level == '50') {
- return _('Read/Write');
+ return T_('Read/Write');
}
} // get_level_name
@@ -502,7 +502,7 @@ class Access {
*/
public function get_user_name() {
- if ($this->user == '-1') { return _('All'); }
+ if ($this->user == '-1') { return T_('All'); }
$user = new User($this->user);
return $user->fullname . " (" . $user->username . ")";
@@ -518,17 +518,17 @@ class Access {
switch ($this->type) {
case 'xml-rpc':
case 'rpc':
- return _('API/RPC');
+ return T_('API/RPC');
break;
case 'network':
- return _('Local Network Definition');
+ return T_('Local Network Definition');
break;
case 'interface':
- return _('Web Interface');
+ return T_('Web Interface');
break;
case 'stream':
default:
- return _('Stream Access');
+ return T_('Stream Access');
break;
} // end switch
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index dbf0b18e..1c4aa301 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -246,7 +246,7 @@ class Album extends database_object {
$this->f_name_link = "<a href=\"$web_path/albums.php?action=show&amp;album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->full_name) . "\">" . scrub_out($this->f_name);
// If we've got a disk append it
if ($this->disk) {
- $this->f_name_link .= " <span class=\"discnb disc" .$this->disk. "\">[" . _('Disk') . " " . $this->disk . "]</span>";
+ $this->f_name_link .= " <span class=\"discnb disc" .$this->disk. "\">[" . T_('Disk') . " " . $this->disk . "]</span>";
}
$this->f_name_link .="</a>";
@@ -260,8 +260,8 @@ class Album extends database_object {
$this->f_artist = $artist;
}
else {
- $this->f_artist_link = "<span title=\"$this->artist_count " . _('Artists') . "\">" . _('Various') . "</span>";
- $this->f_artist = _('Various');
+ $this->f_artist_link = "<span title=\"$this->artist_count " . T_('Artists') . "\">" . T_('Various') . "</span>";
+ $this->f_artist = T_('Various');
$this->f_artist_name = $this->f_artist;
}
diff --git a/lib/class/ampacherss.class.php b/lib/class/ampacherss.class.php
index 681ae98f..b971b1fb 100644
--- a/lib/class/ampacherss.class.php
+++ b/lib/class/ampacherss.class.php
@@ -80,10 +80,10 @@ class AmpacheRSS {
*/
public function get_title() {
- $titles = array('now_playing'=>_('Now Playing'),
- 'recently_played'=>_('Recently Played'),
- 'latest_album'=>_('Newest Albums'),
- 'latest_artist'=>_('Newest Artists'));
+ $titles = array('now_playing' => T_('Now Playing'),
+ 'recently_played' => T_('Recently Played'),
+ 'latest_album' => T_('Newest Albums'),
+ 'latest_artist' => T_('Newest Artists'));
return scrub_out(Config::get('site_title')) . ' - ' . $titles[$this->type];
@@ -126,7 +126,7 @@ class AmpacheRSS {
// Default to now playing
$type = self::validate_type($type);
- $string = '<a href="' . Config::get('web_path') . '/rss.php?type=' . $type . '">' . get_user_icon('feed',_('RSS Feed')) . '</a>';
+ $string = '<a href="' . Config::get('web_path') . '/rss.php?type=' . $type . '">' . get_user_icon('feed', T_('RSS Feed')) . '</a>';
return $string;
@@ -185,7 +185,7 @@ class AmpacheRSS {
//FIXME: The time stuff should be centralized, it's currently in two places, lame
- $time_unit = array('',_('seconds ago'),_('minutes ago'),_('hours ago'),_('days ago'),_('weeks ago'),_('months ago'),_('years ago'));
+ $time_unit = array('', T_('seconds ago'), T_('minutes ago'), T_('hours ago'), T_('days ago'), T_('weeks ago'), T_('months ago'), T_('years ago'));
$data = Song::get_recently_played();
$results = array();
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 61b071f6..ff7e2cb3 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', T_('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', T_('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', T_('Invalid Username/Password'));
return false;
}
@@ -232,7 +232,7 @@ class Api {
} // end while
debug_event('API','Login Failed, unable to match passphrase','1');
- xmlData::error('401',_('Error Invalid Handshake - ') . _('Invalid Username/Password'));
+ xmlData::error('401', T_('Error Invalid Handshake - ') . T_('Invalid Username/Password'));
} // handshake
@@ -659,7 +659,7 @@ class Api {
break;
default:
// They are doing it wrong
- echo xmlData::error('405',_('Invalid Request'));
+ echo xmlData::error('405', T_('Invalid Request'));
break;
} // end switch on command
@@ -680,7 +680,7 @@ class Api {
$type = 'song';
$media = new $type($input['oid']);
if (!$media->id) {
- echo xmlData::error('400',_('Media Object Invalid or Not Specified'));
+ echo xmlData::error('400', T_('Media Object Invalid or Not Specified'));
break;
}
$democratic->vote(array(array('song',$media->id)));
@@ -693,7 +693,7 @@ class Api {
$type = 'song';
$media = new $type($input['oid']);
if (!$media->id) {
- echo xmlData::error('400',_('Media Object Invalid or Not Specified'));
+ echo xmlData::error('400', T_('Media Object Invalid or Not Specified'));
}
$uid = $democratic->get_uid_from_object_id($media->id,$type);
@@ -715,7 +715,7 @@ class Api {
echo xmlData::keyed_array($xml_array);
break;
default:
- echo xmlData::error('405',_('Invalid Request'));
+ echo xmlData::error('405', T_('Invalid Request'));
break;
} // switch on method
diff --git a/lib/class/art.class.php b/lib/class/art.class.php
index 647e5163..ad8023ca 100644
--- a/lib/class/art.class.php
+++ b/lib/class/art.class.php
@@ -1000,7 +1000,7 @@ class Art extends database_object {
$handle = opendir($dir);
if (!$handle) {
- Error::add('general',_('Error: Unable to open') . ' ' . $dir);
+ Error::add('general', T_('Error: Unable to open') . ' ' . $dir);
debug_event('folder_art', "Error: Unable to open $dir for album art read", 2);
continue;
}
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 583cab8c..78459e24 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -376,7 +376,7 @@ class Artist extends database_object {
// check for fault
if ($client->fault) {
debug_event("lyrics", "Can't get lyrics", "1");
- return $results = "<h2>" . _('Fault') . "</h2>" . print_r($result);
+ return $results = "<h2>" . T_('Fault') . "</h2>" . print_r($result);
}
else {
// check for errors
@@ -384,12 +384,12 @@ class Artist extends database_object {
if ($err) {
debug_event("lyrics", "Getting error: $err", "1");
- return $results = "<h2>" . _('Error') . "</h2>" . $err;
+ return $results = "<h2>" . T_('Error') . "</h2>" . $err;
}
else {
// if returned "Not found" do not add
if($result['lyrics'] == "Not found") {
- $sorry = _('Sorry Lyrics Not Found.');
+ $sorry = T_('Sorry Lyrics Not Found.');
return $sorry;
}
else {
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index 83eb2d27..89cf5933 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -137,84 +137,84 @@ class Browse extends Query {
// Switch on the type of browsing we're doing
switch ($type) {
case 'song':
- show_box_top(_('Songs') . $match, $class);
+ show_box_top(T_('Songs') . $match, $class);
Song::build_cache($object_ids);
require_once Config::get('prefix') . '/templates/show_songs.inc.php';
show_box_bottom();
break;
case 'album':
- show_box_top(_('Albums') . $match, $class);
+ show_box_top(T_('Albums') . $match, $class);
Album::build_cache($object_ids,'extra');
require_once Config::get('prefix') . '/templates/show_albums.inc.php';
show_box_bottom();
break;
case 'user':
- show_box_top(_('Manage Users') . $match, $class);
+ show_box_top(T_('Manage Users') . $match, $class);
require_once Config::get('prefix') . '/templates/show_users.inc.php';
show_box_bottom();
break;
case 'artist':
- show_box_top(_('Artists') . $match, $class);
+ show_box_top(T_('Artists') . $match, $class);
Artist::build_cache($object_ids,'extra');
require_once Config::get('prefix') . '/templates/show_artists.inc.php';
show_box_bottom();
break;
case 'live_stream':
require_once Config::get('prefix') . '/templates/show_live_stream.inc.php';
- show_box_top(_('Radio Stations') . $match, $class);
+ show_box_top(T_('Radio Stations') . $match, $class);
require_once Config::get('prefix') . '/templates/show_live_streams.inc.php';
show_box_bottom();
break;
case 'playlist':
Playlist::build_cache($object_ids);
- show_box_top(_('Playlists') . $match, $class);
+ show_box_top(T_('Playlists') . $match, $class);
require_once Config::get('prefix') . '/templates/show_playlists.inc.php';
show_box_bottom();
break;
case 'playlist_song':
- show_box_top(_('Playlist Songs') . $match,$class);
+ show_box_top(T_('Playlist Songs') . $match,$class);
require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php';
show_box_bottom();
break;
case 'playlist_localplay':
- show_box_top(_('Current Playlist'));
+ show_box_top(T_('Current Playlist'));
require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php';
show_box_bottom();
break;
case 'smartplaylist':
- show_box_top(_('Smart Playlists') . $match, $class);
+ show_box_top(T_('Smart Playlists') . $match, $class);
require_once Config::get('prefix') . '/templates/show_smartplaylists.inc.php';
show_box_bottom();
break;
case 'catalog':
- show_box_top(_('Catalogs'), $class);
+ show_box_top(T_('Catalogs'), $class);
require_once Config::get('prefix') . '/templates/show_catalogs.inc.php';
show_box_bottom();
break;
case 'shoutbox':
- show_box_top(_('Shoutbox Records'),$class);
+ show_box_top(T_('Shoutbox Records'),$class);
require_once Config::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
show_box_bottom();
break;
case 'flagged':
- show_box_top(_('Flagged Records'),$class);
+ show_box_top(T_('Flagged Records'),$class);
require_once Config::get('prefix') . '/templates/show_flagged.inc.php';
show_box_bottom();
break;
case 'tag':
Tag::build_cache($tags);
- show_box_top(_('Tag Cloud'),$class);
+ show_box_top(T_('Tag Cloud'),$class);
require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php';
show_box_bottom();
break;
case 'video':
Video::build_cache($object_ids);
- show_box_top(_('Videos'),$class);
+ show_box_top(T_('Videos'),$class);
require_once Config::get('prefix') . '/templates/show_videos.inc.php';
show_box_bottom();
break;
case 'democratic':
- show_box_top(_('Democratic Playlist'),$class);
+ show_box_top(T_('Democratic Playlist'),$class);
require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php';
show_box_bottom();
default:
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 52073202..0de562d2 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -170,9 +170,9 @@ class Catalog extends database_object {
$this->f_name = truncate_with_ellipsis($this->name,Config::get('ellipse_threshold_title'));
$this->f_name_link = '<a href="' . Config::get('web_path') . '/admin/catalog.php?action=show_customize_catalog&catalog_id=' . $this->id . '" title="' . scrub_out($this->name) . '">' . scrub_out($this->f_name) . '</a>';
$this->f_path = truncate_with_ellipsis($this->path,Config::get('ellipse_threshold_title'));
- $this->f_update = $this->last_update ? date('d/m/Y h:i',$this->last_update) : _('Never');
- $this->f_add = $this->last_add ? date('d/m/Y h:i',$this->last_add) : _('Never');
- $this->f_clean = $this->last_clean ? date('d/m/Y h:i',$this->last_clean) : _('Never');
+ $this->f_update = $this->last_update ? date('d/m/Y h:i',$this->last_update) : T_('Never');
+ $this->f_add = $this->last_add ? date('d/m/Y h:i',$this->last_add) : T_('Never');
+ $this->f_clean = $this->last_clean ? date('d/m/Y h:i',$this->last_clean) : T_('Never');
} // format
@@ -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', sprintf(_('Error: %s is not readable or does not exist'), scrub_out($data['path'])));
+ Error::add('general', sprintf(T_('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', sprintf(_('Error: Catalog with %s already exists'), $path));
+ Error::add('general', sprintf(T_('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', T_('Catalog Insert Failed check debug logs'));
debug_event('catalog','SQL Failed:' . $sql,'3');
return false;
}
@@ -330,7 +330,7 @@ class Catalog extends database_object {
public function run_add($options) {
if ($this->catalog_type == 'remote') {
- show_box_top(_('Running Remote Sync') . '. . .');
+ show_box_top(T_('Running Remote Sync') . '. . .');
$this->get_remote_catalog($type=0);
show_box_bottom();
return true;
@@ -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', sprintf(_('Error: Unable to open %s'), $path));
+ Error::add('catalog_add', sprintf(T_('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', sprintf(_('Error: Unable to change to directory %s'), $path));
+ Error::add('catalog_add', sprintf(T_('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', sprintf(_('Error: Unable to change to directory %s'), $path));
+ Error::add('catalog_add', sprintf(T_('Error: Unable to change to directory %s'), $path));
}
/* Skip to the next file */
@@ -586,14 +586,14 @@ 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(T_('Error: Unable to get filesize for %s'), $full_file));
} // file_size check
if (!is_readable($full_file)) {
// not readable, warn user
debug_event('read',"$full_file is not readable by ampache",'2','ampache-catalog');
/* HINT: FullFile */
- Error::add('catalog_add', sprintf(_('%s is not readable by ampache'), $full_file));
+ Error::add('catalog_add', sprintf(T_('%s is not readable by ampache'), $full_file));
continue;
}
@@ -602,7 +602,7 @@ class Catalog extends database_object {
if (strcmp($full_file,iconv(Config::get('site_charset'),Config::get('site_charset'),$full_file)) != '0') {
debug_event('read',$full_file . ' has non-' . Config::get('site_charset') . ' characters and can not be indexed, converted filename:' . iconv(Config::get('site_charset'),Config::get('site_charset'),$full_file),'1');
/* HINT: FullFile */
- Error::add('catalog_add', sprintf(_('%s does not match site charset'), $full_file));
+ Error::add('catalog_add', sprintf(T_('%s does not match site charset'), $full_file));
continue;
}
} // end if iconv
@@ -1079,14 +1079,14 @@ class Catalog extends database_object {
if ($info['change']) {
$file = scrub_out($song->file);
echo "<dl>\n\t<dd>";
- echo "<strong>$file " . _('Updated') . "</strong>\n";
+ echo "<strong>$file " . T_('Updated') . "</strong>\n";
echo $info['text'];
echo "\t</dd>\n</dl><hr align=\"left\" width=\"50%\" />";
flush();
} // if change
else {
echo"<dl>\n\t<dd>";
- echo "<strong>" . scrub_out($song->file) . "</strong><br />" . _('No Update Needed') . "\n";
+ echo "<strong>" . scrub_out($song->file) . "</strong><br />" . T_('No Update Needed') . "\n";
echo "\t</dd>\n</dl><hr align=\"left\" width=\"50%\" />";
flush();
}
@@ -1221,7 +1221,7 @@ class Catalog extends database_object {
public function add_to_catalog() {
if ($this->catalog_type == 'remote') {
- show_box_top(_('Running Remote Update') . '. . .');
+ show_box_top(T_('Running Remote Update') . '. . .');
$this->get_remote_catalog($type=0);
show_box_bottom();
return true;
@@ -1248,7 +1248,7 @@ class Catalog extends database_object {
if ($this->import_m3u($full_file)) {
$file = basename($full_file);
if ($verbose) {
- echo "&nbsp;&nbsp;&nbsp;" . _('Added Playlist From') . " $file . . . .<br />\n";
+ echo "&nbsp;&nbsp;&nbsp;" . T_('Added Playlist From') . " $file . . . .<br />\n";
flush();
}
} // end if import worked
@@ -1277,8 +1277,8 @@ class Catalog extends database_object {
}
show_box_top();
- echo "\n<br />" . _('Catalog Update Finished') . "... " . _('Total Time') . " [" . date("i:s",$time_diff) . "] " .
- _('Total Songs') . " [" . $this->count . "] " . _('Songs Per Seconds') . " [" . $song_per_sec . "]<br /><br />";
+ echo "\n<br />" . T_('Catalog Update Finished') . "... " . T_('Total Time') . " [" . date("i:s",$time_diff) . "] " .
+ T_('Total Songs') . " [" . $this->count . "] " . T_('Songs Per Seconds') . " [" . $song_per_sec . "]<br /><br />";
show_box_bottom();
} // add_to_catalog
@@ -1301,7 +1301,7 @@ class Catalog extends database_object {
if ($remote_handle->state() != 'CONNECTED') {
debug_event('APICLIENT','Error Unable to make API client ready','1');
- Error::add('general',_('Error Connecting to Remote Server'));
+ Error::add('general', T_('Error Connecting to Remote Server'));
Error::display('general');
return false;
}
@@ -1310,7 +1310,7 @@ class Catalog extends database_object {
$remote_catalog_info = $remote_handle->info();
// Tell em what we've found johnny!
- printf(_('%u remote catalog(s) found (%u songs)'),$remote_catalog_info['catalogs'],$remote_catalog_info['songs']);
+ printf(T_('%u remote catalog(s) found (%u songs)'),$remote_catalog_info['catalogs'],$remote_catalog_info['songs']);
flush();
// Hardcoded for now
@@ -1334,14 +1334,14 @@ class Catalog extends database_object {
foreach ($songs as $data) {
if (!$this->insert_remote_song($data['song'])) {
debug_event('REMOTE_INSERT','Remote Insert failed, see previous log messages -' . $data['song']['self']['id'],'1');
- Error::add('general',_('Unable to Insert Song - %s'),$data['song']['title']);
+ Error::add('general', T_('Unable to Insert Song - %s'),$data['song']['title']);
Error::display('general');
flush();
}
} // end foreach
} // end while
- echo "<p>" . _('Completed updating remote catalog(s)') . ".</p><hr />\n";
+ echo "<p>" . T_('Completed updating remote catalog(s)') . ".</p><hr />\n";
flush();
// Update the last update value
@@ -1384,7 +1384,7 @@ class Catalog extends database_object {
// mount points fail
if ($this->catalog_type == 'local' && !is_readable($this->path)) {
debug_event('catalog', 'Catalog path:' . $this->path . ' unreadable, clean failed', 1);
- Error::add('general',_('Catalog Root unreadable, stopping clean'));
+ Error::add('general', T_('Catalog Root unreadable, stopping clean'));
Error::display('general');
return false;
}
@@ -1408,7 +1408,7 @@ class Catalog extends database_object {
// Never remove everything; it might be a dead mount
if ($dead_count >= $total) {
debug_event('catalog', 'All files would be removed. Doing nothing.', 1);
- Error::add('general', _('All files would be removed. Doing nothing'));
+ Error::add('general', T_('All files would be removed. Doing nothing'));
continue;
}
if ($dead_count) {
@@ -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', sprintf(_('Error File Not Found or 0 Bytes: %s'), $results['file']));
+ Error::add('general', sprintf(T_('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', sprintf(_('Error Remote File Not Found or 0 Bytes: %s'), $results['file']));
+ Error::add('general', sprintf(T_('Error Remote File Not Found or 0 Bytes: %s'), $results['file']));
// Store it in an array we'll delete it later...
@@ -1696,7 +1696,7 @@ class Catalog extends database_object {
show_box_top();
echo '<strong>';
- printf(_('Catalog Verify Done. %d of %d files updated.'), $total_updated, $number);
+ printf(T_('Catalog Verify Done. %d of %d files updated.'), $total_updated, $number);
echo "</strong><br />\n";
show_box_bottom();
ob_flush();
@@ -1737,7 +1737,7 @@ class Catalog extends database_object {
}
if (!is_readable($row['file'])) {
- Error::add('general', sprintf(_('%s does not exist or is not readable'), $row['file']));
+ Error::add('general', sprintf(T_('%s does not exist or is not readable'), $row['file']));
debug_event('read', $row['file'] . ' does not exist or is not readable', 5,'ampache-catalog');
continue;
}
@@ -1835,7 +1835,7 @@ class Catalog extends database_object {
/* Ohh no the artist has lost it's mojo! */
if (!$artist) {
- $artist = _('Unknown (Orphaned)');
+ $artist = T_('Unknown (Orphaned)');
}
// Remove the prefix so we can sort it correctly
@@ -1890,7 +1890,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', sprintf(_('Updating Artist: %s'), $artist));
+ Error::add('general', sprintf(T_('Updating Artist: %s'), $artist));
}
}
}
@@ -1911,7 +1911,7 @@ class Catalog extends database_object {
$artist_id = Dba::insert_id();
if (!$db_results) {
- Error::add('general', sprintf(_('Inserting Artist: %s'), $artist));
+ Error::add('general', sprintf(T_('Inserting Artist: %s'), $artist));
}
} // not found
@@ -1943,7 +1943,7 @@ class Catalog extends database_object {
/* Ohh no the album has lost its mojo */
if (!$album) {
- $album = _('Unknown (Orphaned)');
+ $album = T_('Unknown (Orphaned)');
unset($album_year, $album_disk);
}
@@ -2091,7 +2091,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', sprintf(_('SQL Error Adding %s'), $file));
+ Error::add('catalog_add', sprintf(T_('SQL Error Adding %s'), $file));
}
$song_id = Dba::insert_id();
@@ -2314,7 +2314,7 @@ class Catalog extends database_object {
$playlist_id = Playlist::create($name,'public');
if (!$playlist_id) {
- $reason = _('Playlist creation error.');
+ $reason = T_('Playlist creation error.');
return false;
}
diff --git a/lib/class/config.class.php b/lib/class/config.class.php
index 78745be8..8ad7189e 100644
--- a/lib/class/config.class.php
+++ b/lib/class/config.class.php
@@ -110,7 +110,7 @@ class Config {
if (isset(self::$_global[$name]) && !$clobber) {
debug_event('Config', "Tried to overwrite existing key $name without setting clobber", 5);
- Error::add('Config Global', sprintf(_('Trying to clobber \'%s\' without setting clobber'), $name));
+ Error::add('Config Global', sprintf(T_('Trying to clobber \'%s\' without setting clobber'), $name));
return false;
}
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php
index a0ea01a5..71699960 100644
--- a/lib/class/democratic.class.php
+++ b/lib/class/democratic.class.php
@@ -150,24 +150,24 @@ class Democratic extends tmpPlaylist {
*/
public function format() {
- $this->f_cooldown = $this->cooldown . ' ' . _('minutes');
- $this->f_primary = $this->primary ? _('Primary') : '';
+ $this->f_cooldown = $this->cooldown . ' ' . T_('minutes');
+ $this->f_primary = $this->primary ? T_('Primary') : '';
switch ($this->level) {
case '5':
- $this->f_level = _('Guest');
+ $this->f_level = T_('Guest');
break;
case '25':
- $this->f_level = _('User');
+ $this->f_level = T_('User');
break;
case '50':
- $this->f_level = _('Content Manager');
+ $this->f_level = T_('Content Manager');
break;
case '75':
- $this->f_level = _('Catalog Manager');
+ $this->f_level = T_('Catalog Manager');
break;
case '100':
- $this->f_level = _('Admin');
+ $this->f_level = T_('Admin');
break;
}
diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php
index b3791dbd..bbb3f4a0 100644
--- a/lib/class/flag.class.php
+++ b/lib/class/flag.class.php
@@ -322,8 +322,8 @@ class Flag extends database_object {
*/
public function print_status() {
- if ($this->approved) { echo _('Approved'); }
- else { echo _('Pending'); }
+ if ($this->approved) { echo T_('Approved'); }
+ else { echo T_('Pending'); }
} // print_status
@@ -335,19 +335,19 @@ class Flag extends database_object {
switch ($this->flag) {
case 'delete':
- $name = _('Delete');
+ $name = T_('Delete');
break;
case 'retag':
- $name = _('Re-Tag');
+ $name = T_('Re-Tag');
break;
case 'reencode':
- $name = _('Re-encode');
+ $name = T_('Re-encode');
break;
case 'other':
- $name = _('Other');
+ $name = T_('Other');
break;
default:
- $name = _('Unknown');
+ $name = T_('Unknown');
break;
} // end switch
diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php
index ef03b1c3..cebc5bff 100644
--- a/lib/class/localplay.class.php
+++ b/lib/class/localplay.class.php
@@ -653,16 +653,16 @@ class Localplay {
switch ($state) {
case 'play':
- return _('Now Playing');
+ return T_('Now Playing');
break;
case 'stop':
- return _('Stopped');
+ return T_('Stopped');
break;
case 'pause':
- return _('Paused');
+ return T_('Paused');
break;
default:
- return _('Unknown');
+ return T_('Unknown');
break;
} // switch on state
diff --git a/lib/class/playlist_object.abstract.php b/lib/class/playlist_object.abstract.php
index def7b3f2..fd9b0147 100644
--- a/lib/class/playlist_object.abstract.php
+++ b/lib/class/playlist_object.abstract.php
@@ -39,7 +39,7 @@ abstract class playlist_object extends database_object {
public function format() {
$this->f_name = truncate_with_ellipsis($this->name,Config::get('ellipse_threshold_title'));
- $this->f_type = ($this->type == 'private') ? get_user_icon('lock',_('Private')) : '';
+ $this->f_type = ($this->type == 'private') ? get_user_icon('lock', T_('Private')) : '';
$client = new User($this->user);
diff --git a/lib/class/query.class.php b/lib/class/query.class.php
index 49a978af..1dffd35b 100644
--- a/lib/class/query.class.php
+++ b/lib/class/query.class.php
@@ -79,7 +79,7 @@ class Query {
return true;
}
- Error::add('browse', _('Browse not found or expired, try reloading the page'));
+ Error::add('browse', T_('Browse not found or expired, try reloading the page'));
return false;
}
diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php
index 46743614..d4be4f76 100644
--- a/lib/class/radio.class.php
+++ b/lib/class/radio.class.php
@@ -92,11 +92,11 @@ class Radio extends database_object implements media {
// Verify the incoming data
if (!$data['id']) {
- Error::add('general', _('Missing ID'));
+ Error::add('general', T_('Missing ID'));
}
if (!$data['name']) {
- Error::add('general', _('Name Required'));
+ Error::add('general', T_('Name Required'));
}
$allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp');
@@ -104,7 +104,7 @@ class Radio extends database_object implements media {
$elements = explode(":",$data['url']);
if (!in_array($elements['0'],$allowed_array)) {
- Error::add('general', _('Invalid URL must be mms:// , https:// or http://'));
+ Error::add('general', T_('Invalid URL must be mms:// , https:// or http://'));
}
if (Error::occurred()) {
@@ -136,7 +136,7 @@ class Radio extends database_object implements media {
// Make sure we've got a name
if (!strlen($data['name'])) {
- Error::add('name', _('Name Required'));
+ Error::add('name', T_('Name Required'));
}
$allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp');
@@ -144,13 +144,13 @@ 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', T_('Invalid URL must be http:// or https://'));
}
// Make sure it's a real catalog
$catalog = new Catalog($data['catalog']);
if (!$catalog->name) {
- Error::add('catalog', _('Invalid Catalog'));
+ Error::add('catalog', T_('Invalid Catalog'));
}
if (Error::occurred()) { return false; }
diff --git a/lib/class/random.class.php b/lib/class/random.class.php
index ef6c3037..5dc8b47b 100644
--- a/lib/class/random.class.php
+++ b/lib/class/random.class.php
@@ -368,16 +368,16 @@ class Random implements media {
switch ($type) {
case 'album':
- return _('Related Album');
+ return T_('Related Album');
break;
case 'genre':
- return _('Related Genre');
+ return T_('Related Genre');
break;
case 'artist':
- return _('Related Artist');
+ return T_('Related Artist');
break;
default:
- return _('Pure Random');
+ return T_('Pure Random');
break;
} // end switch
diff --git a/lib/class/registration.class.php b/lib/class/registration.class.php
index 6175b016..bfc49d4b 100644
--- a/lib/class/registration.class.php
+++ b/lib/class/registration.class.php
@@ -59,9 +59,9 @@ class Registration {
// We are the system
$mailer->set_default_sender();
- $mailer->subject = sprintf(_("New User Registration at %s"), Config::get('site_title'));
+ $mailer->subject = sprintf(T_("New User Registration at %s"), Config::get('site_title'));
- $mailer->message = sprintf(_("Thank you for registering\n\n
+ $mailer->message = sprintf(T_("Thank you for registering\n\n
Please keep this e-mail for your records. Your account information is as follows:
----------------------
Username: %s
@@ -82,7 +82,7 @@ Thank you for registering
// Check to see if the admin should be notified
if (Config::get('admin_notify_reg')) {
- $mailer->message = sprintf(_("A new user has registered
+ $mailer->message = sprintf(T_("A new user has registered
The following values were entered.
Username: %s
diff --git a/lib/class/search.class.php b/lib/class/search.class.php
index fc860ed9..eaa45a97 100644
--- a/lib/class/search.class.php
+++ b/lib/class/search.class.php
@@ -53,55 +53,55 @@ class Search extends playlist_object {
$this->basetypes['numeric'][] = array(
'name' => 'gte',
- 'description' => _('is greater than or equal to'),
+ 'description' => T_('is greater than or equal to'),
'sql' => '>='
);
$this->basetypes['numeric'][] = array(
'name' => 'lte',
- 'description' => _('is less than or equal to'),
+ 'description' => T_('is less than or equal to'),
'sql' => '<='
);
$this->basetypes['numeric'][] = array(
'name' => 'equal',
- 'description' => _('is'),
+ 'description' => T_('is'),
'sql' => '<=>'
);
$this->basetypes['numeric'][] = array(
'name' => 'ne',
- 'description' => _('is not'),
+ 'description' => T_('is not'),
'sql' => '<>'
);
$this->basetypes['numeric'][] = array(
'name' => 'gt',
- 'description' => _('is greater than'),
+ 'description' => T_('is greater than'),
'sql' => '>'
);
$this->basetypes['numeric'][] = array(
'name' => 'lt',
- 'description' => _('is less than'),
+ 'description' => T_('is less than'),
'sql' => '<'
);
$this->basetypes['boolean'][] = array(
'name' => 'true',
- 'description' => _('is true')
+ 'description' => T_('is true')
);
$this->basetypes['boolean'][] = array(
'name' => 'false',
- 'description' => _('is false')
+ 'description' => T_('is false')
);
$this->basetypes['text'][] = array(
'name' => 'contain',
- 'description' => _('contains'),
+ 'description' => T_('contains'),
'sql' => 'LIKE',
'preg_match' => array('/^/','/$/'),
'preg_replace' => array('%', '%')
@@ -109,7 +109,7 @@ class Search extends playlist_object {
$this->basetypes['text'][] = array(
'name' => 'notcontain',
- 'description' => _('does not contain'),
+ 'description' => T_('does not contain'),
'sql' => 'NOT LIKE',
'preg_match' => array('/^/','/$/'),
'preg_replace' => array('%', '%')
@@ -117,7 +117,7 @@ class Search extends playlist_object {
$this->basetypes['text'][] = array(
'name' => 'start',
- 'description' => _('starts with'),
+ 'description' => T_('starts with'),
'sql' => 'LIKE',
'preg_match' => '/$/',
'preg_replace' => '%'
@@ -125,7 +125,7 @@ class Search extends playlist_object {
$this->basetypes['text'][] = array(
'name' => 'end',
- 'description' => _('ends with'),
+ 'description' => T_('ends with'),
'sql' => 'LIKE',
'preg_match' => '/^/',
'preg_replace' => '%'
@@ -133,58 +133,58 @@ class Search extends playlist_object {
$this->basetypes['text'][] = array(
'name' => 'equal',
- 'description' => _('is'),
+ 'description' => T_('is'),
'sql' => '='
);
$this->basetypes['text'][] = array(
'name' => 'sounds',
- 'description' => _('sounds like'),
+ 'description' => T_('sounds like'),
'sql' => 'SOUNDS LIKE'
);
$this->basetypes['text'][] = array(
'name' => 'notsounds',
- 'description' => _('does not sound like'),
+ 'description' => T_('does not sound like'),
'sql' => 'NOT SOUNDS LIKE'
);
$this->basetypes['boolean_numeric'][] = array(
'name' => 'equal',
- 'description' => _('is'),
+ 'description' => T_('is'),
'sql' => '<=>'
);
$this->basetypes['boolean_numeric'][] = array(
'name' => 'ne',
- 'description' => _('is not'),
+ 'description' => T_('is not'),
'sql' => '<>'
);
$this->basetypes['boolean_subsearch'][] = array(
'name' => 'equal',
- 'description' => _('is'),
+ 'description' => T_('is'),
'sql' => ''
);
$this->basetypes['boolean_subsearch'][] = array(
'name' => 'ne',
- 'description' => _('is not'),
+ 'description' => T_('is not'),
'sql' => 'NOT'
);
$this->basetypes['date'][] = array(
'name' => 'lt',
- 'description' => _('before'),
+ 'description' => T_('before'),
'sql' => '>'
);
$this->basetypes['date'][] = array(
'name' => 'gt',
- 'description' => _('after'),
+ 'description' => T_('after'),
'sql' => '>'
);
@@ -192,35 +192,35 @@ class Search extends playlist_object {
case 'song':
$this->types[] = array(
'name' => 'anywhere',
- 'label' => _('Any searchable text'),
+ 'label' => T_('Any searchable text'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'title',
- 'label' => _('Title'),
+ 'label' => T_('Title'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'album',
- 'label' => _('Album'),
+ 'label' => T_('Album'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'artist',
- 'label' => _('Artist'),
+ 'label' => T_('Artist'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'comment',
- 'label' => _('Comment'),
+ 'label' => T_('Comment'),
'type' => 'text',
'widget' => array('input', 'text')
);
@@ -228,28 +228,28 @@ class Search extends playlist_object {
$this->types[] = array(
'name' => 'tag',
- 'label' => _('Tag'),
+ 'label' => T_('Tag'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'file',
- 'label' => _('Filename'),
+ 'label' => T_('Filename'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'year',
- 'label' => _('Year'),
+ 'label' => T_('Year'),
'type' => 'numeric',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'time',
- 'label' => _('Length (in minutes)'),
+ 'label' => T_('Length (in minutes)'),
'type' => 'numeric',
'widget' => array('input', 'text')
);
@@ -257,7 +257,7 @@ class Search extends playlist_object {
if (Config::get('ratings')) {
$this->types[] = array(
'name' => 'rating',
- 'label' => _('Rating'),
+ 'label' => T_('Rating'),
'type' => 'numeric',
'widget' => array(
'select',
@@ -274,7 +274,7 @@ class Search extends playlist_object {
$this->types[] = array(
'name' => 'bitrate',
- 'label' => _('Bitrate'),
+ 'label' => T_('Bitrate'),
'type' => 'numeric',
'widget' => array(
'select',
@@ -299,21 +299,21 @@ class Search extends playlist_object {
$this->types[] = array(
'name' => 'played',
- 'label' => _('Played'),
+ 'label' => T_('Played'),
'type' => 'boolean',
'widget' => array('input', 'hidden')
);
$this->types[] = array(
'name' => 'added',
- 'label' => _('Added'),
+ 'label' => T_('Added'),
'type' => 'date',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'updated',
- 'label' => _('Updated'),
+ 'label' => T_('Updated'),
'type' => 'date',
'widget' => array('input', 'text')
);
@@ -326,7 +326,7 @@ class Search extends playlist_object {
}
$this->types[] = array(
'name' => 'catalog',
- 'label' => _('Catalog'),
+ 'label' => T_('Catalog'),
'type' => 'boolean_numeric',
'widget' => array('select', $catalogs)
);
@@ -339,7 +339,7 @@ class Search extends playlist_object {
}
$this->types[] = array(
'name' => 'playlist',
- 'label' => _('Playlist'),
+ 'label' => T_('Playlist'),
'type' => 'boolean_numeric',
'widget' => array('select', $playlists)
);
@@ -352,7 +352,7 @@ class Search extends playlist_object {
}
$this->types[] = array(
'name' => 'smartplaylist',
- 'label' => _('Smart Playlist'),
+ 'label' => T_('Smart Playlist'),
'type' => 'boolean_subsearch',
'widget' => array('select', $playlists)
);
@@ -360,14 +360,14 @@ class Search extends playlist_object {
case 'album':
$this->types[] = array(
'name' => 'title',
- 'label' => _('Title'),
+ 'label' => T_('Title'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'year',
- 'label' => _('Year'),
+ 'label' => T_('Year'),
'type' => 'numeric',
'widget' => array('input', 'text')
);
@@ -375,7 +375,7 @@ class Search extends playlist_object {
if (Config::get('ratings')) {
$this->types[] = array(
'name' => 'rating',
- 'label' => _('Rating'),
+ 'label' => T_('Rating'),
'type' => 'numeric',
'widget' => array(
'select',
@@ -398,7 +398,7 @@ class Search extends playlist_object {
}
$this->types[] = array(
'name' => 'catalog',
- 'label' => _('Catalog'),
+ 'label' => T_('Catalog'),
'type' => 'boolean_numeric',
'widget' => array('select', $catalogs)
);
@@ -406,7 +406,7 @@ class Search extends playlist_object {
$this->types[] = array(
'name' => 'tag',
- 'label' => _('Tag'),
+ 'label' => T_('Tag'),
'type' => 'text',
'widget' => array('input', 'text')
);
@@ -414,7 +414,7 @@ class Search extends playlist_object {
case 'video':
$this->types[] = array(
'name' => 'filename',
- 'label' => _('Filename'),
+ 'label' => T_('Filename'),
'type' => 'text',
'widget' => array('input', 'text')
);
@@ -422,13 +422,13 @@ class Search extends playlist_object {
case 'artist':
$this->types[] = array(
'name' => 'name',
- 'label' => _('Name'),
+ 'label' => T_('Name'),
'type' => 'text',
'widget' => array('input', 'text')
);
$this->types[] = array(
'name' => 'tag',
- 'label' => _('Tag'),
+ 'label' => T_('Tag'),
'type' => 'text',
'widget' => array('input', 'text')
);
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index c1a6c3fb..3401436b 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -417,7 +417,7 @@ class Update {
if (!$update_needed) {
if (!defined('CLI')) { echo '<p align="center">'; }
- echo _('No updates needed.');
+ echo T_('No updates needed.');
if (!defined('CLI')) {
echo '[<a href="', Config::get('web_path'), '">Return</a>]</p>';
}
@@ -446,7 +446,7 @@ class Update {
/* Verify that there are no plugins installed
//FIXME: provide a link to remove all plugins, otherwise this could turn into a catch 22
if (!$self::plugins_installed()) {
- $GLOBALS['error']->add_error('general',_('Plugins detected, please remove all Plugins and try again'));
+ $GLOBALS['error']->add_error('general', T_('Plugins detected, please remove all Plugins and try again'));
return false;
} */
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 4b283d62..09000600 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -408,11 +408,11 @@ class User extends database_object {
public function update($data) {
if (empty($data['username'])) {
- Error::add('username',_('Error Username Required'));
+ Error::add('username', T_('Error Username Required'));
}
if ($data['password1'] != $data['password2'] AND !empty($data['password1'])) {
- Error::add('password',_("Error Passwords don't match"));
+ Error::add('password', T_("Error Passwords don't match"));
}
if (Error::occurred()) {
@@ -696,11 +696,11 @@ class User extends database_object {
public function format() {
/* If they have a last seen date */
- if (!$this->last_seen) { $this->f_last_seen = _('Never'); }
+ if (!$this->last_seen) { $this->f_last_seen = T_('Never'); }
else { $this->f_last_seen = date("m\/d\/Y - H:i",$this->last_seen); }
/* If they have a create date */
- if (!$this->create_date) { $this->f_create_date = _('Unknown'); }
+ if (!$this->create_date) { $this->f_create_date = T_('Unknown'); }
else { $this->f_create_date = date("m\/d\/Y - H:i",$this->create_date); }
// Base link
@@ -722,7 +722,7 @@ class User extends database_object {
$this->ip_history = inet_ntop($data['0']['ip']);
}
else {
- $this->ip_history = _('Not Enough Data');
+ $this->ip_history = T_('Not Enough Data');
}
} // format_user
diff --git a/lib/class/video.class.php b/lib/class/video.class.php
index 5051fa97..22bafa19 100644
--- a/lib/class/video.class.php
+++ b/lib/class/video.class.php
@@ -91,7 +91,7 @@ class Video extends database_object implements media {
$this->f_codec = $this->video_codec . ' / ' . $this->audio_codec;
$this->f_resolution = $this->resolution_x . 'x' . $this->resolution_y;
$this->f_tags = '';
- $this->f_length = floor($this->time/60) . ' ' . _('minutes');
+ $this->f_length = floor($this->time/60) . ' ' . T_('minutes');
} // format
diff --git a/lib/general.lib.php b/lib/general.lib.php
index a739c081..2e8d66df 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -238,7 +238,7 @@ function get_languages() {
case 'ar_SA'; $name = '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'; break; /* Arabic */
case 'he_IL'; $name = '&#1506;&#1489;&#1512;&#1497;&#1514;'; break; /* Hebrew */
case 'fa_IR'; $name = '&#1601;&#1575;&#1585;&#1587;&#1610;'; break; /* Farsi */
- default: $name = _('Unknown'); break;
+ default: $name = T_('Unknown'); break;
} // end switch
diff --git a/lib/install.lib.php b/lib/install.lib.php
index bb26cd47..e99d2438 100644
--- a/lib/install.lib.php
+++ b/lib/install.lib.php
@@ -75,7 +75,7 @@ function install_check_status($configfile) {
if (!file_exists($configfile)) {
return true;
} else {
- Error::add('general',_('Config file already exists, install is probably completed'));
+ Error::add('general', T_('Config file already exists, install is probably completed'));
}
/*
@@ -86,14 +86,14 @@ function install_check_status($configfile) {
$dbh = check_database($results['database_hostname'],$results['database_username'],$results['database_password']);
if (!is_resource($dbh)) {
- Error::add('general',_('Unable to connect to database, check your ampache config'));
+ Error::add('general', T_('Unable to connect to database, check your ampache config'));
return false;
}
$select_db = mysql_select_db($results['database_name'],$dbh);
if (!$select_db) {
- Error::add('general',_('Unable to select database, check your ampache config'));
+ Error::add('general', T_('Unable to select database, check your ampache config'));
return false;
}
@@ -103,7 +103,7 @@ function install_check_status($configfile) {
return true;
}
else {
- Error::add('general',_('Existing Database detected, unable to continue installation'));
+ Error::add('general', T_('Existing Database detected, unable to continue installation'));
return false;
}
@@ -123,7 +123,7 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
$is_valid = preg_match("/([^\d\w\_\-])/",$database,$matches);
if (count($matches)) {
- Error::add('general',_('Error: Database name invalid must not be a reserved word, and must be Alphanumeric'));
+ Error::add('general', T_('Error: Database name invalid must not be a reserved word, and must be Alphanumeric'));
return false;
}
@@ -140,7 +140,7 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
$dbh = Dba::dbh();
if (!is_resource($dbh)) {
- Error::add('general', sprintf(_('Error: Unable to make Database Connection %s'), mysql_error()));
+ Error::add('general', sprintf(T_('Error: Unable to make Database Connection %s'), mysql_error()));
return false;
}
@@ -151,13 +151,13 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
// Rien a faire, we've got the db just blow through
}
elseif ($db_selected && !$_POST['overwrite_db']) {
- Error::add('general',_('Error: Database Already exists and Overwrite not checked'));
+ Error::add('general', T_('Error: Database Already exists and Overwrite not checked'));
return false;
}
elseif (!$db_selected) {
$sql = "CREATE DATABASE `" . Dba::escape($database) . "`";
if (!$db_results = @mysql_query($sql, $dbh)) {
- Error::add('general',sprintf(_('Error: Unable to Create Database %s'), mysql_error()));
+ Error::add('general',sprintf(T_('Error: Unable to Create Database %s'), mysql_error()));
return false;
}
@mysql_select_db($database, $dbh);
@@ -167,7 +167,7 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
$db_results = @mysql_query($sql,$dbh);
$sql = "CREATE DATABASE `" . Dba::escape($database) . "`";
if (!$db_results = @mysql_query($sql, $dbh)) {
- Error::add('general', sprintf(_('Error: Unable to Create Database %s'), mysql_error()));
+ Error::add('general', sprintf(T_('Error: Unable to Create Database %s'), mysql_error()));
return false;
}
@mysql_select_db($database, $dbh);
@@ -180,7 +180,7 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
$db_pass = $_POST['db_password'] ? $_POST['db_password'] : $dbpass;
if (!strlen($db_user) || !strlen($db_pass)) {
- Error::add('general',_('Error: Ampache SQL Username or Password missing'));
+ Error::add('general', T_('Error: Ampache SQL Username or Password missing'));
return false;
}
@@ -189,7 +189,7 @@ function install_insert_db($username,$password,$hostname,$database,$dbuser=false
if (!$db_results = @mysql_query($sql, $dbh)) {
// HINT: 1: db_user, 2: database, 3: hostname, 4: mysql_error()
- Error::add('general', sprintf(_('Error: Unable to Insert %1$s with permissions to %2$s on %3$s %4$s'), $db_user, $database, $hostname, mysql_error()));
+ Error::add('general', sprintf(T_('Error: Unable to Insert %1$s with permissions to %2$s on %3$s %4$s'), $db_user, $database, $hostname, mysql_error()));
return false;
}
} // end if we are creating a user
@@ -258,11 +258,11 @@ function install_create_config($web_path,$username,$password,$hostname,$database
*/
// Connect to the DB
if(!is_resource($dbh)) {
- Error::add('general', _("Database Connection Failed Check Hostname, Username and Password"));
+ Error::add('general', T_("Database Connection Failed Check Hostname, Username and Password"));
return false;
}
if (!@mysql_select_db($database, $dbh)) {
- Error::add('general', sprintf(_('Database Selection Failure Check Existance of %s'), $database));
+ Error::add('general', sprintf(T_('Database Selection Failure Check Existance of %s'), $database));
return false;
}
@@ -271,13 +271,13 @@ function install_create_config($web_path,$username,$password,$hostname,$database
// Make sure the directory is writable OR the empty config file is
if (!$download) {
if (!check_config_writable()) {
- Error::add('general', _("Config file is not writable"));
+ Error::add('general', T_("Config file is not writable"));
return false;
}
else {
// Given that $final is > 0, we can ignore lazy comparison problems
if (!file_put_contents($config_file,$final)) {
- Error::add('general', _("Error Writing config file"));
+ Error::add('general', T_("Error Writing config file"));
return false;
}
}
@@ -300,26 +300,26 @@ function install_create_config($web_path,$username,$password,$hostname,$database
function install_create_account($username,$password,$password2) {
if (!strlen($username) OR !strlen($password)) {
- Error::add('general',_('No Username/Password specified'));
+ Error::add('general', T_('No Username/Password specified'));
return false;
}
if ($password !== $password2) {
- Error::add('general',_('Passwords do not match'));
+ Error::add('general', T_('Passwords do not match'));
return false;
}
$dbh = Dba::dbh();
if (!is_resource($dbh)) {
- Error::add('general', sprintf(_('Database Connection Failed: %s'), mysql_error()));
+ Error::add('general', sprintf(T_('Database Connection Failed: %s'), mysql_error()));
return false;
}
$db_select = @mysql_select_db(Config::get('database_name'),$dbh);
if (!$db_select) {
- Error::add('general', sprintf(_('Database Select Failed: %s'), mysql_error()));
+ Error::add('general', sprintf(T_('Database Select Failed: %s'), mysql_error()));
return false;
}
@@ -329,7 +329,7 @@ function install_create_account($username,$password,$password2) {
$insert_id = User::create($username,'Administrator','',$password,'100');
if (!$insert_id) {
- Error::add('general', sprintf(_('Insert of Base User Failed %s'), mysql_error()));
+ Error::add('general', sprintf(T_('Insert of Base User Failed %s'), mysql_error()));
return false;
}
diff --git a/lib/javascript/search-data.php b/lib/javascript/search-data.php
index 18432454..333d6acc 100644
--- a/lib/javascript/search-data.php
+++ b/lib/javascript/search-data.php
@@ -47,5 +47,5 @@ echo 'var types = $H(\'';
echo arrayToJSON($search->types) . "'.evalJSON());\n";
echo 'var basetypes = $H(\'';
echo arrayToJSON($search->basetypes) . "'.evalJSON());\n";
-echo 'removeIcon = \'<a href="javascript: void(0)">' . get_user_icon('disable', _('Remove')) . '</a>\';';
+echo 'removeIcon = \'<a href="javascript: void(0)">' . get_user_icon('disable', T_('Remove')) . '</a>\';';
?>
diff --git a/lib/preferences.php b/lib/preferences.php
index a0e21edb..4f9a26b9 100644
--- a/lib/preferences.php
+++ b/lib/preferences.php
@@ -171,8 +171,8 @@ function create_preference_input($name,$value) {
if ($value == '1') { $is_true = "selected=\"selected\""; }
else { $is_false = "selected=\"selected\""; }
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"1\" $is_true>" . _("Enable") . "</option>\n";
- echo "\t<option value=\"0\" $is_false>" . _("Disable") . "</option>\n";
+ echo "\t<option value=\"1\" $is_true>" . T_("Enable") . "</option>\n";
+ echo "\t<option value=\"0\" $is_false>" . T_("Disable") . "</option>\n";
echo "</select>\n";
break;
case 'play_type':
@@ -181,29 +181,29 @@ function create_preference_input($name,$value) {
elseif ($value == 'xspf_player') { $is_xspf_player = 'selected="selected"'; }
else { $is_stream = "selected=\"selected\""; }
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"\">" . _('None') . "</option>\n";
+ echo "\t<option value=\"\">" . T_('None') . "</option>\n";
if (Config::get('allow_stream_playback')) {
- echo "\t<option value=\"stream\" $is_stream>" . _('Stream') . "</option>\n";
+ echo "\t<option value=\"stream\" $is_stream>" . T_('Stream') . "</option>\n";
}
if (Config::get('allow_democratic_playback')) {
- echo "\t<option value=\"democratic\" $is_vote>" . _('Democratic') . "</option>\n";
+ echo "\t<option value=\"democratic\" $is_vote>" . T_('Democratic') . "</option>\n";
}
if (Config::get('allow_localplay_playback')) {
- echo "\t<option value=\"localplay\" $is_local>" . _('Localplay') . "</option>\n";
+ echo "\t<option value=\"localplay\" $is_local>" . T_('Localplay') . "</option>\n";
}
- echo "\t<option value=\"xspf_player\" $is_xspf_player>" . _('Flash Player') . "</option>\n";
+ echo "\t<option value=\"xspf_player\" $is_xspf_player>" . T_('Flash Player') . "</option>\n";
echo "</select>\n";
break;
case 'playlist_type':
$var_name = $value . "_type";
${$var_name} = "selected=\"selected\"";
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"m3u\" $m3u_type>" . _('M3U') . "</option>\n";
- echo "\t<option value=\"simple_m3u\" $simple_m3u_type>" . _('Simple M3U') . "</option>\n";
- echo "\t<option value=\"pls\" $pls_type>" . _('PLS') . "</option>\n";
- echo "\t<option value=\"asx\" $asx_type>" . _('Asx') . "</option>\n";
- echo "\t<option value=\"ram\" $ram_type>" . _('RAM') . "</option>\n";
- echo "\t<option value=\"xspf\" $xspf_type>" . _('XSPF') . "</option>\n";
+ echo "\t<option value=\"m3u\" $m3u_type>" . T_('M3U') . "</option>\n";
+ echo "\t<option value=\"simple_m3u\" $simple_m3u_type>" . T_('Simple M3U') . "</option>\n";
+ echo "\t<option value=\"pls\" $pls_type>" . T_('PLS') . "</option>\n";
+ echo "\t<option value=\"asx\" $asx_type>" . T_('Asx') . "</option>\n";
+ echo "\t<option value=\"ram\" $ram_type>" . T_('RAM') . "</option>\n";
+ echo "\t<option value=\"xspf\" $xspf_type>" . T_('XSPF') . "</option>\n";
echo "</select>\n";
break;
case 'lang':
@@ -219,7 +219,7 @@ function create_preference_input($name,$value) {
case 'localplay_controller':
$controllers = Localplay::get_controllers();
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"\">" . _('None') . "</option>\n";
+ echo "\t<option value=\"\">" . T_('None') . "</option>\n";
foreach ($controllers as $controller) {
if (!Localplay::is_enabled($controller)) { continue; }
$is_selected = '';
@@ -233,10 +233,10 @@ function create_preference_input($name,$value) {
elseif ($value == '100') { $is_admin = 'selected="selected"'; }
elseif ($value == '50') { $is_manager = 'selected="selected"'; }
echo "<select name=\"$name\">\n";
- echo "<option value=\"0\">" . _('Disabled') . "</option>\n";
- echo "<option value=\"25\" $is_user>" . _('User') . "</option>\n";
- echo "<option value=\"50\" $is_manager>" . _('Manager') . "</option>\n";
- echo "<option value=\"100\" $is_admin>" . _('Admin') . "</option>\n";
+ echo "<option value=\"0\">" . T_('Disabled') . "</option>\n";
+ echo "<option value=\"25\" $is_user>" . T_('User') . "</option>\n";
+ echo "<option value=\"50\" $is_manager>" . T_('Manager') . "</option>\n";
+ echo "<option value=\"100\" $is_admin>" . T_('Admin') . "</option>\n";
echo "</select>\n";
break;
case 'theme_name':
@@ -252,42 +252,42 @@ function create_preference_input($name,$value) {
case 'playlist_method':
${$value} = ' selected="selected"';
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"send\"$send>" . _('Send on Add') . "</option>\n";
- echo "\t<option value=\"send_clear\"$send_clear>" . _('Send and Clear on Add') . "</option>\n";
- echo "\t<option value=\"clear\"$clear>" . _('Clear on Send') . "</option>\n";
- echo "\t<option value=\"default\"$default>" . _('Default') . "</option>\n";
+ echo "\t<option value=\"send\"$send>" . T_('Send on Add') . "</option>\n";
+ echo "\t<option value=\"send_clear\"$send_clear>" . T_('Send and Clear on Add') . "</option>\n";
+ echo "\t<option value=\"clear\"$clear>" . T_('Clear on Send') . "</option>\n";
+ echo "\t<option value=\"default\"$default>" . T_('Default') . "</option>\n";
echo "</select>\n";
break;
case 'bandwidth':
${"bandwidth_$value"} = ' selected="selected"';
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"25\"$bandwidth_25>" . _('Low') . "</option>\n";
- echo "\t<option value=\"50\"$bandwidth_50>" . _('Medium') . "</option>\n";
- echo "\t<option value=\"75\"$bandwidth_75>" . _('High') . "</option>\n";
+ echo "\t<option value=\"25\"$bandwidth_25>" . T_('Low') . "</option>\n";
+ echo "\t<option value=\"50\"$bandwidth_50>" . T_('Medium') . "</option>\n";
+ echo "\t<option value=\"75\"$bandwidth_75>" . T_('High') . "</option>\n";
echo "</select>\n";
break;
case 'features':
${"features_$value"} = ' selected="selected"';
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"25\"$features_25>" . _('Low') . "</option>\n";
- echo "\t<option value=\"50\"$features_50>" . _('Medium') . "</option>\n";
- echo "\t<option value=\"75\"$features_75>" . _('High') . "</option>\n";
+ echo "\t<option value=\"25\"$features_25>" . T_('Low') . "</option>\n";
+ echo "\t<option value=\"50\"$features_50>" . T_('Medium') . "</option>\n";
+ echo "\t<option value=\"75\"$features_75>" . T_('High') . "</option>\n";
echo "</select>\n";
break;
case 'transcode':
${$value} = ' selected="selected"';
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"never\"$never>" . _('Never') . "</option>\n";
- echo "\t<option value=\"default\"$default>" . _('Default') . "</option>\n";
- echo "\t<option value=\"always\"$always>" . _('Always') . "</option>\n";
+ echo "\t<option value=\"never\"$never>" . T_('Never') . "</option>\n";
+ echo "\t<option value=\"default\"$default>" . T_('Default') . "</option>\n";
+ echo "\t<option value=\"always\"$always>" . T_('Always') . "</option>\n";
echo "</select>\n";
break;
case 'show_lyrics':
if ($value == '1') { $is_true = "selected=\"selected\""; }
else { $is_false = "selected=\"selected\""; }
echo "<select name=\"$name\">\n";
- echo "\t<option value=\"1\" $is_true>" . _("Enable") . "</option>\n";
- echo "\t<option value=\"0\" $is_false>" . _("Disable") . "</option>\n";
+ echo "\t<option value=\"1\" $is_true>" . T_("Enable") . "</option>\n";
+ echo "\t<option value=\"0\" $is_false>" . T_("Disable") . "</option>\n";
echo "</select>\n";
break;
default:
diff --git a/lib/rating.lib.php b/lib/rating.lib.php
index 42bd8d59..3323f6e5 100644
--- a/lib/rating.lib.php
+++ b/lib/rating.lib.php
@@ -55,26 +55,26 @@ function get_rating_name($score) {
switch ($score) {
case '0':
- return _("Don't Play");
+ return T_("Don't Play");
break;
case '1':
- return _("It's Pretty Bad");
+ return T_("It's Pretty Bad");
break;
case '2':
- return _("It's Ok");
+ return T_("It's Ok");
break;
case '3':
- return _("It's Pretty Good");
+ return T_("It's Pretty Good");
break;
case '4':
- return _("I Love It!");
+ return T_("I Love It!");
break;
case '5':
- return _("It's Insane");
+ return T_("It's Insane");
break;
// I'm fired
default:
- return _("Off the Charts!");
+ return T_("Off the Charts!");
break;
} // end switch
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 756db2fb..ce0a12ed 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -202,68 +202,68 @@ function get_location() {
switch ($location['page']) {
case 'index.php':
- $location['title'] = _('Home');
+ $location['title'] = T_('Home');
break;
case 'upload.php':
- $location['title'] = _('Upload');
+ $location['title'] = T_('Upload');
break;
case 'localplay.php':
- $location['title'] = _('Local Play');
+ $location['title'] = T_('Local Play');
break;
case 'randomplay.php':
- $location['title'] = _('Random Play');
+ $location['title'] = T_('Random Play');
break;
case 'playlist.php':
- $location['title'] = _('Playlist');
+ $location['title'] = T_('Playlist');
break;
case 'search.php':
- $location['title'] = _('Search');
+ $location['title'] = T_('Search');
break;
case 'preferences.php':
- $location['title'] = _('Preferences');
+ $location['title'] = T_('Preferences');
break;
case 'admin/index.php':
- $location['title'] = _('Admin-Catalog');
+ $location['title'] = T_('Admin-Catalog');
$location['section'] = 'admin';
break;
case 'admin/catalog.php':
- $location['title'] = _('Admin-Catalog');
+ $location['title'] = T_('Admin-Catalog');
$location['section'] = 'admin';
break;
case 'admin/users.php':
- $location['title'] = _('Admin-User Management');
+ $location['title'] = T_('Admin-User Management');
$location['section'] = 'admin';
break;
case 'admin/mail.php':
- $location['title'] = _('Admin-Mail Users');
+ $location['title'] = T_('Admin-Mail Users');
$location['section'] = 'admin';
break;
case 'admin/access.php':
- $location['title'] = _('Admin-Manage Access Lists');
+ $location['title'] = T_('Admin-Manage Access Lists');
$location['section'] = 'admin';
break;
case 'admin/preferences.php':
- $location['title'] = _('Admin-Site Preferences');
+ $location['title'] = T_('Admin-Site Preferences');
$location['section'] = 'admin';
break;
case 'admin/modules.php':
- $location['title'] = _('Admin-Manage Modules');
+ $location['title'] = T_('Admin-Manage Modules');
$location['section'] = 'admin';
break;
case 'browse.php':
- $location['title'] = _('Browse Music');
+ $location['title'] = T_('Browse Music');
$location['section'] = 'browse';
break;
case 'albums.php':
- $location['title'] = _('Albums');
+ $location['title'] = T_('Albums');
$location['section'] = 'browse';
break;
case 'artists.php':
- $location['title'] = _('Artists');
+ $location['title'] = T_('Artists');
$location['section'] = 'browse';
break;
case 'stats.php':
- $location['title'] = _('Statistics');
+ $location['title'] = T_('Statistics');
break;
default:
$location['title'] = '';
@@ -317,7 +317,7 @@ function show_album_select($name='album',$album_id=0,$allow_add=0,$song_id=0) {
if ($allow_add) {
// Append additional option to the end with value=-1
- echo "\t<option value=\"-1\">" . _('Add New') . "...</option>\n";
+ echo "\t<option value=\"-1\">" . T_('Add New') . "...</option>\n";
}
echo "</select>\n";
@@ -397,7 +397,7 @@ function show_catalog_select($name='catalog',$catalog_id=0,$style='') {
function show_user_select($name,$selected='',$style='') {
echo "<select name=\"$name\" style=\"$style\">\n";
- echo "\t<option value=\"\">" . _('All') . "</option>\n";
+ echo "\t<option value=\"\">" . T_('All') . "</option>\n";
$sql = "SELECT `id`,`username`,`fullname` FROM `user` ORDER BY `fullname`";
$db_results = Dba::read($sql);
@@ -424,7 +424,7 @@ function show_user_select($name,$selected='',$style='') {
function show_playlist_select($name,$selected='',$style='') {
echo "<select name=\"$name\" style=\"$style\">\n";
- echo "\t<option value=\"\">" . _('None') . "</option>\n";
+ echo "\t<option value=\"\">" . T_('None') . "</option>\n";
$sql = "SELECT `id`,`name` FROM `playlist` ORDER BY `name`";
$db_results = Dba::read($sql);
@@ -480,7 +480,7 @@ function get_user_icon($name,$title='',$id='') {
$name = $name['0'];
}
- if (!$title) { $title = _(ucfirst($name)); }
+ if (!$title) { $title = T_(ucfirst($name)); }
if ($id) {
$id = ' id="' . $id . '" ';
@@ -747,10 +747,10 @@ function update_text($field, $value) {
function print_bool($value) {
if ($value) {
- $string = '<span class="item_on">' . _('On') . '</span>';
+ $string = '<span class="item_on">' . T_('On') . '</span>';
}
else {
- $string = '<span class="item_off">' . _('Off') . '</span>';
+ $string = '<span class="item_off">' . T_('Off') . '</span>';
}
return $string;