[mlimg][xlang:en]
== THE EASIEST MULTILANGUAGE HACK for XOOPS ==

[b]SUMMARY:[/b]

The easiest multilanguage hack I ever seen. :-)

All you have to do is just copying a file and inserting a line into mainfile.php.

Block's cache and module's cache are valid.

Since this is just a patch to mainfile.php, don't mind about updating core files.

This hack might not harm the other hacks at all.

Even with ShortURLs, it is just an issue of order in mainfile.php



[b]USAGE:[/b]

- edit easiestml.php in this archive as you like

original:
[code]
define('EASIESTML_LANGS','en,ja');
[/code]
eg)
[code]
define('EASIESTML_LANGS','en,fr');
[/code]

- copy easiestml.php into XOOPS_ROOT_PATH/include/
- open mainfile.php with your editor and insert a line like this:

[code]
	// XOOPS Virtual Path (URL)
	// Virtual path to your main XOOPS directory WITHOUT trailing slash
	define('XOOPS_URL', ...);

	require XOOPS_ROOT_PATH.'/include/easiestml.php' ; // insert this

	// Database
	// Choose the database to be used
	define('XOOPS_DB_TYPE', 'mysql');
[/code]

- edit the other entries in CONFIGURATIONS of easiestml.php
- That's all!


If you define EASIESTML_LANGS as 'en,fr', you can desscribe it like this:

[en]English part[/en]
[fr]French part[/fr]
Common part


Visitors select the language at first visiting, and the language selection is stored in his cookie.

Thus, you'd better insert [mlimg] tag into your theme or custom block.

If you want to enable auto-language-judgement from information sent by browser, edit the definition of EASIESTML_ACCEPT_CHARSET_REGEXES/EASIESTML_ACCEPT_LANGUAGE_REGEXES in configurations area.

In 1.23, a constant 'EASIESTML_CHARSETS' is added into the CONFIGURATIONS. Edit it please.

If you want to divide <input> for each languages, you can use post merger.
edit the CONFIGURATION
[code]
define('EASIESTML_USEPOSTMERGER',[d]0[/d] 1);
[/code]
and edit the templates like this:
[code]
[d]<input type="text" name="subject" value="<{$value}>" />[/d]
English: <input type="text" name="subject[en]" value="<{$value|easiestml:"en"}>" />
Japanese: <input type="text" name="subject[ja]" value="<{$value|easiestml:"ja"}>" />
[/code]

[b]CHANGELOG[/b]

2008-10-01 1.31
- modified ACCEPT_LANGUAGE is estimated former than ACCEPT_CHARSET (thx nobu)

2008-06-20 1.30
- added post merger
- added manual language switcher for dividing values of <input>
- modified [mlimg ] outputs flags separated with spaces (thx jagi) 1.30a

2007-04-02 1.26
- added a configuration specifying the default language
- modified mlimg tag HTML-lint friendly :-)

2006-09-07 1.25
- fixed the logic judging clients's language

2006-01-29 1.24
- modified regex pattern for escaping <input type="text" value="...">

2005-12-29 1.23
- supported FastestCache (added a constant EASIESTML_CHARSETS in CONFIGURATIONS)

2005-12-24 1.22
- added a feature judging client's language by $_SERVER['HTTP_ACCEPT_CHARSET'] or $_SERVER['HTTP_ACCEPT_LANGUAGE'] using perl regex (Edit the definition of EASIESTML_ACCEPT_CHARSET_REGEXES/EASIESTML_ACCEPT_LANGUAGE_REGEXES in configurations area)

2005-04-11 1.21
- fixed a typo in excluding directory (thx domifara)

2005-03-18 1.20
- fixed troubles caused by buffer overflows of "forward readings"

2005-03-18 1.11
- fixed the logic eliminating <br /> just after language tags

2005-03-03 1.10
- added debugging mode -all- for system admin
- modified to eliminate <br /> just after language tags
- added a tag for images selecting languages [ mlimg]

2005-03-02 1.00
- The first public release


                    by GIJOE    http://www.peak.ne.jp/xoops/

[/xlang:en]
[xlang:ja]

 ¿ϥå 

Ĺ

ڤѤǤ¿ϥåǤ

ե룱Ĥ򥳥ԡơmainfile.php ˣɲáäǡưޤ

obե륿ѤƺǽϻˤĤѴԤʤΤǡXOOPSΥ֥åå⥸塼륭åͭ˸ޤ

ޤmainfile.phpؤΥѥåʤΤǡXOOPSΥС󥢥åפǿۤɬפ⤢ޤ¾HackȤζʤϤǤƱobե륿ѤSimplified URLsǤ⡢mainfile.php˵Ҥ֤ΤϤǤ



