Skip to content

Commit

Permalink
Completely deprecates old-school 1.0 language subsystem in favor of e…
Browse files Browse the repository at this point in the history
…xpLang. All $i18n & $_TR variables were replaced with tne newer gt() call. Adds shell for coding for setting the language during install.

[exponentcms#291 state:resolved]
  • Loading branch information
dleffler committed Aug 11, 2011
1 parent d06b2bf commit 46bab8d
Show file tree
Hide file tree
Showing 364 changed files with 1,793 additions and 4,420 deletions.
31 changes: 15 additions & 16 deletions conf/extensions/antispam.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,37 @@
//"custom"=>'Custom' --> THIS MAY BE COOL TO ADD LATER...
);

$i18n = exponent_lang_loadFile('conf/extensions/antispam.structure.php');

return array(
$i18n['title'],
gt('Anti-Spam Measures'),
array(
'SITE_USE_ANTI_SPAM'=>array(
'title'=>$i18n['use_captcha'],
'description'=>$i18n['use_captcha_desc'],
'title'=>gt('Use CAPTCHA Test?'),
'description'=>gt('A CAPTCHA (Computer Automated Public Turing Test to Tell Computers and Humans Apart) is a means to prevent massive account registration. When registering a new user account, the visitor will be required to enter a series of letters and numbers appearing in an image. This prevents scripted bots from registering a large quantity of accounts.'),
'control'=>new checkboxcontrol()
),
'ANTI_SPAM_USERS_SKIP'=>array(
'title'=>$i18n['antispam_users_skip'],
'description'=>$i18n['antispam_users_skip_desc'],
'title'=>gt('Skip using Anti-Spam measures for Logged-In Users?'),
'description'=>gt('If a user is logged-in, do not display anti-spam control.<br />'),
'control'=>new checkboxcontrol()
),
'ANTI_SPAM_CONTROL'=>array(
'title'=>$i18n['antispam_control'],
'description'=>$i18n['antispam_control_desc'],
'title'=>gt('Choose an Anti-Spam Control'),
'description'=>gt('Spam on forms, like comments and contact forms can be a big issue for admins. If you would like to try to combat spam on your site, choose an anti-spam control to use.<br />'),
'control'=>new dropdowncontrol('',$as_types)
),
'RECAPTCHA_THEME'=>array(
'title'=>$i18n['recaptcha_theme'],
'description'=>$i18n['recaptcha_theme'],
'title'=>gt('reCAPTCHA Theme.'),
'description'=>gt('reCAPTCHA Theme.'),
'control'=>new dropdowncontrol('',$as_themes)
),
'RECAPTCHA_PUB_KEY'=>array(
'title'=>$i18n['recaptcha_pub_key'],
'description'=>$i18n['recaptcha_pub_key_desc'],
'title'=>gt('reCAPTCHA Public Key.'),
'description'=>gt('If you are using reCAPTCHA please enter the public key here.'),
'control'=>new textcontrol()
),
'RECAPTCHA_PRIVATE_KEY'=>array(
'title'=>$i18n['recaptcha_private_key'],
'description'=>$i18n['recaptcha_private_key_desc'],
'title'=>gt('reCAPTCHA Private Key.'),
'description'=>gt('If you are using reCAPTCHA please enter the private key here.'),
'control'=>new textcontrol()
),

Expand All @@ -74,7 +72,8 @@

$info = gd_info();
if (!EXPONENT_HAS_GD) {
$stuff[1]['SITE_USE_ANTI_SPAM']['description'] = $i18n['use_captcha_desc'].'<br /><br />'.$i18n['no_gd_support'];
$stuff[1]['SITE_USE_ANTI_SPAM']['description'] = gt('A CAPTCHA (Computer Automated Public Turing Test to Tell Computers and Humans Apart) is a means to prevent massive account registration. When registering a new user account, the visitor will be required to enter a series of letters and numbers appearing in an image. This prevents scripted bots from registering a large quantity of accounts.').'<br /><br />'.
gt('<div class="error">The server\'s version and/or configuration of PHP does not include GD support, so you will not be able to activate or use the CAPTCHA test.</div>');
$stuff[1]['SITE_USE_ANTI_SPAM']['control']->disabled = true;
}

Expand Down
1 change: 0 additions & 1 deletion conf/extensions/avatar.defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#
##################################################

//if (!defined('DEFAULT_AVATAR')) define('DEFAULT_AVATAR', URL_FULL . "framework/modules/users/avatars/avatar_not_found.jpg");
if (!defined('DEFAULT_AVATAR')) define('DEFAULT_AVATAR', URL_FULL . "framework/modules/users/assets/images/avatar_not_found.jpg");


Expand Down
20 changes: 9 additions & 11 deletions conf/extensions/comments.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,27 @@

if (!defined('EXPONENT')) exit('');

$i18n = exponent_lang_loadFile('conf/extensions/comments.structure.php');

return array(
$i18n['title'],
gt('User Comment Policies'),
array(
'COMMENTS_REQUIRE_LOGIN'=>array(
'title'=>$i18n['comments_require_login'],
'description'=>$i18n['comments_require_login_desc'],
'title'=>gt('Require Login to Post Comments'),
'description'=>gt('Checking this option will force user to create an account and be logged in before they can post comments on your site.'),
'control'=>new checkboxcontrol()
),
'COMMENTS_REQUIRE_APPROVAL'=>array(
'title'=>$i18n['comments_require_approval'],
'description'=>$i18n['comments_require_approval_desc'],
'title'=>gt('I Want to Approve All Comments'),
'description'=>gt('If this option is selected, comments will not be published to your site until you approve them.'),
'control'=>new checkboxcontrol()
),
'COMMENTS_REQUIRE_NOTIFICATION'=>array(
'title'=>$i18n['comments_require_notification'],
'description'=>$i18n['comments_require_notification_desc'],
'title'=>gt('Notify Me of New Comments'),
'description'=>gt('An email notification will be sent to the email address specificed below to notify you of new comments on your site.'),
'control'=>new checkboxcontrol()
),
'COMMENTS_NOTIFICATION_EMAIL'=>array(
'title'=>$i18n['comments_require_notification_email'],
'description'=>$i18n['comments_require_notification_email_desc'],
'title'=>gt('Notification Email Address(es) (Enter multiple addresses by using a comma to separate them)'),
'description'=>gt('If you have indicated you would like to be notified of new comments on your site, please enter the email address of all the people you would like to get the notificaiton email addresses.'),
'control'=>new textcontrol()
),
)
Expand Down
36 changes: 17 additions & 19 deletions conf/extensions/database.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,47 @@

if (!defined('EXPONENT')) exit('');

$i18n = exponent_lang_loadFile('conf/extensions/database.structure.php');

return array(
$i18n['title'],
gt('Database Options'),
array(
'DB_ENGINE'=>array(
'title'=>$i18n['db_engine'],
'description'=>$i18n['db_engine_desc'],
'title'=>gt('Backend Software'),
'description'=>gt('The database server software package.'),
'control'=>new dropdowncontrol('',exponent_database_backends())
),
'DB_NAME'=>array(
'title'=>$i18n['db_name'],
'description'=>$i18n['db_name_desc'],
'title'=>gt('Database Name'),
'description'=>gt('The name of the database to store the site tables in.'),
'control'=>new textcontrol()
),
'DB_USER'=>array(
'title'=>$i18n['db_user'],
'description'=>$i18n['db_user_desc'],
'title'=>gt('Username'),
'description'=>gt('The name of the user to connect to the database server as'),
'control'=>new textcontrol()
),
'DB_PASS'=>array(
'title'=>$i18n['db_pass'],
'description'=>$i18n['db_pass_desc'],
'title'=>gt('Password'),
'description'=>gt('Password of the user above.'),
'control'=>new passwordcontrol()
),
'DB_HOST'=>array(
'title'=>$i18n['db_host'],
'description'=>$i18n['db_host_desc'],
'title'=>gt('Server Address'),
'description'=>gt('The domain name or IP address of the database server. If this is a local server, use "localhost"'),
'control'=>new textcontrol()
),
'DB_PORT'=>array(
'title'=>$i18n['db_port'],
'description'=>$i18n['db_port_desc'],
'title'=>gt('Server Port'),
'description'=>gt('The port that the database server runs on. For MySQL, this is 3306.'),
'control'=>new textcontrol()
),
'DB_TABLE_PREFIX'=>array(
'title'=>$i18n['db_table_prefix'],
'description'=>$i18n['db_table_prefix_desc'],
'title'=>gt('Table Prefix'),
'description'=>gt('A prefix to prepend to all table names.'),
'control'=>new textcontrol()
),
'DB_ENCODING'=>array(
'title'=>$i18n['db_encoding'],
'description'=>$i18n['db_encoding_desc'],
'title'=>gt('Database Connection Encoding'),
'description'=>gt('Sets the encoding of a connection. Supported on mySQL higher 4.1.12.'),
'control'=>new dropdowncontrol('', exponent_config_dropdownData('DB_ENCODING'))
)
)
Expand Down
4 changes: 2 additions & 2 deletions conf/extensions/display.defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#
##################################################

if (!defined('DISPLAY_LANGUAGE')) define('DISPLAY_LANGUAGE','en');
if (!defined('SLINGBAR_TOP')) define('SLINGBAR_TOP','1');
//if (!defined('DISPLAY_LANGUAGE')) define('DISPLAY_LANGUAGE','en');
if (!defined('LANGUAGE')) define("LANGUAGE",'English - US');
if (!defined('SLINGBAR_TOP')) define('SLINGBAR_TOP','1');
if (!defined('WRITE_LANG_TEMPLATE')) define('WRITE_LANG_TEMPLATE','0');
if (!defined('DISPLAY_THEME_REAL')) define('DISPLAY_THEME_REAL','retrotheme');
if (!defined('DISPLAY_ATTRIBUTION')) define('DISPLAY_ATTRIBUTION','username');
Expand Down
59 changes: 24 additions & 35 deletions conf/extensions/display.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,73 +39,62 @@
}
uasort($themes,'strnatcmp');

/*
$languages = array();
if (is_readable(BASE.'framework/core/subsystems-1/lang')) {
$lang_dir = opendir(BASE.'framework/core/subsystems-1/lang');
while (($lang_file = readdir($lang_dir)) !== false) {
$lang_file = realpath(BASE.'framework/core/subsystems-1/lang/'.$lang_file);
if (is_readable($lang_file) && is_file($lang_file)) {
$thislang = include($lang_file);
$languages[$thislang['locale']] = $thislang['name'];
}
}
}
$languages = expLang::langList();
ksort($langs);

/*
echo "<xmp>";
print_r($languages);
print_r($themes);
echo "</xmp>";
*/
$i18n = exponent_lang_loadFile('conf/extensions/display.structure.php');

return array(
$i18n['title'],
gt('Display Settings'),
array(
/*'DISPLAY_LANGUAGE'=>array(
'title'=>$i18n['language'],
'description'=>$i18n['language_desc'],
// 'DISPLAY_LANGUAGE'=>array(
'LANGUAGE'=>array(
'title'=>gt('Language'),
'description'=>gt('The language to use.'),
'control'=>new dropdowncontrol(null,$languages)
),
*/
'SLINGBAR_TOP'=>array(
'title'=>$i18n['slingbar_top'],
'description'=>$i18n['slingbar_top_desc'],
'title'=>gt('Slingbar at Top'),
'description'=>gt('Should the slingbar display at the top of the page? Unchecking will place the slingbar at the bottom of the page.'),
'control'=>new checkboxcontrol(false,true)
),
'DISPLAY_THEME_REAL'=>array(
'title'=>$i18n['theme_real'],
'description'=>$i18n['theme_real_desc'],
'title'=>gt('Theme'),
'description'=>gt('The current theme layout'),
'control'=>new dropdowncontrol(null,$themes)
),
'DISPLAY_ATTRIBUTION'=>array(
'title'=>$i18n['attribution'],
'description'=>$i18n['attribution_desc'],
'title'=>gt('Attribution'),
'description'=>gt('How credit is given to authors for their posts.'),
'control'=>new dropdowncontrol(null,array('firstlast'=>'John Doe','lastfirst'=>'Doe, John','first'=>'John','username'=>'jdoe'))
),
'DISPLAY_DATETIME_FORMAT'=>array(
'title'=>$i18n['datetime_format'],
'description'=>$i18n['datetime_format_desc'],
'title'=>gt('Date and Time Format'),
'description'=>gt('Default system-wide date format, displaying both date and time.'),
'control'=>new dropdowncontrol(null,exponent_config_dropdownData('datetime_format'))
),
'DISPLAY_DATE_FORMAT'=>array(
'title'=>$i18n['date_format'],
'description'=>$i18n['date_format_desc'],
'title'=>gt('Date Format'),
'description'=>gt('Default system-wide date format, displaying date only.'),
'control'=>new dropdowncontrol(null,exponent_config_dropdownData('date_format'))
),
'DISPLAY_TIME_FORMAT'=>array(
'title'=>$i18n['time_format'],
'description'=>$i18n['time_format_desc'],
'title'=>gt('Time Format'),
'description'=>gt('Default system-wide date format, displaying time only.'),
'control'=>new dropdowncontrol(null,exponent_config_dropdownData('time_format'))
),
'DISPLAY_START_OF_WEEK'=>array(
'title'=>$i18n['start_of_week'],
'description'=>$i18n['start_of_week_desc'],
'title'=>gt('Start of Week'),
'description'=>gt('Default day to start the week.'),
'control'=>new dropdowncontrol(null,exponent_config_dropdownData('start_of_week'))
),
'DISPLAY_DEFAULT_TIMEZONE'=>array(
'title'=>$i18n['default_timezone'],
'description'=>$i18n['default_timezone_desc'],
'title'=>gt('Default timezone for this site.'),
'description'=>gt('Select the default timezone for this site. CAUTION: This may break calendars and other features that use date functions if you change this after entering data. Must be in a format shown here: <a href="http://www.php.net/manual/en/timezones.php" target="_blank">http://www.php.net/manual/en/timezones.php</a>'),
'control'=>new textcontrol()
)
)
Expand Down
13 changes: 5 additions & 8 deletions conf/extensions/htmltopdf.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@

if (!defined('EXPONENT')) exit('');


$i18n = exponent_lang_loadFile('conf/extensions/htmltopdf.structure.php');

return array(
$i18n['title'],
gt('HtmlToPdf Paths'),
array(
'HTMLTOPDF_PATH'=>array(
'title'=>$i18n['htmltopdf_path'],
'description'=>$i18n['htmltopdf_path_desc'],
'title'=>gt('HTML to PDF Path'),
'description'=>gt('The actual path of the binary html to pdf library'),
'control'=>new textcontrol()
),
'HTMLTOPDF_PATH_TMP'=>array(
'title'=>$i18n['htmltopdf_tmp'],
'description'=>$i18n['htmltopdf_tmp_desc'],
'title'=>gt('Html to PDF Tmp Directory'),
'description'=>gt('The tmp directory to be used by htmltopdf library'),
'control'=>new textcontrol()
)
)
Expand Down
24 changes: 11 additions & 13 deletions conf/extensions/ldap.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,32 @@

if (!defined('EXPONENT')) exit('');

$i18n = exponent_lang_loadFile('conf/extensions/ldap.structure.php');

return array(
$i18n['title'],
gt('LDAP Authentication Options'),
array(
'USE_LDAP'=>array(
'title'=>$i18n['use_ldap'],
'description'=>$i18n['use_ldap_desc'],
'title'=>gt('Turn on LDAP Authentication'),
'description'=>gt('Checking this option will cause Exponent to try to authenticate to the ldap server listed below.'),
'control'=>new checkboxcontrol()
),
'LDAP_SERVER'=>array(
'title'=>$i18n['ldap_server'],
'description'=>$i18n['ldap_server_desc'],
'title'=>gt('LDAP Server'),
'description'=>gt('Enter the hostname or IP of the LDAP server.'),
'control'=>new textcontrol()
),
'LDAP_BASE_DN'=>array(
'title'=>$i18n['ldap_base_dn'],
'description'=>$i18n['ldap_base_dn_desc'],
'title'=>gt('Base DN'),
'description'=>gt('Enter the Base context for this LDAP connection.'),
'control'=>new textcontrol()
),
'LDAP_BIND_USER'=>array(
'title'=>$i18n['ldap_bind_user'],
'description'=>$i18n['ldap_bind_user_desc'],
'title'=>gt('LDAP Bind User'),
'description'=>gt('The username or context for the binding to the LDAP Server to perform administration tasks(This currently doesn\'t do anything.)'),
'control'=>new textcontrol()
),
'LDAP_BIND_PASS'=>array(
'title'=>$i18n['ldap_bind_pass'],
'description'=>$i18n['ldap_bind_pass_desc'],
'title'=>gt('LDAP Password'),
'description'=>gt('Enter the password for the username/context listed above.'),
'control'=>new passwordcontrol()
)
)
Expand Down
18 changes: 8 additions & 10 deletions conf/extensions/maint.structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,23 @@

if (!defined('EXPONENT')) exit('');

$i18n = exponent_lang_loadFile('conf/extensions/maint.structure.php');

return array(
$i18n['title'],
gt('Site Maintenance Settings'),
array(
'MAINTENANCE_MODE'=>array(
'title'=>$i18n['maint_mode'],
'description'=>$i18n['maint_mode_desc'],
'title'=>gt('Maintenance Mode?'),
'description'=>gt('Whether or not the site is in maintenance mode. While in maintenance mode, only administrators and acting administrators will be allowed to login.'),
'control'=>new checkboxcontrol(false,true)
),
'MAINTENANCE_MSG_HTML'=>array(
'title'=>$i18n['maint_msg'],
'description'=>$i18n['maint_msg_desc'],
'title'=>gt('Maintenance Mode Message'),
'description'=>gt('A message to display to all non-administrators visiting the site.'),
'control'=>new htmleditorcontrol()
),
'DEVELOPMENT'=>array(
'title'=>exponent_lang_getText('Enable Error Reporting'),
'description'=>exponent_lang_getText('This option enables error reporting. This is useful for developement, but should be turned off for a live site.'),
'control'=>new checkboxcontrol(false,true)
'title'=>gt('Enable Error Reporting'),
'description'=>gt('This option enables error reporting. This is useful for developement, but should be turned off for a live site.'),
'control'=>new checkboxcontrol(false,true)
),
)
);
Expand Down
Loading

0 comments on commit 46bab8d

Please sign in to comment.