Project

General

Profile

Actions

Bug #4899

open

xgettext(1) of shell scripts can generate invalid strings

Added by Rich Lowe over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2014-05-30
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

xgettext of kclient.sh will generate a msgid "Principal \\", which contains unbalanced quotes (because of the escape). The same is true of various other things.

It's not clear to me whether xgettext should be fixed, or the affected components should be using gxgettext or what. xgettext(1) does say it takes ANSI C input, which a shell script certainly isn't.

Actions #1

Updated by Rich Lowe over 9 years ago

the same is true of s10_boot.ksh with "Warning: \\" and and kclient.sh with the "Principal or policy already exists" message.

Actions #2

Updated by Rich Lowe over 9 years ago

GNU xgettext seems to just ignore these tokens entirely.

Actions #3

Updated by Garrett D'Amore over 9 years ago

xgettext is designed to extract strings from C programs. It can't possibly be expected to parse full shell syntax (which can get horribly ugly with some fairly ridiculous quoting rules.)

Advice to people writing programs which are to be internationalized is to move their strings to a simpler array or file with variable assignments rather than leaving the constant strings deeply embedded in the code.

I'd suggest closing this as not a bug, as arbitrary string extraction from shell scripts is not one of xgettext's functions.

Actions #4

Updated by Rich Lowe over 9 years ago

I'd rather leave it open to cover kclient and s10_* being broken, but requiring a fix other than to xgettext

Actions

Also available in: Atom PDF