Ȥ

Υ֤˴ޤޤ easiestml.php XOOPS󥹥ȡǥ쥯ȥinclude/ǥ쥯ȥ˥ԡƲ

mainfile.php򳫤ơXOOPS_URLԤľˡ

[code]
	require XOOPS_ROOT_PATH.'/include/easiestml.php' ;
[/code]

ȰɲäƲ


äǡ

[ja]ܸʬ[/ja]
[en]Ѹʬ[/en]
ʬ

ȤҤǽˤʤޤ


Υѹϡeasiestml.php 򥨥ǥǳơǽοԤ򤪹ʤ褦ԽƤ

ǤϡʲͤˤʤäƤޤѤ쥿򥫥ޤǶڤ뤳ȤդƤ[]פǤ
[code]
define('EASIESTML_LANGS','en,ja');
[/code]

ǧݤ褦Ǥ顢ʲ򤪴ᤷޤ
[code]
define('EASIESTML_LANGS','xlang:en,xlang:ja');
[/code]

ξ硢ʲΤ褦ʵҤȤʤޤ

[xlangja]ܸʬ[/xlangja]
[xlangen]Ѹʬ[/xlangen]


ѼԤ򤷤ơ򥯥å¸褦ˤƤޤΤᡢơʤɤˡƸ򤹤뤿Υ󥯤ѰդƤɬפޤưǺƤɤΤǤ[mlimg] ȤǡưŪ˸󥯤ȤʤޤΤǡΤѤ򤪴ᤷޤ


1.22顢åʤѸϡ֥饦äƤHTTPꥯȡAccept_LanguageޤAccept_CharsetˤȽǤ褦ˤޤΥѥ򤤤ꤿϡEASIESTML_ACCEPT_LANGUAGE_REGEXES ޤ EASIESTML_ACCEPT_CHARSET_REGEXES 񤭴ƤperlɽǤ뤳ȡɽ,ʥޡˤǶڤäƤ뤳ȡʤĤޤɽǤ,ԲǽˤդɬפǤ

1.23ǤϡEASIESTML_CHARSETS ȤޤˤĤƤ⡢Ѹ줴ȤԽɬפޤ

 Ѳǽ䤻䤷ʬϻν٤礭ʤޤѤʤ쥿ʤǲ

ԥ塼Ϥ˴ƤʤͤΤˡϥեʬ硢POSTޡǽȤΤɤǤ礦
ޤCONFIGURATIONꥢ򤳤ơ
[code]
define('EASIESTML_USEPOSTMERGER',[d]0[/d] 1);
[/code]
줫顢ϥեΥƥץ졼Ȥ򤳤ʴˤޤ
[code]
[d]<input type="text" name="subject" value="<{$value}>" />[/d]
English: <input type="text" name="subject[en]" value="<{$value|easiestml:"en"}>" />
ܸ: <input type="text" name="subject[ja]" value="<{$value|easiestml:"ja"}>" />
[/code]
ˤäơ줾Υե˽񤫤줿ƥȤ쥿ǥޡޤ


ѹ

2008-06-20 1.30
- POSTޡǽμ
- Хؿ easiestml() ˣܤΰɲäơƥץ졼Ȥޥ˥奢Ǹʬ䤬Ǥ褦ˤ
- [mlimg ] νϤ˥ڡޤޤ褦ˤƤߤ (thx jagi) 1.30a

2007-04-02 1.26
- ǥեȸɲä
- mlimg tag  HTML-lint Ǽʤ褦ˤƤߤ :-)

2006-09-07 1.25
- ȽΥåȴäΤ

2006-01-29 1.24
- ƥȥܥåѤΥȽɽꥷץ˲

2005-12-29 1.23
- FastestCache ؤбɲ ʳƸ줴ȤContent-Typeˤcharsetɲá

2005-12-24 1.22
- HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_LANGUAGE Υѥ󤫤顢ǥեȤθԤå򺣤ʤɲ

2005-04-11 1.21
- ӽǥ쥯ȥʬˤätypo (thx domifara)

2005-03-18 1.20
- ɤߤΥХåեդȻפ븽ݤб ʥå

2005-03-18 1.11
- 쥿ľ<br />äå ʳϥä褦ˤ

2005-03-03 1.10
- ǥХåall⡼ɼ ʴԤΤߡ
- 쥿ľ<br />˾ä褦ˤ
- ᡼ο [ mlimg]

2005-03-02 1.00
- ǽθ


                    by GIJOE    http://www.peak.ne.jp/xoops/

[/xlang:ja]
