the gettext schemas translations are not being used

Bug #443133 reported by Nobuto Murata
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cdbs (Ubuntu)
Fix Released
High
Martin Pitt
Karmic
Fix Released
High
Martin Pitt
gconf (Ubuntu)
Fix Released
High
Unassigned
Karmic
Fix Released
High
Unassigned

Bug Description

Binary package hint: gedit

Gedit's deb package lacks localization schemas.

Karmic's gedit_2.28.0-0ubuntu1_i386.deb contains a below file.
"/usr/share/gconf/schemas/gedit.schemas"
But it contains ONLY <locale name="C">.
In case of Debian sid's gedit_2.28.0-1_i386.deb,
it contains <locale name="C">, <locale name="af">, <locale name="am"> ..., a number of source package's po file.

-----Note------------------------------------------------------
This schema file is important part of encoding detection,
 (a) gconf:/apps/gedit-2/preferences/encodings/auto_detected
 and
 (b) this schema(/usr/share/gconf/schemas/gedit.schemas)
provides "encoding auto detection" features. But (a) is not localized(="UTF-8, CURRENT, ISO-8859-15, UTF-16"). So, if you have none UTF-8 encodings text files(such as Windows's. e.g: In Japanese locale, Windows notepad create "CP932" encodings multi-byte files.)
---------------------------------------------------------------

As a result, Ubuntu's gedit does not open Windows's text files correctly.

This schema file is created by build process. But current ubuntu's gedit does not contain any valid default schema(yes, non-i18ned file is not valid).

IMHO, this is Ubuntu's diff or buildd problem(maybe).

And this bug also affects jaunty's gedit_2.26.1-0ubuntu1_i386.deb.

ProblemType: Bug
Architecture: i386
Date: Mon Oct 5 22:50:09 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/gedit
Package: gedit 2.28.0-0ubuntu1
ProcEnviron:
 LANG=ja_JP.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic-pae
SourcePackage: gedit
Uname: Linux 2.6.31-11-generic-pae i686

Revision history for this message
Nobuto Murata (nobuto) wrote :
Fumihito YOSHIDA (hito)
summary: - Lack of localization schemas
+ gedit could not detect valid text-encodings(Lack of gedit.schemas)
Fumihito YOSHIDA (hito)
description: updated
Revision history for this message
Fumihito YOSHIDA (hito) wrote : Re: gedit could not detect valid text-encodings(Lack of gedit.schemas)

sample of actual results(screenshot).

Revision history for this message
Fumihito YOSHIDA (hito) wrote :

expected results.

Fumihito YOSHIDA (hito)
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, could you run gconftool --get /apps/gedit-2/preferences/encodings/auto_detected and copy that to the bug? The schemas translation use gettext in ubuntu that's why they are not in the xml but the translation are there

Changed in gedit (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Nobuto Murata (nobuto) wrote :

$ gconftool --get /apps/gedit-2/preferences/encodings/auto_detected

returns

[UTF-8,CURRENT,ISO-8859-15,UTF-16]

Changed in gedit (Ubuntu):
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

do you have language-pack-gnome-ja installed?

Revision history for this message
Nobuto Murata (nobuto) wrote :

Yes.

$ LANG=C apt-cache policy language-pack-gnome-ja-base

language-pack-gnome-ja-base:
  Installed: 1:9.10+20090930
  Candidate: 1:9.10+20090930
  Version table:
 *** 1:9.10+20090930 0
        500 http://jp.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Nobuto Murata (nobuto) wrote :

language-pack-gnome-ja also installed.
gedit.mo is content of language-pack-gnome-ja-base

Changed in gedit (Ubuntu):
importance: Low → High
milestone: none → ubuntu-9.10
status: New → Confirmed
affects: gedit (Ubuntu Karmic) → gconf (Ubuntu Karmic)
affects: gconf (Ubuntu Karmic) → gedit (Ubuntu Karmic)
summary: - gedit could not detect valid text-encodings(Lack of gedit.schemas)
+ the gettext translations are not being used
summary: - the gettext translations are not being used
+ the gettext schemas translations are not being used
affects: gedit (Ubuntu Karmic) → gconf (Ubuntu Karmic)
affects: gconf (Ubuntu Karmic) → gedit (Ubuntu Karmic)
affects: gedit (Ubuntu Karmic) → gconf (Ubuntu Karmic)
affects: gconf (Ubuntu Karmic) → gedit (Ubuntu Karmic)
affects: gedit (Ubuntu Karmic) → gconf (Ubuntu Karmic)
affects: gconf (Ubuntu Karmic) → gedit (Ubuntu Karmic)
affects: gedit (Ubuntu Karmic) → gconf (Ubuntu Karmic)
Changed in gconf (Ubuntu Karmic):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Robert Ancell (robert-ancell)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Hmm, my translations don't seem to be working at all at the moment.
Default values are definitely not being translated, the gettext calls come from 02_xml-gettext-domain.patch, the following function needs to be fixed:
gconf/gconf-schemas.c:
GConfValue*
gconf_schema_get_default_value (const GConfSchema *schema)
{
  g_return_val_if_fail (schema != NULL, NULL);

  return REAL_SCHEMA (schema)->default_value;
}

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Pushed these changes to lp:~robert-ancell/gconf/bug-443133 but testing doesn't seem to show this has fixed the problem. The test case I am running is:
 LC_ALL=ja_JP.UTF-8 LANG=ja_JP.UTF-8 gconftool --get /apps/gedit-2/preferences/encodings/auto_detected
which should return
"[UTF-8,CURRENT,CP932,SHIFT_JIS,ISO-2022-JP,EUC-JP-MS,EUC-JP,ISO-8859-15,UTF-16]"
not
"[UTF-8,CURRENT,ISO-8859-15,UTF-16]"

Revision history for this message
Sebastien Bacher (seb128) wrote :

the change doesn't seem to do the trick indeed

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've been looking to the issue again today:

$ grep gettext /var/lib/gconf/defaults/* | wc -l
2829

$ sudo gconf-schemas --register gnome-screenshot.schemas

$ grep gettext /var/lib/gconf/defaults/* | wc -l
6

$ sudo gconf-schemas --register-all

$ grep gettext /var/lib/gconf/defaults/* | wc -l
2829

The gettext attribute is being cleaned when registering a schema (gconf-schemas is a wrapper to register schemas used after the installation) which explains why the descriptions are not translated. When the gettext attribute are there the descriptions are translated correctly but still not the default schemas value (using the karmic version on Robert's update)

Revision history for this message
Sebastien Bacher (seb128) wrote :

running "sudo GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/gnome-screenshot.schemas" has the same effect so it's not a wrapper issue

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've uploaded a version which should fix the gettext_domain attribute cleaning:

 gconf (2.28.0-0ubuntu2) karmic; urgency=low
 .
   * debian/patches/02_xml-gettext-domain.patch:
     - updated to not clear the gettext_attribute for the keys not
       being registered by the current schemas

it will not add those cleaned so running gconf-schemas --register-all one is required

Revision history for this message
Loïc Minier (lool) wrote :

Perhaps this should be done on upgrades of gconf?

Revision history for this message
Nobuto Murata (nobuto) wrote :

I have upgraded gconf2 to 2.28.0-0ubuntu2.
And executed the line
$ sudo gconf-schemas --register-all

But
$ gconftool --get /apps/gedit-2/preferences/encodings/auto_detected
still returns
[UTF-8,CURRENT,ISO-8859-15,UTF-16].
It should be [UTF-8,CURRENT,EUC-JP-MS,CP932,EUC-JP,SHIFT_JIS,ISO-2022-JP,ISO-8859-15,UTF-16].

I have tried daily-live 20091008 clean-install with gconf2 2.28.0-0ubuntu2,
but it also returns [UTF-8,CURRENT,ISO-8859-15,UTF-16].

So I do not think this problem was fixed.

Indeed I think the problem of #12 was fixed.

Revision history for this message
Nobuto Murata (nobuto) wrote :

I have found a strange point.

$ sudo GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/gedit.schemas | grep auto_detected

returns

Attached schema `/schemas/apps/gedit-2/preferences/encodings/auto_detected' to key `/apps/gedit-2/preferences/encodings/auto_detected'
Installed schema `/schemas/apps/gedit-2/preferences/encodings/auto_detected' for locale `C'
in Japanese.

But it should be locale `ja' not `C'?

Revision history for this message
Sebastien Bacher (seb128) wrote :

> So I do not think this problem was fixed.

that's why the bug didn't get closed, did you read previous comment? "When the gettext attribute are there the descriptions are translated correctly but still not the default schemas value (using the karmic version on Robert's update)"

> But it should be locale `ja' not `C'?

No, the C schemas is used and the translation should be get over gettext

Revision history for this message
Sebastien Bacher (seb128) wrote :

The gconf part is fixed, the remaining one is too much schemas stripping in cdbs during the builds

Changed in cdbs (Ubuntu Karmic):
assignee: nobody → Martin Pitt (pitti)
milestone: none → ubuntu-9.10
Changed in gconf (Ubuntu Karmic):
assignee: Robert Ancell (robert-ancell) → nobody
status: Confirmed → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

gettext is not being used for the default values to avoid loading extra files

Martin Pitt (pitti)
Changed in cdbs (Ubuntu Karmic):
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cdbs - 0.4.59ubuntu3

---------------
cdbs (0.4.59ubuntu3) karmic; urgency=low

  * Do not strip locale specific default values from gconf schema files:
    - Add strip-schema.pl: Replacement for the previous seddery, which wasn't
      powerful enough to just remove <short>/<long> tags from non-C <locale>
      tags, but keep <default> values.
    - Makefile.am: Install strip-schema.pl into pkglibdir.
    - 1/rules/langpack.mk.in: Drop seddery, use strip-schema.pl instead.
    - LP: #443133

 -- Martin Pitt <email address hidden> Thu, 08 Oct 2009 19:12:51 +0200

Changed in cdbs (Ubuntu Karmic):
status: In Progress → Fix Released
Revision history for this message
Nobuto Murata (nobuto) wrote :

Sebastien, I apologize you for my behavior on #16 and #17.
I did not read carefully and could not understand your comment because of my poor English ability and techniqual knowledge.
So I misread the situation.

Revision history for this message
Nobuto Murata (nobuto) wrote :

Now released gconf and cdbs which versions supposed to fix this bug, but cdbs is a build tool.
When does this fix take effect for gedit auto-detecting failure?
Is it when updates of gedit or language-pack-gnome-ja-base are released?
Sorry in advance if I'm writing wrong things.

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 443133] Re: the gettext schemas translations are not being used

Nobuto MURATA [2009-10-09 19:07 -0000]:
> Now released gconf and cdbs which versions supposed to fix this bug, but cdbs is a build tool.
> When does this fix take effect for gedit auto-detecting failure?

A new GNOME point release is due next Monday, during which a lot of
the GNOME packages will be rebuilt, and get this fixed. The remaining
ones which have locale specific defaults shouldn't be many, and we can
easily do no-change uploads to get them rebuilt.

Martin

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.