OSDN Git Service

MERGE: リビジョン1813。差分の反映。
authorsakamocchi <o-takashi@sakamocchi.jp>
Wed, 2 May 2012 14:50:15 +0000 (23:50 +0900)
committersakamocchi <o-takashi@sakamocchi.jp>
Wed, 2 May 2012 14:50:15 +0000 (23:50 +0900)
コミット「bf353feef19665dcb79b4d8a5453546abe9391d0」で不十分だった箇所の修正。

Revision 1813:
MERGE: NP_Text is merged into core scripts
<%text%> tag can be now used in every skin and template context and
enable skin translation. If you want to apply your translation file, put
it into "locales" directory in each skin directory. Then Skin::parse()
try to include it according to i18n::get_current_locale() and
i18n::get_current_charset().
http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1813

nucleus/libs/PAGEFACTORY.php
nucleus/libs/SKIN.php
nucleus/libs/globalfunctions.php

index ca3932f..35e325b 100644 (file)
@@ -68,7 +68,6 @@ class PageFactory extends BaseActions
                'jsbuttonbar',
                'jsinput',
                'pluginextras',
-               'text',
                'ticket',
                'title'
        );
@@ -386,26 +385,6 @@ class PageFactory extends BaseActions
        }
        
        /**
-        * PageFactroy::parse_text()
-        * inserts some localized text
-        * 
-        * @param       string  $which
-        * @return      void
-        */
-       public function parse_text($which)
-       {
-               if ( !defined($which) )
-               {
-                       echo $which;
-               }
-               else
-               {
-                       echo constant($which);
-               }
-               return;
-       }
-       
-       /**
         * PageFactory::parse_contents()
         * 
         * @param       string  $which
index b82a1f4..b1c125d 100644 (file)
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2009 The Nucleus Group
- * @version $Id: SKIN.php 1784 2012-04-22 04:28:30Z sakamocchi $
+ * @version $Id: SKIN.php 1813 2012-05-02 14:41:57Z sakamocchi $
  */
 
-if ( !function_exists('requestVar') ) 
+if ( !function_exists('requestVar') )
 {
        exit;
 }
@@ -327,7 +327,7 @@ class Skin
                $manager->notify("Init{$this->event_identifier}Parse", array('skin' => &$this, 'type' => $type));
                
                // include skin locale file for <%text%> tag if useable
-               $this->includeLocaleFile(i18n::get_current_locale());
+               $this->includeTranslation();
                
                // set output type
                sendContentType($this->getContentType(), 'skin');
@@ -563,28 +563,30 @@ class Skin
        }
        
        /**
-        * Skin::includeLocaleFile()
+        * Skin::includeTranslation()
         * 
-        * @param       string  $locale locale name
+        * @param       void
         * @return      void
         */
-       private function includeLocaleFile($locale)
+       private function includeTranslation()
        {
                global $DIR_SKINS;
                
+               $locale = i18n::get_current_locale() . '.' . i18n::get_current_charset();
+               
                if( $this->includeMode == "normal" )
                {
-                       $filename = "./locale/{$locale}.php";
+                       $filename = "./locales/{$locale}.php";
                }
-               elseif( $this->includeMode == "skindir" )
+               else if( $this->includeMode == "skindir" )
                {
                        if ( $this->includePrefix == '' )
                        {
-                               $filename = "{$DIR_SKINS}locale/{$locale}.php";
+                               $filename = "{$DIR_SKINS}locales/{$locale}.php";
                        }
                        else
                        {
-                               $filename = "{$DIR_SKINS}{$this->includePrefix}locale/{$locale}.php";
+                               $filename = "{$DIR_SKINS}{$this->includePrefix}locales/{$locale}.php";
                        }
                }
                else
index 201e0c5..6292e97 100644 (file)
@@ -622,7 +622,7 @@ $manager->notify(
         * @param       string  $locale locale name referring to 'language tags' defined in RFC 5646\r
         * @return      Void\r
         */\r
-       function include_translation($locale)\r
+       function include_translation(&$locale)\r
        {\r
                global $DIR_LOCALES;\r
                \r