J
Jean-Luc M.
Hi,
Anyone have an example to use this translation tool with C# please ?
Thanks,
Anyone have an example to use this translation tool with C# please ?
Thanks,
Anyone have an example to use this translation tool with C# please ?
Jean-Luc M. said:Anyone have an example to use this translation tool with C# please ?
I will strongly recommend that you use the .NET way of doing
I18N in a .NET app.
compared to GNU gettext?
I am not sure .NET's strength, but I know about gettext's weaknesses.
The major one: the English text is the key.
And that does not work.
In Latin languages (and not only) the one and the same English
word is translated differently for labels/titles (descriptions)
vs. buttons/radio buttons (action/commands)
Example: "Print" in French is "Impression" or "Imprimer"
Since you can only have one key in the gettext dictionary, and that
is "Print", you cannot translate it in several ways, depending on
context. Same problems for many other reasons: "Scan" is translated
differently if it is about scanning the disk vs. scanning a piece of
paper, many things in English can be both verbs and substantifs, etc.
Then you have gender, number, case.
So, crappy quality by design, guaranteed.
The manual for GNU gettext (as well as a link to the latest version of
it) can be found on the GNU Web site:
http://www.gnu.org/software/gettext
The manual shows you how to use it with C, Java, and C# (and possibly
more languages than that, I don't know). In any case, it also comes
with the C# code that you need to access gettext translation files.
The hard part isn't using the translations, really, it's creating them
in the first place. The same utilities are used for that, though,
regardless of what (computer programming) language you're using.
--- Mike
Calling the function in the dll doesn't seem to raise any
errors/exceptions, but doesn't seem able to find the translation
(e.g. in French) either. Perhaps due to an error in calling the dll
(any further initialization needed before performing the call?) or
something to do with the structure of my files in the local
sub-folders? Any input would be greatly appreciated!
Michael said:Might I ask why? What's the strength of .NET's built-in way of i18n
compared to GNU gettext?
That it is what the future maintenance programmer will know.
the section on preparing program strings for translation.
The major
reason for using an English key is that there's no real advantage to
having a surrogate key that would be used in its place.
FWIW,
surrogate keys are far overused everywhere in programming these days.
I don't see how this solves anything.
It is not that you don't have the info (solved by comments)
It is that you have both situations in the same application.
Imagine a dialog with the title "Print" and a button (in the same
dialog) with the text "Print". And a menu option "Print"
The button must be translated as "Imprimer" and the title "Impression"
It does not help that you have comments.
The message catalog can only have one key, and that is the English
string "Print". Haw do you map from one to many?
They are used (not quite enough) because they solve real problems.
The gettext looks like it solves the localization problems for lazy
programmers that don't understand how other languages work.
But it does *guarantee* bad quality for the results.
- Localization goes beyond plain text
Many other elements must be changed: fonts, font sizes (for
languages like Chinese, Japanese, Korean), UI should be mirrored (for
languages like Arabic, or Hebrew), sometimes colors or images.
- The size of the forms should change to fir the size of the new text
Michael said:Eh, I suppose. There is a good chance that a programmer that has been
around for a while is going to also have encountered GNU gettext, since
it's overwhelmingly popular outside of the confines of Windows,
though.
If I were to guess at how many C# programmer that have experience
with gettext, then I would guess as <2%.
It is not a very widely used tool.
character to "tag" such differences, and then mark in the comments
which instance is which.
There are other ways you can accomplish the
task, as well---it just takes a little bit of imagination.
The *other* solution would be to use more free-standing text in things
like window titles and menu actions. IMHO, using "Print" for a dialog
title and a menu item is rather silly.
And if you don't like either, then you can use "Print…" as the key
for the menu item (since it ought to have an ellipsis anyway) and
"Print" for the dialog title.
There are three quick solutions, and I am sure that there are many,
many more to choose from given a little bit more thought on the issue.
This problem is solved by using fonts which support the entire Unicode
spectrum,
or by using a system that will handle automatic
font-switching for you.
If the system has good support for i18n, it'll
automatically handle RTL text (and even LTR/RTL mixed text) as part of
the toolkit.
maybe programmers who haven't a clue what GNU software is don't use it,
but that doesn't mean it's not very widely used. Virtually all free
and open source software that is internationalized uses gettext. And
you'd probably be surprised how much GNU software there is around you.
Really?
Can you point me to something in the gettext documentation that
explains this technique?
This is what you do in your code, for every localizable string?
Remember: gettext was desined for plain C, the keys are C strings
(char*), so they are not Unicode. Same as the typical C source.
And can you give me a list of such Unicode characters?
How many of tham can you give me?
Are they enough to eliminate duplicated keys in a big software?
(let's say 400.000 words)
This is a kludge around gettest bad design.
Exactly my point.
Thing is, as a developer you have no clue what every language
requires. Titles/buttons was just an example of what can go wrong.
Scan (Scan disk vs Scan paper) is usually translated differently,
because they have different meanings, not because of the context.
English:
New
Spanish:
Nuevo (masculine singular)
Nuevos (masculine plural)
Nueva (feminine singular)
Nuevas (feminine plural)
Every language has it's own characteristics.
If you translate your application in 30 languages, you don't want to
"fix" you English keys every time you receive a bug report.
Just tink about it: translate into 30 languages, you get a but report
for language 31, you change a key and update all 30 language catalogs.
If all are as bad as the 3 ones, don't bother.
Ok, I will stop here.
I work in localization and internationalization for more than 11
years, and I have seen hundresd of projects from tens of companies.
Stuff translated in tens of languages, on a lot of the platforms
out there (from Win and Mac to Palm OS), using every standard
solution, and quite a few non standard "quick solutions".
You listen, fine, you don't fine again.
I have nothing to loose.