Author Topic: [Language] Japanese Language Files for v1.7.7  (Read 9452 times)

0 Members and 1 Guest are viewing this topic.

Offline memphis

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • 4images for Japanese?
[Language] Japanese Language Files for v1.7.7
« 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 を解凍後に、添付ファイルを解凍して上書きして下さい。

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Language] Japanese Language Files for v1.7.7
« Reply #1 on: April 01, 2010, 03:32:52 PM »
... thanks for sharing ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline memphis

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • 4images for Japanese?
Re: [Language] Japanese Language Files for v1.7.7
« Reply #2 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);
  }

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.423
    • View Profile
    • 4images - Image Gallery Management System
Re: [Language] Japanese Language Files for v1.7.7
« Reply #3 on: May 17, 2010, 04:36:27 PM »
Thank you!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline memphis

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • 4images for Japanese?
Re: [Language] Japanese Language Files for v1.7.7
« Reply #4 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)."...";
      }