4images Forum & Community

4images Modifications / Modifikationen => Language Packs => Topic started by: memphis on April 01, 2010, 03:19:28 PM

Title: [Language] Japanese Language Files for v1.7.7
Post by: memphis on April 01, 2010, 03:19:28 PM
Hi,

Japanese Language Files.
Version 1.7.7

Regards,
memphis


*以下は日本語です。
文字コードはUTF-8で作成しています。
4images 1.7.7.zip を解凍後に、添付ファイルを解凍して上書きして下さい。
Title: Re: [Language] Japanese Language Files for v1.7.7
Post by: mawenzi on April 01, 2010, 03:32:52 PM
... thanks for sharing ...
Title: Re: [Language] Japanese Language Files for v1.7.7
Post by: memphis on May 17, 2010, 03:31:07 PM
Hello.
I found that word_wrap didn't work well when I used Multibyte Character like Japanese language.
The correction method is as follows.

To fix this:
in includes/functions.php
find:
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
     $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }

Replace with:
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
     $text = mb_ereg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }


*以下は日本語です。
日本語などマルチバイトを使う環境は、word_wrap が正しく動作しないことが解かりました。
修正方法は以下の通りです。

修正するファイル:
includes/functions.php の3行目です。
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
  if ($word_wrap && $text != "") {
     $text = mb_ereg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }
Title: Re: [Language] Japanese Language Files for v1.7.7
Post by: kai on May 17, 2010, 04:36:27 PM
Thank you!
Title: Re: [Language] Japanese Language Files for v1.7.7
Post by: memphis on May 17, 2010, 11:52:56 PM
Additional.

To fix this:
in admin/comments.php

Find line 26:
Code: [Select]
define('IN_CP', 1);
define('ROOT_PATH', './../');
require('admin_global.php');


Replace with:
Code: [Select]
define('IN_CP', 1);
define('ROOT_PATH', './../');
require('admin_global.php');
mb_internal_encoding("UTF-8");



Around line 306:
Code: [Select]
      if (strlen($comment_row['comment_text']) > 75) {
        $comment_row['comment_text'] = substr($comment_row['comment_text'], 0, 75)."...";
      }

Replace with:
Code: [Select]
      if (mb_strlen($comment_row['comment_text']) > 75) {
        $comment_row['comment_text'] = mb_substr($comment_row['comment_text'], 0, 75)."...";
      }