wiki:Translation/Redmine
Last modified 5 years ago Last modified on 10/07/07 22:40:50

Redmine

翻訳

  • lang/ja.yml
    • 本家に直接反映してもらっているので追加作業は不要

使い方

  • rake load_default_data で ja を選ぶ
  • admin でログインする(この時点では英語表示)
  • admin アカウントの言語設定で Japanese を選ぶ(この時点で日本語表示になる)
  • アプリケーションの言語設定で Japanese を選ぶ(ユーザ作成時のデフォルトになる)

メール通知の文字化け対策

  • gem install gettext
  • vi app/controllers/application.rb
    Index: app/controllers/application.rb
    ===================================================================
    --- app/controllers/application.rb      (revision 655)
    +++ app/controllers/application.rb      (working copy)
    @@ -18,6 +18,8 @@
     class ApplicationController < ActionController::Base
       before_filter :check_if_login_required, :set_localization
       filter_parameter_logging :password
    +
    +  init_gettext "redmine"
    
       REDMINE_SUPPORTED_SCM.each do |scm|
         require_dependency "repository/#{scm.underscore}"
    @@ -173,4 +175,4 @@
         end
         return tmp
       end
    -end
    \ No newline at end of file
    +end
    
  • vi config/environment.rb
    Index: config/environment.rb
    ===================================================================
    --- config/environment.rb       (revision 655)
    +++ config/environment.rb       (working copy)
    @@ -1,4 +1,6 @@
     # Be sure to restart your web server when you modify this file.
    +$KCODE = 'u'
    +require 'jcode'
    
     # Uncomment below to force Rails into production mode when
     # you don't control web/app server and can't set it the proper way
    @@ -83,5 +88,6 @@
     GLoc.load_localized_strings
     GLoc.set_config(:raise_string_not_found_errors => false)
    
    +require 'gettext/rails'
     require 'redmine'
    

Trac からの移行

  • sqliteのみ対応→ task の adapter を sqlite3 に変更すれば OK
  • Milestoneの項目に空があるとエラー→trac 上で消すなり項目入れるなり
  • Wiki の Trac* がかなり邪魔

Windows上でサービスに

  • gem install mongrel_service
  • mongrel_rails service::install -N "Redmine" -c c:\redmine -p 3030 -e production

まだうまく動いていない

  • sqlite3-ruby の dlload で Unknown Error。対処は難しそう

PDF の文字化け(2007/10頃のメモ。嘘かも?)

将来的には、UTF-8 のまま TCPDF に流しこめれば余計な変換がなくていいんじゃないかなーとか。

  • Redmine の内部文字エンコーディングは UTF-8
  • rails の rfpdf plugin を使って PDF を生成している
  • GLOC を噛ませて各国語のメッセージにした後、iconv で UTF-8 → SJIS 変換した文字列を rfpdf に投入

iconv

  • 変換結果が OS 依存
  • Windows の機種依存文字は、CP932 だったりする (CP932 は SJIS の Microsoft 拡張)

rfpdf plugin(old)

  • PHP の fpdf を ruby に移植したもの
  • fpdf、rfpdf ともに日本語に対応しているが、SJIS 決めうち
  • 基本的に ASCII(single-byte) にしか対応しておらず、日本語への対応は SJIS 専用の追加コードでなされている

rfpdf plugin(new)

  • fpdf を拡張した tcpdf では UTF-8 に対応
  • rfpdf plugin の開発版で tcpdf を取り込みつつある
  • 専用フォントが必要(開発元でさざなみゴシックが配布されている)
  • Redmine に無理矢理つけてみたけどかなり改善が必要