
 
 D . J . ( p h p p p )   h t t p : / / x o o p s . o r g . c n 
 
 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 x l a n g u a g e ,   e X t e n s i b l e   X o o p s   M u l t i l i n g u a l   C o n t e n t   a n d   E n c o d i n g   M a n a g e m e n t   
 
 
 
 
 
 A p p l i c a b l e 
 
 - - - - - - - - - 
 
 A n y   v e r s i o n   o f   X O O P S   a n d   a n y   v e r s i o n   o f   a n y   M O D U L E   w i t h   a n y   T H E M E . 
 
 N E W   i n   3 . 0 2   f o r   X O O P S   2 . 4 . 0 :   n o   h a c k s   o f   a p i . p h p   n e e d e d   a n y m o r e   
 
 
 
 
 
 E a s y   t o   u s e 
 
 - - - - - - - - - - - 
 
 1   A l l   y o u   n e e d   d o   i s   t o   i n s e r t   O N L Y   O N E   L I N E   i n t o   c o m m o n . p h p   a n d   i n s t a l l   " x l a n g u a g e " 
 
 2   D o   N O T   n e e d   t o   m o d i f y / h a c k   a n y   o t h e r   X O O P S   c o r e   f i l e s   o r   a n y   m o d u l e 
 
 
 
 
 
 P o w e r f u l   e n o u g h   t o   m e e t   y o u r   r e q u i r e m e n t s 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 1   C o u l d   h a n d l e   a s   m a n y   l a n g u a g e s   o f   c o n t e n t   a s   y o u   w a n t 
 
 2   C o u l d   h a n d l e   d i f f e r e n t   c h a r s e t   o f   a   s e l e c t e d   l a n g u a g e 
 
 3   C o u l d   h a n d l e   m u l t i l i n g u a l   c o n t e n t   a n y w h e r e   o n   y o u r   s i t e ,   i n   a   m o d u l e ,   a   p h p   f i l e ,   a n   h t m l   p a g e   o r   a   t h e m e ' s   h a r d c o d e d   c o n t e n t 
 
 4   C o m p a t i b l e   w i t h   c o n t e n t   c a c h e 
 
 5   A u t o m a t i c   d e t e c t i o n   o f   u s e r   b r o w s e r ' s   l a n g u a g e   p r e f e r e n c e 
 
 
 
 
 
 O(ucWS
 
 - - - - - - - - - - 
 
 1   	cck8^!j_Tek_[݈  " x l a n g u a g e " 
 
 
 
 2   (WX O O P S / i n c l u d e / c o m m o n . p h p -NceQ NL  ( S	g  X O O P S   2 . 4 . 0   KNMRHr,g -[) 
 
 	 	 i n c l u d e _ o n c e   X O O P S _ R O O T _ P A T H . ' / m o d u l e s / x l a n g u a g e / a p i . p h p ' ; 
 
 	 MOn(WNRgQ[KNMR  
 
 	         / /   # # # # # # # # # # # # # # # # # # # #   I n c l u d e   s i t e - w i d e   l a n g   f i l e   # # # # # # # # # # # # # # # # # # 
 
 	         i f   (   f i l e _ e x i s t s ( X O O P S _ R O O T _ P A T H . " / l a n g u a g e / " . $ x o o p s C o n f i g [ ' l a n g u a g e ' ] . " / g l o b a l . p h p " )   )   { 
 
 	                 i n c l u d e _ o n c e   X O O P S _ R O O T _ P A T H . " / l a n g u a g e / " . $ x o o p s C o n f i g [ ' l a n g u a g e ' ] . " / g l o b a l . p h p " ; 
 
 	         }   e l s e   { 
 
 	                 i n c l u d e _ o n c e   X O O P S _ R O O T _ P A T H . " / l a n g u a g e / e n g l i s h / g l o b a l . p h p " ; 
 
 	         } 
 
   
 
   3   O9e  l a n g u a g e / s c h i n e s e / g l o b a l . p h p   ( Yg/fckԚ-Neˊ
\aO9el a n g u a g e / t c h i n e s e / g l o b a l . p h p ) 
 
 	 / / % % % % % 	 	 L A N G U A G E   S P E C I F I C   S E T T I N G S       % % % % % 
 
 	 / / d e f i n e ( ' _ C H A R S E T ' ,   ' G B 2 3 1 2 ' ) ; 
 
 	 / / d e f i n e ( ' _ L A N G C O D E ' ,   ' z h - C N ' ) ; 
 
 	 d e f i n e ( ' _ C H A R S E T ' ,   e m p t y ( $ x l a n g u a g e [ " c h a r s e t " ] ) ? ' G B 2 3 1 2 ' : $ x l a n g u a g e [ " c h a r s e t " ] ) ; 
 
 	 d e f i n e ( ' _ L A N G C O D E ' ,   e m p t y ( $ x l a n g u a g e [ " c o d e " ] ) ? ' z h - C N ' : $ x l a n g u a g e [ " c o d e " ] ) ; 
 
 	 $ x l a n g u a g e [ ' c h a r s e t _ b a s e ' ]   =   " g b 2 3 1 2 " ; 
 
         
 
 4   x[W,g|  ( _SxnU-Nxd) &NXR^8O|  ( YgW,g|pckԚ-Neˊ\NRgQ[-Nv!|Ԛ/ ckԚ0s c h i n e s e / t c h i n e s e 0g b 2 3 1 2 / b i g 5 0z h - C N / z h - T W 
\) 
 
 	 kYYg(WNN~^.z|( b}x) KNRc:   񂞊,   !|Ԛ-Ne( g b 2 3 1 2 ) ,   ckԚ-Ne( b i g 5 )   T  U T F - 8   -Ne
 
 	 GR x[W,g|(  x[`OvX O O P S ]}	ge n g l i s h Ts c h i n e s e iQP|S) : 
 
 	 1 :   	 
T1z:   e n g l i s h ;   	 	 c( Sx) :   񂞊;   	 	 	 }x:   i s o - 8 8 5 9 - 1 ;   	 |Nx:   e n   ( bvQNNUOW[kkY  " x e n " ,   &N
N/fwckv|Nx,   S(uOjeRvgQ[) 
 
 	 2 :   	 
T1z:   s c h i n e s e ;   	 c( Sx) :   !|Ԛ-Ne;   	 	 }x:   g b 2 3 1 2 ;   	 	 |Nx:   z h   ( bvQNNUOW[kkY  " s c " ,   &N
N/fwckv|Nx,   S(uOj-NeRvgQ[) 
 
 	 6q_XRWe!|Ԛ-Nev^8O|( \gqK_gQ[gR_!|Ԛ-NeIc) : 
 
 	 1 :   	 
T1z:   t c h i n e s e ;   	 c( Sx) :   ckԚ-Ne;   	 	 }x:   b i g 5 ;   	 	 |Nx:   z h - T W   ( ckԚ-Nevwckv|Nx) 
 
 	 2 :   	 
T1z:   u t f 8 ;   	 	 c( Sx) :   U T F 8 -Ne;   	 	 }x:   u t f - 8   ;   	 	 |Nx:   z h - C N   ( !|Ԛ-Nevwckv|Nx) 
 
 
 
 5   (W@SJX{tgQ\" |xd" @SJX-[pS
 
 
 
 6   (W`Ov!jD}gQ[-Nb/f!jg/ HOof-NXRY|gQ[O(uek_4 -N[v|Nx\vagQ[SwO  [ Yg`O
NO(uY|gQ[Rc/fS(ueckԚ!|ԚRIcGRN Nek] :   
 
 	 [ l a n g c o d e 1 ] C o n t e n t   o f   t h e   l a n g u a g e 1 [ / l a n g c o d e 1 ]   [ l a n g c o d e 2 ] C o n t e n t   o f   t h e   l a n g u a g e 2 [ / l a n g c o d e 2 ]   [ l a n g c o d e 3 ] C o n t e n t   o f   t h e   l a n g u a g e 3 [ / l a n g c o d e 3 ]   . . . 
 
 	 YggNgQ[piQ.zN
N|qQ	g,   `OSNO(uR&{" | " O[qQNvgQ[: 	 
 
 	 [ l a n g c o d e 1 | l a n g c o d e 2 ] C o n t e n t   s h a r e d   b y   l a n g u a g e 1 & 2 [ / l a n g c o d e 1 | l a n g c o d e 2 ]   [ l a n g c o d e 3 ] C o n t e n t   o f   t h e   l a n g u a g e 3 [ / l a n g c o d e 3 ]   . . . 
 
 	 
 
 	 [OP[  ( GP[ek_4 -N-[v|NxR%R/f:   񂞊- e n ;   l- f r ;   !|Ԛ-Ne- s c ) : 
 
 	 [ e n ] M y   X O O P S [ / e n ] [ f r ] M o i   X O O P S [ / f r ] [ s c ] bvX O O P S [ / s c ] 
 
 	 b: 
 
 	 [ e n g l i s h | f r e n c h ] T h i s   i s   m y   c o n t e n t   i n   E n g l i s h   a n d   F r e n c h [ / e n g l i s h | f r e n c h ] [ s c h i n e s e ] -NegQ[[ / s c h i n e s e ] 
 
 
 
 7   x l a n g u a g e \R\gQ[(WT^8O|KNIc  [ [
N(W Nek`O
N NUOd\O] 
 
 
 
 8   dS|xd!jD}KNYYg`O`(WHOofb/f!jg-NXR|RcvcN: 
 
 	 1 )   O9e  / m o d u l e s / x l a n g u a g e / a p i . p h p   " $ x l a n g u a g e _ t h e m e _ e n a b l e   =   t r u e ; " 
 
 	 2 )   -[Sxe  " $ o p t i o n s   =   a r r a y ( " i m a g e s " ,   "   " ,   5 ) ;   / /   o:y!j_,   R&{,   k NLxev" ; 
 
 	 3 )   \  " < { $ s m a r t y . c o n s t . X L A N G U A G E _ S W I T C H _ C O D E } > "   ceQ0R`OvHOofb/f!jg-N o:yv0We0
 
 
 
 	 
 
 x l a n g a u g e   d e s c r i p t i o n 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 A n   e X t e n s i b l e   M u l t i - l a n g u a g e   c o n t e n t   a n d   c h a r a c t e r   e n c o d i n g   M a n a g e m e n t   p l u g i n 
 
 M u l t i l a n g u a g e   m a n a g e m e n t   h a n d l e s   d i s p l a y i n g   c o n t e n t s   o f   d i f f e r e n t   l a n g u a g e s ,   l i k e   E n g l i s h ,   F r e n c h   a n d   C h i n e s e 
 
 C h a r a c t e r   e n c o d i n g   m a n a g e m e n t   h a n d l e s   c o n t e n t s   o f   d i f f e r e n t   e n c o d i n g   s e t s   f o r   o n e   l a n g u a g e ,   l i k e   G B 2 3 1 2   ( C h i n e s e   S i m p l i f i e d )   a n d   B I G 5   ( C h i n e s e   T r a d i t i o n a l )   f o r   C h i n e s e .   
 
 
 
 
 
 W h a t   x l a n g u a g e   C A N   d o 
 
 - - - - - - - - - - - - - - - - - - - - - 
 
 1   d i s p l a y i n g   c o n t e n t   o f   s p e c i f i e d   l a n g u a g e   b a s e d   o n   u s e r ' s   d y n a m i c   c h o i c e 
 
 2   c o n v e r t i n g   c o n t e n t   f r o m   o n e   c h a r a c t e r   e n c o d i n g   s e t   t o   a n o t h e r 
 
 
 
 
 
 W h a t   x l a n g u a g e   c a n N O T   d o 
 
 - - - - - - - - - - - - - - - - - - - - - - - - 
 
 1   x l a n g u a g e   d o e s   N O T   h a v e   t h e   a b i l i t y   o f   t r a n s l a t i n g   c o n t e n t   f r o m   o n e   l a n g u a g e   t o   a n o t h e r   o n e .   Y o u   h a v e   t o   i n p u t   c o n t e n t s   o f   v a r i o u s   l a n g u a g e s   b y   y o u r s e l f 
 
 2   x l a n g u a g e   d o e s   N O T   w o r k   w i t h o u t   a d d i n g   o n e   l i n e   t o   X O O P S / i n c l u d e / c o m m o n . p h p   ( s e e   g u i d e   b e l o w ) 
 
 3   x l a n g u a g e   d o e s   N O T   h a v e   t h e   a b i l i t y   o f   c o n v e r t i n g   c o n t e n t   f r o m   o n e   c h a r a c t e r   e n c o d i n g   t o   a n o t h e r   i f   n o n e   o f   " i c o n v " ,   " m b _ s t r i n g "   o r   " x c o n v "   i s   a v a i l a b l e .   
 
 
 
 
 
 F e a t u r e s 
 
 - - - - - - - - 
 
 1   a u t o - d e t e c t i o n   o f   v i s i t o r ' s   l a n g u a g e   o n   h i s   f i r s t   v i s i t o r 
 
 2   m e m o r i z i n g   u s e r s '   l a n g a u g e   p r e f e r e n c e s 
 
 3   s w i t c h i n g   c o n t e n t s   o f   d i f f e r e n t   l a n g u g e s / e n c o d i n g   s e t s   o n - f l y 
 
 4   s u p p o r t i n g   M - S - M   m o d e   f o r   c h a r a c t e r   e n c o d i n g   h a n d l e r 
 
 
 
 N o t e : 
 
 M - S - M :   M u l t i p l e   e n c o d i n g   i n p u t ,   S i n g l e   e n c o d i n g   s t o r a g e ,   M u l t i p l e   e n c o d i n g   o u t p u t . 
 
 M - S - M   a l l o w s   o n e   s i t e   t o   f i t   v a r i o u s   u s e r s   w i t h   d i f f e r e n t   l a n g u a g e   c h a r a c t e r   e n c o d i n g   u s a g e s .   F o r   e x a m p l e ,   a   s i t e   h a v i n g   x l a n g u a g e   i m p l e m e n t e d   p o r p e r l y   a l l o w s   u s e r s   t o   i n p u t   c o n t e n t   e i t h e r   w i t h   G B 2 3 1 2 ,   w i t h   B I G 5   o r   U T F - 8   e n c o d i n g   a n d   t o   s t o r e   t h e   c o n t e n t   i n t o   D B   w i t h   s p e c i f i e d   e n c o d i n g ,   f o r   s a y   G B 2 3 1 2 ,   a n d   t o   d i s p l a y   t h e   c o n t e n t   e i t h e r   w i t h   G B 2 3 1 2 ,   w i t h   B I G 5   o r   w i t h   U T F - 8   e n c o d i n g . 
 
 
 
 
 
 C h a n g e l o g 
 
 - - - - - - - - - 
 
 x l a n g u a g e   3 . 0 2   c h a n g e l o g : 
 
 1   a d j u s t e d   f o r   X o o p s   2 . 4 . 0   u s i n g   P r e l o a d s ,   n o   h a c k s   o f   C o r e   f i l e s   r e q u i r e d   a n y m o r e   i n   2 . 4 . 0   a n d   a b o v e   ( t r a b i s ) 
 
 
 
 x l a n g u a g e   3 . 0   c h a n g e l o g : 
 
 1   c o m p a t a b l e   f o r   a l l   X o o p s   a c t i v e   v e r s i o n s 
 
 2   a d d e d   s m a r t y   t e m p l a t e   f o r   b l o c k 
 
 3   a d d e d   i n l i n e   s c r i p t s   f o r   d i s p l a y i n g   l a n g u a g e   s w i t c h   m a n n e r   a n y w h e r e   p r e f e r e d 
 
 
 
 x l a n g u a g e   2 . 0 4   c h a n g e l o g : 
 
 c a p a b l e   f o r   d i f f e r e n t   l a n g u a g e   c a c h e ,   r e p o r t e d   b y   s u i c o   @   x o o p s . o r g 
 
 
 
 x l a n g u a g e   2 . 0 3   c h a n g e l o g : 
 
 " i n p u t "   p a r s e   i m p r o v e m e n t ,   r e p o r t e d   b y   i r m t f a n   @   x o o p s . o r g 
 
 
 
 x l a n g u a g e   2 . 0 2   b u g f i x   f o r   X S S   v u l n e r a b i l i t y 
 
 T h a n k s   d o m i f a r a   @   d e v . x o o p s . o r g 
 
 
 
 x l a n g u a g e   2 . 0 1   b u g f i x   f o r   n o n e x i s t i n g   l a n g u a g e 
 
 
 
 
 
 
 
 C r e d i t s 
 
 - - - - - - - 
 
 1   A d i   C h i r i b u t a   -   w e b m a s t e r @ a r t i s t i c . r o ,   l a n g u a g e   h a n d l e r 
 
 2   w j u e   -   h t t p : / / w w w . w j u e . o r g ,   z i l i n g   B I G 5 - G B 2 3 1 2   c o n v e r s i o n 
 
 3   G I J O E   -   h t t p : / / w w w . p e a k . n e . j p ,   e a s i e s t   m u l t i l a n g u a g e   h a c k 
 
 
 
 A u t h o r 
 
 - - - - - - 
 
 D . J .   ( p h p p p ) 
 
 h t t p : / / x o o p s . o r g . c n 
 
 h t t p : / / x o o p s f o r g e . c o m 