Ticket #55 (closed Defect: fixed)

Opened 1 year ago

Last modified 2 months ago

makepackage does not handle locale with @ in them

Reported by: bdoin Assigned to: taj
Priority: Medium Milestone: 1.3
Component: main Version: 1.2.4
Severity: Normal Keywords:
Cc:

Description

In GCompris we support the locale sr@Latn but it makes a warning at makepackage time: /usr/bin/makepackage: line 1600: DISPLAYNAME_sr@Latn=Obrazovni komplet GKompris : commande introuvable (invalid command in english).

Isak Savo believes the worst thing that could happen is that the sr speaking users will see the displayname in english.

The makepackage should be fixed to handle this - a valid fix would be to just strip the '@....' part of the locale name.

Attachments

strip-at-locale.2.diff (1.3 kB) - added by taj on 12/30/07 20:10:56.
strip @ symbol

Change History

12/30/07 16:12:38 changed by taj

I think the above patch should fix the problem. It strips the @ symbol from the meta keys. I think it works, but if someone could take a look at it and make sure it looks OK, that'd be great.

12/30/07 17:54:59 changed by isak

Hmm, I think this will result in that the translation for xx_YY@CHARSET won't be used - there's no conversion in the other end that will put back the @.

The patch will remove the warning, but it won't really fix the problem - that the user will see a non-translated string.

I think a better way would be to strip everything between '@' and '=', so that DISPLAYNAME_sr@Latn=Foo becomes DISPLAYNAME_sr=Foo.

12/30/07 20:10:56 changed by taj

  • attachment strip-at-locale.2.diff added.

strip @ symbol

12/30/07 20:12:55 changed by taj

Good catch Isak. I think the new patch does the correct thing. It creates an env file with the name apkg-environment.sr (along with .en) in the meta/ dir.

Does it look OK?

12/30/07 23:10:19 changed by taj

This bug also hits packages which use PackageDesktop to pull summary/displayname out of .desktop files. For example, Inkscape has a .desktop file like this:

Name[sr]=Inkscape - програм за векторско цртање
Name[sr@Latn]=Inkscape - program za vektorsko crtanje

Is one of the translations using unicode chars and the other using latin chars? Is it important to get both translations in a case like this, or is it "OK" just to use the unicode translation?

12/31/07 08:41:23 changed by isak

I don't think it's *that* important to retain the charset. IIRC, desktop files should be all UTF-8 anyway, and gettext (which handles the translation magic for applications) does conversion on its own.

Put the patch in, and then we'll have to look out for translation issues in the future.

12/31/07 16:29:50 changed by taj

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r2428.

01/02/08 12:56:18 changed by taj

  • status changed from closed to reopened.
  • resolution deleted.

Reopening as the patch is invalid. the @ marker is an "modifier," not an encoding marker: http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html

For example, transforming en_US@piglatin -> en_US is invalid.

08/03/08 14:45:59 changed by Jan-Nik

  • milestone set to 1.3.

Maybe the @ should be replaced with something like At_CHARACTER?

08/03/08 14:47:51 changed by Jan-Nik

Ups, i forgot the WIkiFormatting: __AT_CHARACTER__.

So that DISPLAYNAME_sr@Latn=Obrazovni would be DISPLAYNAME_sr__AT_CHARACTER__Latn=Obrazovni

08/17/08 17:09:33 changed by Jan-Nik

  • status changed from reopened to closed.
  • resolution set to fixed.

I fixed this in r2496. I tested it once and it seems to work.