[Python-ideas] Fix the DRY problem (was Re: PEP 501 - i18n with marked strings)
Eric V. Smith
eric at trueblade.com
Fri Aug 14 15:05:46 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/13/2015 10:00 AM, Barry Warsaw wrote:
> On Aug 13, 2015, at 07:58 AM, Eric V. Smith wrote:
>
>> The one downside of this is that the strings that the translator
>> is translating from do not appear in the source code. The
>> translator would have to know that the string being translated
>> is: "My name is {0}, my dog's name is {1}"
>
> I think unfortunately, this is a non-starter for the i18n use case.
> The message catalog must include the source string as it appears in
> the code because otherwise, translators will not be able to
> reliably map the intended meaning to their native language.
> They'll have to keep a mental map between source string
> placeholders and numeric placeholders, and I am fairly confident
> that this will be a source of broken translations.
>
> Is there a problem with keeping the named placeholders throughout
> the entire stack?
I guess not. It complicates things in the non-translated case, but I
think it's probably all workable. I'll give it some thought.
But is that enough? I'm not exactly sure what goal we're trying to
achieve here. If it's to entirely replace the gettext module,
including things like ngettext, then I think it's not an achievable
goal, and we should just give up. If it's only to replace
gettext.gettext (commonly used as "_"), then I think there's hope.
Eric.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
iQEcBAEBAgAGBQJVzeeqAAoJENxauZFcKtNxYlQH/REa+PV0Rhsr3NMrNdzfsuw/
6kOL9CItiSqjTOit/nVPR56ZpkHuGTnVO0QMCUgUmPpzU4arP945OwZj/ObSh8Jm
QTAyho1El4riDAgA7qywxzij2Z3imtuBDEAwkp022WdjKbbQ3/I2mTG9d4mPHBQc
Sl9qMqPoPjKwoJzTahqWJ0vgxqQ+ZfjaXKzgv581GPJknp4KG5i5Zw/U5oDFj+Oh
tsvedi25qWN7iSR60cfAZ/2/WfidgwlGH8Bb1V3JYj7B59Zsvkcg7VVYhQSkQrc7
XXJXdFdgxUDH/OXiwQLxTsBJ0AjJah7ZTiq8LOeql9BgcLQMXV306JOIUWcqKa8=
=Jcwh
-----END PGP SIGNATURE-----
More information about the Python-ideas
mailing list