Reputation: 1233
As part of internationalizing our application which is based on asp.net, c#, silverlight, XBAP, I'm evaluating approaches to start with. I'm having to chose between GNU gettext()(PO files) and Microsoft's resource(resx) based approach. So at this juncture, I'm trying to understand what is the best way to extract localizable strings from .cs files, aspx, ascx, xaml (silverlight) files to resource files(resx) automatically if I have to go the MS way.
I have below options in mind:
I know there has to be a bit of manual intervention, but any advise would help in choosing the right direction, between gettext()(gnu gettext() c# or fairlylocal or MS localization approach.
Upvotes: 4
Views: 3268
Reputation: 121
Both the approaches have pros and cons, lets discuss.
(GNU Gettext
) first, initial tweaking is required:
second, strings extraction has been taken care-of by FairlyLocal
itself.
third, translation of strings could be done in-house or outsourced as PO files are widely known by linguists
. fourth, rendering of a few UTF-8 chars (if any) depend on webfonts {eot (trident
), svg (webkit
, gecko
, presto
)}. fifth, locale needs to be maintained (like pa-IN
languageCode-countryCode
). sixth, several converters are available for PO files. seventh, the default logic will fall-back on default-locale (en-US) resources for the value. an issue, The .po files that the build script generates won't be UTF8 by default. You'll need to open them in POEdit (or similar) and explicitly change the encoding the first time you edit them if you want your translated text to correctly show special characters.
first, extraction of strings is pretty easy using Resource Refactoring Tool
. second, resgen.exe command-line tool could be used to make .resx files linguists
friendly.
resgen /compile examplestrings.xx.resx,examplestrings.xx.txt
third, Localization within .NET (not specific to ASP.NET Proper or ASP.NET MVC) implements a standard fallback mechanism. fourth, no dependency on GNU Gettext Utils
. fifth, can achieve localization from Strings
to Dates
, Currency
, etc. using CurrentUICulture and CurrentCulture. sixth, webfonts are recommended here too.
thanks.
Upvotes: 7