(Translated by https://www.hiragana.jp/)
PEAK XOOPS - The Easiest Multi-Language Hack (EMLH) 1.31

PEAK XOOPS - The Easiest Multi-Language Hack (EMLH) 1.31 in englishin japanese






Main : XOOPS Hacks : 

Category: XOOPS Hacks ore     x22       php5
Download Now! Download Now! The Easiest Multi-Language Hack (EMLH) 1.31 Popular Version: 1.31
Submitted Date:  2008/10/1
Description:
in englishin japanese
== お手軽てがる多言たげんハック ==

特長とくちょう

気軽きがる利用りようできる多言たげんハックです。

ファイルひとつをコピーして、mainfile.php に1ぎょう追加ついか。たったそれだけで、動作どうさします。

obフィルターを利用りようして最終さいしゅう出力しゅつりょくにいくつかの変換へんかん処理しょりおこなうだけなので、XOOPSのブロックキャッシュやモジュールキャッシュも有効ゆうこうきます。

また、mainfile.phpへのパッチなので、XOOPSコアのバージョンアップで心配しんぱいする必要ひつようもありません。のHackとの競合きょうごうもないはずです。(おなじobフィルターを利用りようするSimplified URLsでさえも、mainfile.phpに記述きじゅつする順番じゅんばんだけの問題もんだいのはずです。)



使つかかた

このアーカイブにふくまれる easiestml.php をXOOPSインストールディレクトリのinclude/ディレクトリにコピーしてください。

mainfile.phpをひらいて、XOOPS_URL定義ていぎぎょう直後ちょくごに、


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


いちぎょう追加ついかしてください。


たったこれだけで、

[ja]日本語にほんご部分ぶぶん[/ja]
[en]英語えいご部分ぶぶん[/en]
共通きょうつう部分ぶぶん

という記述きじゅつ可能かのうになります。


このタグを変更へんこうしたいときは、easiestml.php をエディタでひらいて、最初さいしょすうぎょうをおきなように編集へんしゅうしてください。

初期しょき設定せっていでは、以下いかようになっています。利用りようする言語げんごタグをカンマで区切くぎることに注意ちゅういしてください。([]は不要ふようです)

define('EASIESTML_LANGS','en,ja');


誤認ごにん識がこわいようでしたら、以下いか設定せっていをおすすめします。

define('EASIESTML_LANGS','xlang:en,xlang:ja');


この場合ばあい以下いかのような記述きじゅつとなります。

[xlang:ja]日本語にほんご部分ぶぶん[/xlang:ja]
[xlang:en]英語えいご部分ぶぶん[/xlang:en]


利用りようしゃ言語げんご選択せんたくして、それをクッキー保存ほぞんするようにしています。そのため、テーマないなどに、かく言語げんご選択せんたくするためのリンクを用意よういしてあげる必要ひつようがあります。手動しゅどう作成さくせいしてもいのですが、in englishin japanese というタグをれるだけで、自動的じどうてき言語げんご選択せんたくリンクとなりますので、こちらのご利用りようをおすすめします。


1.22から、クッキーがない場合ばあい利用りよう言語げんごは、ブラウザがおくってきたHTTPリクエスト(Accept_LanguageまたはAccept_Charset)から判断はんだんするようにしました。これらのパターンをいじりたい場合ばあいは、EASIESTML_ACCEPT_LANGUAGE_REGEXES または EASIESTML_ACCEPT_CHARSET_REGEXES をえてください。perlの正規せいき表現ひょうげんであること、その正規せいき表現ひょうげんを,(カンマ)で区切くぎっていること(つまり正規せいき表現ひょうげんないでは,は利用りよう不可能ふかのう)に注意ちゅうい必要ひつようです。

1.23では、EASIESTML_CHARSETS という定数ていすうえました。この定数ていすうについても、利用りよう言語げんごごとに編集へんしゅうする必要ひつようがあります。

利用りよう可能かのう言語げんごやせばやしたぶんだけ、出力しゅつりょく処理しょり負荷ふかおおきくなります。利用りようしない言語げんごタグは定義ていぎしないでください。

コンピュータ入力にゅうりょくれていないひとのために、入力にゅうりょくフォームをけたい場合ばあい、POSTマージ機能きのう使つかうのがいでしょう。
まず、CONFIGURATIONエリアをこう修正しゅうせいして、

define('EASIESTML_USEPOSTMERGER',0 1);

それから、入力にゅうりょくフォームのテンプレートをこんなかんじにいじります。

<input type="text" name="subject" value="<{$value}>" />
English: <input type="text" name="subject[en]" value="<{$value|easiestml:"en"}>" />
日本語にほんご: <input type="text" name="subject[ja]" value="<{$value|easiestml:"ja"}>" />

これによって、それぞれのフォームにかれたテキストが言語げんごタグでマージされます。


変更へんこう履歴りれき

2008-10-01 1.31
- ACCEPT_LANGUAGEがあればACCEPT_CHARSETに優先ゆうせんするように修正しゅうせいした (thx nobu)

2008-06-20 1.30
- POSTマージ機能きのう実装じっそう
- グローバル関数かんすう easiestml() に2番目ばんめ引数ひきすう追加ついかして、テンプレートからマニュアルで言語げんご分割ぶんかつができるようにした
- [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/


Downloaded 26793 times  26793  File Size 5.14 KB  Supported Platforms tar.gz|zip|ore|php5|x22  Home Page http://www.peak.ne.jp/
Modify | Report Broken File | Tell a Friend | Comments (13)


Comments list

malipalo  Posted on 2011/8/20 23:03
Hello everyone,

Excuse my English, I use a translator because I speak French.

First of all I must thank you for this wonderful module, I have long sought a reliable solution to make a multilingual site Xoops.

Site, a base, a domain: it's really better for the changes that two sites one French one English and so on.

I seem to see found a bug, or so I set something wrong, let me explain:

I use your module:
XC Legacy Version: XOOPS Cube Legacy 2.2

It works perfectly.

But this morning by making my translations [en ]..[/en], I noticed in the corner of the screen at the top left.

design [/en]

that has nothing to do there.

I translated the subject of a content with
[fr] conception [/fr] [en] design [/en]

page of the site in English with the error:
http://maison-parents.ch/modules/cours/index.php?content_id=4&easiestml_lang=en

The same page of the site in French but there is no error:
http://maison-parents.ch/modules/cours/index.php?content_id=4&easiestml_lang=fr

Is what I am faced with a bug or is it because I use XOOPS Cube Legacy 2.2 instead of Xoops?

I do not understand this error, I searched without finding the PHP code.

If you can help me on this problem please
I would be eternally grateful. For it is the site of one of my clients for whom I make the translation of these pages in English, and I hold on this problem, I can not find the solution.

Laurent Perret / Geneva - Switzerland
webmaster@incdata.net
phasar  Posted on 2011/8/10 19:07
Hello Joe

I would like to check my configuration to make sure it is correct.

I want to use English and Russian on my site and I'm not certain about the PERL expressions

Quote:

// list the language names separated with comma (these will be alt of <img>)
define('EASIESTML_LANGNAMES','in english,in russian');

// list language - accept_chaset patterns (perl regex) separated with comma
define('EASIESTML_ACCEPT_CHARSET_REGEXES',',/shift_jis/i');

// list language - accept_language patterns (perl regex) separated with comma
define('EASIESTML_ACCEPT_LANGUAGE_REGEXES','/^en/,/^ja/');

// charset in Content-Type separated with comma (only for fastestcache)
define('EASIESTML_CHARSETS','UTF8,UTF8');

Is it correct?
leco1  Posted on 2009/7/30 3:24 | Last modified
休暇きゅうかでは、サポートを提供ていきょうする一方いっぽうxoopers

そのためには、休暇きゅうか
GIJOE  Posted on 2009/7/29 4:47
hi leco.
I'm in Holiday, now
leco1  Posted on 2009/7/28 11:23 | Last modified
Hi Gijoe

Welcome from your holiday

I intall cubeutils and now all is ok. This module can be seen running in:

http://sulinvest.com

and

http://mixmusicas.com


Again thanks for the tip

GIJOE  Posted on 2009/7/27 5:01
hi leco.

Perhaps, you've misunderstood the feature of EMLH.
EMLH never changes the system language.

If you make a contents like:
[en]English[/en]
[pt]Portuguese[/pt]
It will be changed by the url "easiestml=en".

Anyway, with you are using XCL, try CubeUtils module.
This module changes the system language also.
leco1  Posted on 2009/7/10 21:51
Hi

I'm trying use this hack in site http://mixmusicas.com with theme mysite3 powered by Nobu.
In this site, i use xoops cube legacy 2.2.0_alpha.

My settings in file easiestml.php is:

[code]
// CONFIGURATIONS BEGIN

// list the language tags separated with comma
//define('EASIESTML_LANGS','xlang:en,xlang:ja'); // This is a sample of long pattern against tag misunderstanding define('EASIESTML_LANGS','en,pt'); // [en]english[/en] [ja]japananese[/ja] common

// list the language images separated with comma
define('EASIESTML_LANGIMAGES','images/en.gif,images/pt.gif');

// list the language names separated with comma (these will be alt of <img>)
define('EASIESTML_LANGNAMES','Em ingl
mosluce  Posted on 2009/2/4 9:29
I know how to make it working ^o^

in englishin japanese insert the language selsctor to the page.

And I can write english content or other language content
in [ xlang:en] or [ xlang:other] blocks.^^

Quote:

mosluce wrotes:
Hi GIJOE!

I try to use this Hack, but it's not work.

http://mosluce.cpbl.weedns.com/main/modules/wfdownloads/index.php
^^^^^^^^^This is my site ( wfdownloads module )^^^^^^^^^^

I am sure that this module has english language pack, but I click the english bottom, It's still not work.

Do you know anything wrong ?^^"
mosluce  Posted on 2009/2/4 1:23
Hi GIJOE!

I try to use this Hack, but it's not work.

http://mosluce.cpbl.weedns.com/main/modules/wfdownloads/index.php
^^^^^^^^^This is my site ( wfdownloads module )^^^^^^^^^^

I am sure that this module has english language pack, but I click the english bottom, It's still not work.

Do you know anything wrong ?^^"
GIJOE  Posted on 2009/1/24 10:18 | Last modified
hi plok.

I don't see what's wrong about you.
It is quite easy to install EMLH.

Just edit your mainfile.php

Of course, you have to edit the area of =CONFIGURATION= in easiestml.php for your purpose.

[ mlimg] is a tag for switching languages.
You can place the tag as you like, theme.html, any templates, or contents.

This site is one of the sample site for EMLH.
I uses language tags [ xlang:ja] and [ xlang:en]

(remove a space just after [)


Try here.
------------------
in englishin japanese
Japanese
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!