473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Me vs. VS2003 IDE: Killing my satellites softly

Hello board,

I just started looking into C# - programming and find it quite applicable for very rapid development scenarios. But the handy
support that the IDE provides has now run me into problems with localization.

I started out very simple with a form called MainForm that is displayed but disabled. This form immediately starts a second form
called "LoginDialog" which contains the usual labels, textBoxes and buttons. It connects to a SQL-Server database to verify login
credentials and - if appliciable - after a couple of seconds closes itself and enables MainForm. The LoginDialog contains a label
which initially contains no text but - after successful login - displays a string like "Welcome" and some user-information fetched
from the database. If the login credentials cannot be verified against the database it shall display a failure message like e.g.
"Wrong username and/or password".

So far all this worked pretty fine and could be created within very short time with the IDE. Then, I started localizing the from and
that's where I encountered a dead-end.

To localize I first used the IDE by making the LoginDialog-form localizable, switching the Language-property of the form and setting
different values to the Text-properties of the elements. I could observe how the IDE created resource-files like e.g.
"MyApp.LoginDialog.resources", "MyApp.LoginDialog.fr.resources" in the project directory, created subdirectories like "fr" and in
there the "MyApp.resources.dll" satellite-assembly. Within the InitializeComponents()-method in the LoginDialog-class the IDE uses
the ResourceManager(type)-constructor to create a Resource Manager of type "LoginDialog". All this works out well.

But now I would need some extra localized variables (e.g. for the Welcome-string or the failure-message mentioned above) which do
not appear as elements within the form. First, I tried to be clever and to add some values to the .resources-files with WinRes.exe.
But every time I touch the form in the designer-view the .resources-file is built anew and my entries are gone. Next, I tried to
build my own .resources-files with the entries for the necessary variables, compile them with Al and place the satellite-assemblies
in the correct subdirectory. But since the names of the files have to follow a strict convention I suppose that my DLLs are
overwritten by the IDE upon building the project (the IDE of course follows this convention).

The question is now: How can I add localized variables to my form which are not elements (controls or components) of the form? Of
course throughout a localized application you need more variables (mostly strings) localized than just the controls or components
within the forms.

Is it the only possibility to set the form in the designer to not localizable (which removes all resp. code from
InitializeComponents), delete the auto-generated .resources and .dll-files, then create my own .resources-files and assemblies, use
my own Resource Manager within InitializeComponent() and manually set the properties of all elements in the form? In this case it
would be very tedious to incorporate all the localized information for the controls (like button-size, -position ...) in my own
assemblies manually. The IDE does a very good job here but it will be useless if I cannot add my own localized variables.

Maybe someone has a clue on how to solve this problem.

Best regards
Rolf

Nov 17 '05 #1
3 1486
One correction to my former description:

I did not open the IDE-created .resources-files with WinRes or ResEditor (which both will not work on IDE-created .resources-files)
but I edited the .resx-files directly from within the IDE. Upon building these will be overwritten by the IDE based only on the
elements within the form.

Regards
Rolf
Nov 17 '05 #2
Additional information:

I just tried what I described in the first post (setting the form to not localizable and creating a satellite assembly by myself).

But even in this case I can see, that the MyApp.resources.dll in the fr-subdirectory is overwritten by the IDE upon building the
project.

Now I tried the following:

I built the project (resources are aquired by ResourceManager(typeof(LoginDialog)).

Then I used Al to recreate the MyApp.resources.dll in fr-subdirectory from MyApp.LoginDialog.fr.resources. This file contains only
one value I defined myself. In LoginDialog it is set as text-property of one label. I also copied MyApp.resources.dll to the
bin\Debug\fr-directory.

I then manually started MyApp.exe from the bin\Debug-directory, but the self-defined value could not be found, the label had no
text.

Starting MyApp.exe from the obj\Debug-directory was successful: The label had the correct text defined in my .resources-file, all
other elements fell back to the invariant language like they should.
Can anyone explain to me what that means and how I should deal with this?

Thanks
Rolf
Nov 17 '05 #3
Well, still waiting for some answers or questions...

But I can provide for an update:

As described in the other Thread ("Me vs. VS2003 IDE Part 2) I can now (at least symptomatically) explain how the MyApp.exe's in
bin\Debug-directory and obj\Debug-directory differ in behaviour. To cut it short: It is about the MyApp.exe.config-files (for
details see other Thread).
What I have tried regarding the problem of localizing variables of a form which are not controls or components is the following:

Modifying the .resx-files with XML-editor is one way, but it is a very hard restriction that afterwards you are not allowed to
change the language-property of the form to avoid overwriting your own amendments to at least the .resx-file of the currently
selected language.

Regarding localization the documentation suggests that you first finish developing your application an then e.g. pass the neutral
..resx-file to a localizing vendor. If I would follow this path I would develop only in neutral language, then add localized
information by changing the language-property of the form and finally edit the localized .resx-files before building the release.

But I think that it is very hard to figure out a point where you can say: "I will surely never alter any details of my applicaton".
If I follow this path, after providing my own localization information to the .resx-files the application is "shut" and I can never
change or add any elements which are localized because then I would have to change the form's language-property and all my entries
in the various .resx-files would be lost.

Since I found it not applicable to CREATE satellite-assemblies with my own resources (because they are overwritten by IDE at
building the project) I tried to ADD my own resources-information to the IDE-generated satellite-assemblies.

I found that this will work out (at least for all localized languages but not for the neutral language).

AFTER building the project I use "Al /link" instead of "Al /embed" and simply add my self-created .resources-files (they can be
named anything as I found out) to the IDE-generated MyApp.resources.dll's in the various language-subdirectories.

Of course, rebuilding the project will revert the satellite-assemblies to the IDE-generated form but I can always add my part of
resources after building the project this way whenever I like. Thus, the application is never "shut".

I regard this as a very inconvenient way of localizing variables being no control or component within a form but it seems to be the
only one.

Still, I have to figure out how to add localization-values of such variables to the neutral language since for this the IDE does not
use a MyApp.resources.dll (within the project directory) but simply the .resources-files.
Best regards
Rolf
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rolf Molini | last post by:
Hello everybody, I put this in a separate thread because altough it is connected to the localization-problem in my former thread this is a completely different "joke" of the IDE. While waiting...
3
by: Jeff F | last post by:
I've got a MFC solution that appears to cause the VS2003 IDE to lockup when attempting any of the aforementioned actions. I've tried deleting ..ncb and .aps files with no effect. Any help is...
14
by: Dennis | last post by:
I have a form that had a button called but_Edit which had it's visible property set to False. I have been working on an applicaiton using this form for some time and all was going well and it ran...
39
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software...
2
by: Carlo \(MCP only\) | last post by:
Hi to all I'm askyng you a suggestion about the best way to share the same source code between VS2003 and VS2005. The project I'm developing is a controls and components library, and the...
5
by: Tony | last post by:
Hi all, Here's the link to the issue we were seeing on our ASP.NET system when modifying, adding and deleting directories in framework 2.0....
2
by: holysmokes99 | last post by:
I am developing a component in .Net 1.1, and want to debug it using the "start external program" of the debugger in the IDE. The program I want to start references both 1.1 and 2.0 components. The...
3
by: David Wilkinson | last post by:
Apart from the loss of the ClassWizard for MFC work, the thing I have disliked most about the VS2003 IDE is that I have never been able to arrange the windows in a way that I like. I have just...
13
by: active | last post by:
With VS2005 the windows form designer uses the files *.Designer.vb I hope no one at MS is reading this because I know it will upset them to know - I like the old way better! I've been looking...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.