Ian replied...
27-Oct-06 06:16 PM
I want to develop a class library in C++ that provides non-GUI
functionality.  Error detection is implemented using exceptions and I would
like the error messages to be supported in multiple languages.   VS2005
easily supports localization if window forms are used.   However, I would
like to develop and test the class library using a series of console
applications.  My question is, can a console application support
localization?  If so, how are the fallback resources defined because, by
default, a console application does not include, for example, a 'resx' file?

Thanks

Ian
Localization
(1)
Console
(1)
Application
(1)
Develop
(1)
Class
(1)
Library
(1)
Functionality
(1)
Error
(1)
  Bryan Phillips replied...
28-Oct-06 05:03 PM
VS2005 supports satellite assemblies which are language-specific
versions of your localized resources.  The localization provided by the
WinForms designer is not specific for WinForms.  I wrote a multi-lingual
app last year that was translated into 3 versions of Chinese, Russian,
French, and Spanish.

Look at the ResourceManager class in MSDN help for more information.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com
  Gerry Hickman replied...
28-Oct-06 06:50 PM
Hi Ian,


Non-GUI is good, people waste a lot of time on GUI apps instead of
separating the cross-platform standards-compliant back-end engine from
the UI it will eventually be displayed in, preferably a W3C compliant
web rendering surface that's runs on multiple platforms.


There are a lot of options from Microsoft depending on the libraries you
use with the app such as STL/MFC/ATL. I just had a look in the MSDN docs
and if you search for either "internationalization" or "localization"
you can get a lot of information (but most of it is for GUI apps). It's
hard to comment further because there were so many options. One thing I
have found works well with console apps is to stick to UNICODE, there
are then functions that can adapt themselves (without recoding) to
either UNICODE or ANSI just by changing a few #define's, you can use
*.RC files for resources...

--
Gerry Hickman (London UK)

.NET Framework - localization with console application?

Asked By Ian
29-Oct-06 11:08 AM
Hello Bryan,

This is very helpful information knowing that I will not be going off on a
wild goose chase.


Ian
help
about localization and satellite assemblies .NET Framework This is a small code snippet from a working program System.Text; using System.Windows.Forms; using System.Globalization; using System.Threading; namespace Wrox.ProCSharp.Localization { public partial class BookOfTheDayForm : Form { public BookOfTheDayForm(string culture) { if (culture ! = string.Empty) { CultureInfo ci 327444; textItemsSold.Text = itemsSold.ToString("###, ###, ###"); } } static class Program { / / / <summary> / / / The main entry point for the application. / / / < / summary> [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string culture = string.Empty; if (args.Length = = 1) { culture = args[0]; } Application.Run(new BookOfTheDayForm(culture)); } } partial class BookOfTheDayForm { / / / <summary> / / / Required designer variable. / / / < / summary> private System.ComponentModel just rely on it being loaded Pete public static void Trace(object sender, AssemblyLoadEventArgs args) { Console.WriteLine("Loaded: " + args.LoadedAssembly.Location); } public static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyLoad + = new one is before your form is created (at program.cs, in Main method before the Application.Run(. . ) line) and another at the very first line on your form constructor. Check the
christian-helle.blogspot.com .NET Compact Framework Discussions SQL Server 2008 (1) SQL Server (1) Application (1) Console (1) Database (1) Connect (1) Import (1) Export (1) No, SSMS 2005 does not support to SQL 2008, VS 2008 data tools work with SqlCE 3.5. - - Ginny Caughey Device Application Development MVP That's true. I created the database in VS 2008. I was just helle.blogspot.com Christian, I prefer SSMS myself, so I certainly understand. - - Ginny Caughey Device Application Development MVP As an alternative you could use the "Data Port Console" from PrimeWorks. It works with version 3.1 and 3.5 on the desktop, and the data grid, even though data queries work fine. TIA, Serge. http: / / www.apptranslator.com - Localization tool for your applications Serge, I don't know the inner workings of SSMS - only There is no Open Table menu for SSC databases in SSMS 2005. - - Ginny Caughey Device Application Development MVP Ginny, Thanks for your answer. Actually, I thought I had created a SSC probably a 3.1 indeed: I tried to open the DB using PrimeWorks Data Port Console and it complained. OTOH, I could not open a SSC 3.5 DB created with
Hello NG, is it possible, to localize the name of a anonymos type? In my application I am creating a list of anonymos typed sturcture like: var myObject = new { name = <aName a DataGridView which as the column header shows "name, age, . . ." Since I must localice my application, I would like to assigne the a localized string to myObject.<localized_name> . var myObject = new public void delegate for something not returning a value. . . Action<Film> printAFilm = 3D x = 3D> {Console.Write(x);}; / / now you can use LINQ notation for example. . . var ListOldFilms = 3D films.FindAll you on this issue. Jon's answer is exactly right. You shouldn't localize the application by using property names. They are fixed in compile time and you cannot change it Hello Hongye, thank you very much for your answer. Actually I am aware of the localization mechanismn. My problem is a different one. I am looking for a way to "flip Hello NG, is it possible, to localize the name of a anonymos type In my application I am creating a list of anonymos typed sturcture like: var myObject =
am wondewring if I should standardize or not ?? Thnanks, JIM C# Discussions Stopwatch.StartNew (1) Console.WriteLine (1) System.Diagnostics (1) String.Concat (1) String.Format (1) Console (1) Collect (1) Format (1) James, Using the + operator will be faster, as it will on whether you actually need to gain speed when concatenating strings (i.e. is your application performance critical) and then decided whether you should sacrifice code readability for a slight performance good arguments in favor of using string formatting. Bruce pointed out that anything that requires localization or similar need to provide alternative formatting strings is going to be much harder with 3D0; i < Iterations; i++) { string y = 3D "hello" + x + "there"; } long ms = 3D timer.ElapsedMilliseconds; Console.WriteLine ("Concat took: {0}ms", ms); GC.Collect(); timer = 3D Stopwatch.StartNew(); for (int i Iterations; i++) { string y = 3D string.Format("hello {0} there", x); } ms = 3D timer.ElapsedMilliseconds; Console.WriteLine ("Format took: {0}ms", ms); } } Results: Concat took: 2528ms Format took: 5536ms Jon Ah