[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bug] resgen misinterprets valid PO files
From: |
Bruno Haible |
Subject: |
[Pnet-developers] [bug] resgen misinterprets valid PO files |
Date: |
Thu, 18 Dec 2003 15:43:26 +0100 |
User-agent: |
KMail/1.5 |
Using pnet-0.6.0.
The resgen utility does not ignore "fuzzy" markers. Such markers are
part of lines starting with #, in PO files, and mean: "This translation
needs to be reviewed and corrected by a translator." Messages marked
with "#, ... fuzzy ..." therefore must not be put into .resources files
in a way that GetString could access.
=========================== hello.cs =============================
using System;
using System.Resources;
using System.Reflection;
class Hello {
static void Main() {
ResourceManager rm =
new ResourceManager("hello", Assembly.GetExecutingAssembly());
try {
Console.WriteLine(rm.GetString("Hello World!"));
} catch (InvalidOperationException e) { Console.WriteLine("<none>"); }
try {
Console.WriteLine(rm.GetString("Hello Dolly {0}"));
} catch (InvalidOperationException e) { Console.WriteLine("<none>"); }
try {
Console.WriteLine(rm.GetString("Anything"));
} catch (InvalidOperationException e) { Console.WriteLine("<none>"); }
}
}
============================= de.po ================================
msgid "Hello World!"
msgstr "Hallo Welt!"
#, csharp-format, fuzzy
msgid "Hello Dolly {0}"
msgstr "Hallo Welt!"
====================================================================
$ resgen de.po hello.resources
$ cscc -fresources=hello.resources hello.cs -o hello.exe
$ ilrun hello.exe
Hallo Welt!
Hallo Welt!
Look at the second output line. Expected:
$ ilrun hello.exe
Hallo Welt!
<none>
<none>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pnet-developers] [bug] resgen misinterprets valid PO files,
Bruno Haible <=