');
define('_HEADER11', 'ã¦ã§ããµã¤ãã®ç¢ºèª');
diff --git a/nucleus/documentation/devdocs/plugins.html b/nucleus/documentation/devdocs/plugins.html
index 0abaf3a..bcc0c16 100644
--- a/nucleus/documentation/devdocs/plugins.html
+++ b/nucleus/documentation/devdocs/plugins.html
@@ -2197,16 +2197,16 @@ Thanks to Andy Matsubara for the instructions.
Develop your plugin
-At first, it is easier to develop it in your language. Use of language files is recommended after the plugin becomes stable.
+At first, it is easier to develop it in your language. Use of translation files is recommended after the plugin becomes stable.
Create plugin directory
If your plugin name is NP_AbcDef, the plugin directory name is abcdef (always lower case).
-
Create language files
+
Create translation files
-Create the language files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus language file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).
+Create the translation files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus language file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).
Define strings
-Define strings like below in the language file:
+Define strings like below in the translation file:
<?php
define('_ABCDEF_MESSAGENAME', 'actual strings in the language');
@@ -2216,13 +2216,13 @@ define('_ABCDEF_MESSAGENAME', 'actual strings in the language')
You have to define them for all static strings in your plugin. As defined name is used globally in the environment, it is recommended to have a prefix derived from the plugin name(in this case _ABCDEF).
Replace static strings
-Replace static strings in your plugin with the defined names so they will change according to the language file.
+Replace static strings in your plugin with the defined names so they will change according to the translation file.
Create init method
Make the init method in the plugin like below
function init() {
- // include language file for this plugin
+ // include translation file for this plugin
$language = preg_replace( '#[\\|/]#', '', getLanguageName());
if (file_exists($this->getDirectory().$language.'.php'))
include_once($this->getDirectory().$language.'.php');
@@ -2230,8 +2230,8 @@ Make the init method in the plugin like below
include_once($this->getDirectory().'english.php');
}
-This logic is same as Nucleus' language file setting.
-
Add language files
+This logic is same as Nucleus' translation file setting.
+
Add translation files
As English is the default language, it is recommended to have at least the English version.
diff --git a/nucleus/documentation/devdocs/sqltables.html b/nucleus/documentation/devdocs/sqltables.html
index cf95f07..4ae3389 100644
--- a/nucleus/documentation/devdocs/sqltables.html
+++ b/nucleus/documentation/devdocs/sqltables.html
@@ -551,10 +551,10 @@ This document contains information on the fields inside the Nucleus database tab
A copy of the key that is stored in the users cookie. This key is used to log on. When a member logs on, a random cookiekey is generated. One copy goes into the database, another one goes into a cookie on the users computer. (together with the username).
-
deflang
+
mlocale
varchar(20)
''
-
Language file to use for this member. When empty, uses the default site language.
+
translation file to use for this member. When empty, uses the default site locale.
@@ -994,9 +994,9 @@ This document contains information on the fields inside the Nucleus database tab
URL of website. Should end with a slash.
-
Language
-
english
-
Language file to use by default. A file languagename.php must exist in the languages directory.
+
Locale
+
en_Latn_US
+
Locale file to use by default. A file localename.php must exist in the locale directory.
SessionCookie
0
diff --git a/nucleus/documentation/help.html b/nucleus/documentation/help.html
index 1a3ebcd..b4ee7bc 100644
--- a/nucleus/documentation/help.html
+++ b/nucleus/documentation/help.html
@@ -322,7 +322,7 @@ Next to that, logged in members can override this setting if they want to.
When both of these settings are invalid, 'english' is used as the default language.
-
Note: Extra language files can be downloaded from the Nucleus Website. (opens a new window)
+
Note: Extra translation files can be downloaded from the Nucleus Website. (opens a new window)
@@ -2302,7 +2302,7 @@ all
Skinvar: charset
-
Inserts the character set encoding used by the current language file.
+
Inserts the character set encoding used by the current translation file.
FIXED: Reduce PHP Notices caused by undefined variables and wrong offsets (shizuki, kaigreve)
-
FIXED: additional changes in the language files english.php and english-utf8.php to reflect modifications since version 3.30 (kaigreve)
+
FIXED: additional changes in the translation files english.php and english-utf8.php to reflect modifications since version 3.30 (kaigreve)
FIXED: SQL error in MEMBER::write() where mautosave not forced to be integer. See Problem with 3.40. (ftruscot)
-
CHANGED: Modify Fix SQL error when new blog add by shizuki, to give a default english value for category name, category desc, first item title, and first item body in case where user does not have updated language file. (ftruscot)
+
CHANGED: Modify Fix SQL error when new blog add by shizuki, to give a default english value for category name, category desc, first item title, and first item body in case where user does not have updated translation file. (ftruscot)
FIXED: Fix SQL Error when new blog add. (shizuki)
CHANGED: Mod Change link URI of 'help icon' to full URI (documentation/help.html to $CONF['AdminURL'].'documentation/help.html') (shizuki)
ADDED: getTeamBlogs() method to MEMBER class to retrieve list of blogs to which a member has team rights (ftruscot)
@@ -257,7 +257,7 @@
FIXED: add default values for the parse_bloglist function to avoid warnings (kaigreve)
FIXED: fix case sensitive function name createDraftFromRequest in class ACTION (admun)
ADDED: add description of the doItemVar function to the plugin documentation (kaigreve)
-
ADDED: add language file install_lang_english.php to install process (admun)
+
ADDED: add translation file install_lang_english.php to install process (admun)
ADDED: add option to install NP_Ping during installation (admun)
FIXED: remove bug in the plugin api: function clearOptionValueCache hasn't worked correct with the getOption function (kaigreve)
ADDED: add global configuration DebugVars which decides if unresolved Vars (SkinVars, TemplateVars, ItemVars) are shown on the blog (kaigreve)
@@ -372,7 +372,7 @@
FIXED (#88): PHP5.1: "Fatal error: Only variables can be passed by reference" (karma)
FIXED (#87): Translate & -> & when links added via toolbar (karma)
FIXED (#42): formatDate didn't always use the correct timezone (karma)
-
FIXED (#43): Only load user language file when logged in (karma).
+
FIXED (#43): Only load user translation file when logged in (karma).
FIXED (#76): Disabling site blocked admin menu access (karma).
FIXED (#57): PostRegister event not fired from inside admin area.
FIXED (#58): images and popups were not in feeds. (karma)
@@ -412,7 +412,7 @@
FIXED: In v3.15, deleting an item via the bookmarklet failed (karma)
ADDED: Support for <%blogsetting(short)%>, as suggested by caw (karma)
FIXED: Default skin used application/xml+rss instead of application/rss+xml, causing RSS autodiscovery to fail. (karma)
-
FIXED: Moved more hardcoded text into language files
+
FIXED: Moved more hardcoded text into translation files
FIXED: Made it so malicious users cannot trick a logged in site member/admin into visiting a specifically crafted URL that performs some admin area task. (karma).
FIXED: bug 976777, weblogs.com was not ping when posting draft (admun)
ADDED: bug 1008171, cookie-prefix (karma)
@@ -473,7 +473,7 @@
FIXED: bug 967580, Class variables were not explicitly defined in PHP classes (karma)
FIXED: IE6 unreadable Admin menu textarea (admun)
FIXED: Skin exports for skins containing CDATA sections (like the RSS feeds) caused the skinbackup.xml to contain invalid XML. (Import still worked, however) (karma)
-
FIXED: German language file wrong translation (admun)
+
FIXED: German translation file wrong translation (admun)
CHANGED: replaced split by preg_split in the parser class. Should be faster according to PHP docs (karma)
CHANGED: Allowed skin names to have slashes (/) in them (karma)
FIXED: When adding media in non-IE browsers, all text was removed
FIXED: Wrong times displayed / 'no such item' errors when MySQL server and PHP server are in different timezones (karma)
-
ADDED: Made sure language files for v2.5beta can be used with v2.5final without strange strings (e.g. _SETTINGS_EXTAUTH) showing up in the admin area (karma)
+
ADDED: Made sure translation files for v2.5beta can be used with v2.5final without strange strings (e.g. _SETTINGS_EXTAUTH) showing up in the admin area (karma)
FIXED: No CSS styles were applied on 'insert media' popup (karma)
FIXED: Some more possible problems with URL linking in comments (karma)
FIXED: In Opera, buttons on the extended area added text to the main body text instead (karma)
@@ -705,7 +705,7 @@
FIXED: shortening of strings does not corrupt HTML entities anymore (e.g. in RSS-feeds)
CHANGED: links in comments are now handled differently. Part of the URL is now displayed instead of just http://.../
ADDED: Opera version of bookmarklet
-
ADDED: selectLanguage() function to force the use of a certain language file
+
ADDED: selectLanguage() function to force the use of a certain translation file
REMOVED: there was a plugin event AddItem which was actually not needed at all (wasn't included in the documentation too)
ADDED: archivelist skinvars now takes an extra limit-parameter
CHANGED: moved all forms which can be included through skinvar out of SKIN.php and into .template files in the nucleus/forms directory.
@@ -820,7 +820,7 @@
Changed all references to nucleus.demuynck.org into references to nucleuscms.org
Extra settings: cookie domain, cookie path, secure cookie (for https)
Instead of stripping tags in comments, < and > are now replaced by their entities (< and >). This way, greater than and lower than signs can be used in comments (inspiration by Steven Verbruggen)
-
Added charset to language files, so international character sets can be used when needed (forum)
+
Added charset to translation files, so international character sets can be used when needed (forum)
Added an extra content-type attribute to skins, so the output type can be set correctly by Nucleus
Removed the 'headlines' skin and templates. Don't want new users to get too confused.
Notification emails now also get the senders display name
@@ -851,7 +851,7 @@
Fixes in default skin
As always, lots of small fixes & code rewrites
- Changes (additions to and deletions from) language file:
+ Changes (additions to and deletions from) translation file:
_SETTINGS_COOKIES_TITLE
_SETTINGS_COOKIEDOMAIN
@@ -864,7 +864,7 @@
_MEMBERS_USESITELANG
_ADD_CATEGORY
_ADD_DRAFTNFUTURE
-
_ERROR_NOSUCHLANGUAGE
+
_ERROR_NOSUCHTRANSLATION
_ERROR_NOSUCHCATEGORY
_ERROR_DELETEDEFCATEGORY
_ERROR_DELETELASTCATEGORY
@@ -923,7 +923,7 @@
Added: Blogger Convert
Added: "shared computer" checkbox on login. Checking this box will make your cookie expire at the end of the session (instead of taking the global site setting) (see forum)
Added: "remember me" checkbox on comment forms for non-members
-
Most language related things are now moved to language files. Now you can roll your own :)
+
Most language related things are now moved to translation files. Now you can roll your own :)
Added: optional parameters rows/cols in membermailform skinvar
Added: skinvars: <%phpinclude(file)%> and <%parsedinclude(file)%>. <%plugin%> is now deprecated (in favor of phpinclude). The plugins directory should also not be used anymore (it'll get another function in a later version)
Added: skinvar <%self%> which includes the filename of the currently executing script (index.php or whatever is sen in $CONF['Self'])
diff --git a/nucleus/documentation/index.html b/nucleus/documentation/index.html
index 13f6b02..641725b 100644
--- a/nucleus/documentation/index.html
+++ b/nucleus/documentation/index.html
@@ -312,7 +312,7 @@ The available calls to the interface are described in the development documentat
I get an error: Cannot send headers. Headers already sent...
-This problem is usually caused by whitespace at the beginning or end of config.php. Check if it has spaces or newlines before the starting <? or after the ending ?>. If there are, remove them. The problem can also have to do with spaces in the language file or one of the installed plugins.
+This problem is usually caused by whitespace at the beginning or end of config.php. Check if it has spaces or newlines before the starting <? or after the ending ?>. If there are, remove them. The problem can also have to do with spaces in the translation file or one of the installed plugins.
@@ -397,7 +397,7 @@ File permissions need to be set correctly in order for the update file to work.
Jeff MacMichael (NP_SkinFiles plugin)
Ivan Fong, Roel, Moraes, Hcgtv (Nucleus 3.2 default skin)
diff --git a/nucleus/libs/ADMIN.php b/nucleus/libs/ADMIN.php
index 33a04b3..061eadb 100644
--- a/nucleus/libs/ADMIN.php
+++ b/nucleus/libs/ADMIN.php
@@ -1883,11 +1883,11 @@ class ADMIN
-
+
-
-
+
-
+
updateConfig('PluginURL', postVar('PluginURL'));
$this->updateConfig('SkinsURL', postVar('SkinsURL'));
$this->updateConfig('ActionURL', postVar('ActionURL'));
- $this->updateConfig('Language', postVar('Language'));
+ $this->updateConfig('Locale', postVar('Locale'));
$this->updateConfig('AdminEmail', postVar('AdminEmail'));
$this->updateConfig('SessionCookie', postVar('SessionCookie'));
$this->updateConfig('AllowMemberCreate',postVar('AllowMemberCreate'));
@@ -5079,7 +5079,7 @@ selector();
$this->updateConfig('DefaultListSize', postVar('DefaultListSize'));
$this->updateConfig('AdminCSS', postVar('AdminCSS'));
- // load new config and redirect (this way, the new language will be used is necessary)
+ // load new config and redirect (this way, the new locale will be used is necessary)
// note that when changing cookie settings, this redirect might cause the user
// to have to log in again.
getConfig();
diff --git a/nucleus/libs/MEMBER.php b/nucleus/libs/MEMBER.php
index e39a648..5c35dca 100644
--- a/nucleus/libs/MEMBER.php
+++ b/nucleus/libs/MEMBER.php
@@ -155,10 +155,7 @@ class MEMBER {
$this->id = $obj->mnumber;
$this->setCanLogin($obj->mcanlogin);
$this->setNotes($obj->mnotes);
- /*
- * FIXME: the name of this field should be 'mlocale', not deflang.
- */
- $this->setLocale($obj->deflang);
+ $this->setLocale($obj->mlocale);
$this->setAutosave($obj->mautosave);
return sql_num_rows($res);
@@ -550,8 +547,8 @@ class MEMBER {
. " madmin=" . $this->isAdmin() . ","
. " mnotes='" . sql_real_escape_string($this->getNotes()) . "',"
. " mcanlogin=" . $this->canLogin() . ","
- . " deflang='" . sql_real_escape_string($this->getLocale()) . "',"
- . " mautosave=" . intval($this->getAutosave()) . ""
+ . " mlocale='" . sql_real_escape_string($this->getLocale()) . "',"
+ . " mautosave=" . intval($this->getAutosave()) . ""
. " WHERE mnumber=" . $this->getID();
sql_query($query);
return;
diff --git a/nucleus/libs/globalfunctions.php b/nucleus/libs/globalfunctions.php
index 1844fc5..17a409e 100644
--- a/nucleus/libs/globalfunctions.php
+++ b/nucleus/libs/globalfunctions.php
@@ -38,39 +38,44 @@ else
}
/*
+ * FIXME: This is for compatibility since 4.0, should be obsoleted at future release.
+ */
+if ( !isset($DIR_LOCALES) )
+{
+ $DIR_LOCALES = $DIR_LANG;
+}
+
+/*
* load and initialize i18n class
*/
if (!class_exists('i18n', FALSE))
{
include($DIR_LIBS . 'i18n.php');
}
-if ( !i18n::init('UTF-8', $DIR_LANG) )
+if ( !i18n::init('UTF-8', $DIR_LOCALES) )
{
exit('Fail to initialize i18n class.');
}
/*
- * FIXME: This is for compatibility, should be obsoleted near future.
+ * FIXME: This is for compatibility since 4.0, should be obsoleted at future release.
*/
define('_CHARSET', i18n::get_current_charset());
/*
- Indicates when Nucleus should display startup errors. Set to 1 if you want
- the error enabled (default), false otherwise
-
- alertOnHeadersSent
- Displays an error when visiting a public Nucleus page and headers have
- been sent out to early. This usually indicates an error in either a
- configuration file or a language file, and could cause Nucleus to
- malfunction
- alertOnSecurityRisk
- Displays an error only when visiting the admin area, and when one or
- more of the installation files (install.php, install.sql, upgrades/
- directory) are still on the server.
-*/
-
-if ( !isset($CONF['alertOnHeadersSent'])
- || (isset($CONF['alertOnHeadersSent'])
- && $CONF['alertOnHeadersSent'] !== 0) )
+ * Indicates when Nucleus should display startup errors. Set to 1 if you want
+ * the error enabled (default), false otherwise
+ *
+ * alertOnHeadersSent
+ * Displays an error when visiting a public Nucleus page and headers have
+ * been sent out to early. This usually indicates an error in either a
+ * configuration file or a translation file, and could cause Nucleus to
+ * malfunction
+ * alertOnSecurityRisk
+ * Displays an error only when visiting the admin area, and when one or
+ * more of the installation files (install.php, install.sql, upgrades/
+ * directory) are still on the server.
+ */
+if ( !array_key_exists('alertOnHeadersSent', $CONF) || $CONF['alertOnHeadersSent'] !== 0) )
{
$CONF['alertOnHeadersSent'] = 1;
}
@@ -115,7 +120,7 @@ if ( !isset($CONF['installscript']) )
}
/* we will use postVar, getVar, ... methods instead of $_GET, $_POST ...*/
-if ($CONF['installscript'] != 1)
+if ( $CONF['installscript'] != 1 )
{
/* vars were already included in install.php */
include_once($DIR_LIBS . 'vars4.1.0.php');
@@ -185,7 +190,7 @@ if ( version_compare(PHP_VERSION, '5.3.0', '<') )
}
/* Avoid notices */
-if ( !isset($CONF['UsingAdminArea']) )
+if ( !array_key_exists('UsingAdminArea', $CONF) )
{
$CONF['UsingAdminArea'] = 0;
}
@@ -228,17 +233,22 @@ getConfig();
* Here simply convert old name to new name without checking translation file existance
* FIXME: This is for compatibility, should be obsoleted near future.
*/
-if ( !preg_match('#^(.+)_(.+)_(.+)$#', $CONF['Language'])
- && ($CONF['Language'] = i18n::convert_old_language_file_name_to_locale($CONF['Language'])) === FALSE )
+if ( !array_key_exists('Locale', $CONF) )
{
- $CONF['Language'] = '';
+ $CONF['Locale'] =& $CONF['Language'];
}
-$locale = $CONF['Language'];
+
+if ( !preg_match('#^(.+)_(.+)_(.+)$#', $CONF['Locale'])
+ && ($CONF['Locale'] = i18n::convert_old_language_file_name_to_locale($CONF['Language'])) === FALSE )
+{
+ $CONF['Locale'] = '';
+}
+$locale = $CONF['Locale'];
/* Properly set $CONF['Self'] and others if it's not set...
* usually when we are access from admin menu
*/
-if ( !isset($CONF['Self']) )
+if ( !array_key_exists('Self', $CONF) )
{
$CONF['Self'] = $CONF['IndexURL'];
/* strip trailing */
@@ -260,7 +270,7 @@ $CONF['CategoryURL'] = $CONF['Self'];
*switch URLMode back to normal when $CONF['Self'] ends in .php
* this avoids urls like index.php/item/13/index.php/item/15
*/
-if ( !isset($CONF['URLMode'])
+if ( !array_key_exists('URLMode', $CONF)
|| (($CONF['URLMode'] == 'pathinfo')
&& (i18n::substr($CONF['Self'], i18n::strlen($CONF['Self']) - 4) == '.php')) )
{
@@ -279,7 +289,7 @@ if ( ($CONF['DisableJsTools'] == 0)
$member = new MEMBER();
/* secure cookie key settings (either 'none', 0, 8, 16, 24, or 32) */
-if ( !isset($CONF['secureCookieKey']) )
+if ( !array_key_exists('secureCookieKey', $CONF) )
{
$CONF['secureCookieKey'] = 24;
}
@@ -301,7 +311,7 @@ switch( $CONF['secureCookieKey'] )
$CONF['secureCookieKeyIP'] = '';
}
-/*
+/*
* login/logout when required or renew cookies
* and decide locale on this session before plugin event generates
*/
@@ -320,7 +330,7 @@ if ( $action == 'login' )
$member->newCookieKey();
$member->setCookies($shared);
- if ( $CONF['secureCookieKey']!=='none' )
+ if ( $CONF['secureCookieKey'] !== 'none' )
{
/* secure cookie key */
$member->setCookieKey(md5($member->getCookieKey().$CONF['secureCookieKeyIP']));
@@ -488,8 +498,8 @@ if ( !headers_sent() )
/*
Backed out for now: See http://forum.nucleuscms.org/viewtopic.php?t=3684 for details
-// To remove after v2.5 is released and language files have been updated.
-// Including this makes sure that language files for v2.5beta can still be used for v2.5final
+// To remove after v2.5 is released and translation files have been updated.
+// Including this makes sure that translation files for v2.5beta can still be used for v2.5final
// without having weird _SETTINGS_EXTAUTH string showing up in the admin area.
if (!defined('_MEMBERS_BYPASS'))
{
@@ -1091,7 +1101,7 @@ function selector() {
}
startUpError(
- '