geditの「日付/時刻の挿入」のうち、RFC 2822形式が誤って翻訳されてしまっている

Bug #603172 reported by Koichi Akabe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Japanese Kaizen Project
Triaged
Low
Unassigned

Bug Description

確認手順:

1). geditを起動する
2). 「編集」>「日付/時刻の挿入」をクリックし、「日付と時間の挿入」ダイアログを表示させる。
3). 「指定したフォーマットを使う」の選択肢において、RFC 2822形式とみられる出力を確認する。

Expected Result:
「Fri Jul 09 12:43:38 JST 2010」という形で、曜日・月の短い名前が、英語のまま表示される。LANG=Cではこの挙動。

Actual Result:
「金 7月 09 12:42:17 JST 2010」という形で、曜日・月の短い名前が、日本語に変換されて出力される。

description: updated
Fumihito YOSHIDA (hito)
summary: - geditの「日付/時刻の挿入」の日時フォーマットがRFC 2822に準拠していない。(日本語環境のみ)
+ geditの「日付/時刻の挿入」のうち、RFC 2822形式が誤って翻訳されてしまっている
Fumihito YOSHIDA (hito)
description: updated
Changed in ubuntu-jp-improvement:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Fumihito YOSHIDA (hito) wrote :

gedit-2.30.3/plugins/time/gedit-time-plugin.cのget_time()において、ロケールによる挙動を一切無視した実装が行われている。

以下でフォーマットを宣言して、そのままget_time()でstrftimeする作りになっているのが問題。

static const gchar *formats[] =
{
        "%c",
        "%x",
        "%X",
        "%x %X",
        "%Y-%m-%d %H:%M:%S",
        "%a %b %d %H:%M:%S %Z %Y",
        "%a %b %d %H:%M:%S %Y",
        "%a %d %b %Y %H:%M:%S %Z",
        "%a %d %b %Y %H:%M:%S",
        "%d/%m/%Y",
        "%d/%m/%y",
#ifndef G_OS_WIN32
        "%D", /* This one is not supported on win32 */
#endif
        "%A %d %B %Y",
        "%A %B %d %Y",
        "%Y-%m-%d",
        "%d %B %Y",
        "%B %d, %Y",
        "%A %b %d",
        "%H:%M:%S",
        "%H:%M",
        "%I:%M:%S %p",
        "%I:%M %p",
        "%H.%M.%S",
        "%H.%M",
        "%I.%M.%S %p",
        "%I.%M %p",
        "%d/%m/%Y %H:%M:%S",
        "%d/%m/%y %H:%M:%S",
#if __GLIBC__ >= 2
        "%a, %d %b %Y %H:%M:%S %z",
#endif
        NULL
};

選択肢 a) 単純な対応:
setlocale(LC_ALL, ""); をstrftimeの直前にいれて、本来のロケールに戻すsetlocaleを直後に入れる。

選択肢 b) まじめだが面倒な対応
フォーマット文字列をロケール情報も含めたものにするか、もしくはstrftimeに頼らない構造にする。

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.