[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gettext $"..."

From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: gettext $"..."
Date: Sun, 11 Mar 2012 02:09:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

Hello, all. Following discussion with Jordan Uggla it was found out that
current syntax of $"..." without variable expansion isn't enough for a
meaningful i18n and committing ourselves to it by releasing a version
with it would be counter-productive as later we'll need something better
but won't be able to remove something mostly useless. Since the bash
behaviour is unsafe due to variable expansion in translated strings. But
it's the very feature that is interesting for translation. There is
however a compromise by allowing in translated string only same
variables as in the original.This allows translator to rearrange
variables as he sees fit but in the same time makes it safe (basically
it's printf with reduced syntax and named tokens and without ability to
run over the end). Fortunately only betas were released with $"..."
feature and no project has used it for i18n yet. Attached patch
implements the described behaviour.
Variables $* and $@ can't be used inside $"...".
Can someone have a look, comment on approach and/or provide tests?

Vladimir 'φ-coder/phcoder' Serbinenko

Attachment: gettext.diff
Description: Text Data

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]