|
right, it is there. but it is Resources internal class. And it is in namespace MyProject.Properties;
1) I've got Form1.es.resx for spanish Form1 localization. The MyProject.resources.dll is generated automatically under bin\es folder
2) How to add string based resource to that localization?
Which file I need to add and add to that spanish localization?
Чесноков
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:28am.
|
|
|
|
|
I understood to add Resourses.es.resx file and add strings to it, then read them from Resourses internal class.
But will they be put into corresponding ES folder MyApplication.Resources.dll upon compilation?
I need a model that once the application is compiled, adding new cultures will not need to recompile the application just add a new folder say DE, IT, etc...
Чесноков
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:28am.
|
|
|
|
|
Yes that worked!
So VS put the Resourses.es.resx into MyApplication.Resourses.dll under ES folder in bin directory
If I will need to add more cultures later (DE, IT, etc...) will it be sufficient just to compile those MyApplication.Resourses.dll files under new DE, IT folders and just copy them to the already installed application with one additional ES culture?
Чесноков
|
|
|
|
|
When localizing Win forms apps you would better use satellite assemblies.[^]They are used for localizing most of MS products like Silverlight.
Life is a stage and we are all actors!
|
|
|
|
|
I'm already using them (automatically generated with Forms GUIs)
Let's see if that link solves on my task on how to add strings resources to already generated Forms GUI resx
Чесноков
|
|
|
|
|
1) As I enabled localization and specified say GUI elements titles for ES langage, in bin folder, ES will be generated automatically, and satellite will be placed with GUI controls localization
2) I need to add custom strings as in the link you sent me to the same satellite
Have you tried that link yourself? If I generate those strings and build the satellite with strings, it will beb overwritten with GUI elements satellite.
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote:
Have you tried that link yourself?
Of course yes.
In order to put satellite assemblies to work for you first need to ensure that System.Threading.Thread.CurrentThread.CurrentUICulture matches to the spanish culture.According to the msdn this property is determinated with calling GetUserDefaultUILanguage from the Windows API.The UI language is the language used for all UI elements of the OS.The System.Threading.Thread.CurrentThread.CurrentCulture property is the default processes and threads culture.You can easy set it from the control panel/regional options.
To test your spanish translation just set System.Threading.Thread.CurrentThread.CurrentUICulture to spanish and don't worry to mush about default behavour of this property-it just depends on the user settings.
Life is a stage and we are all actors!
|
|
|
|
|
hello
i had download the code for Reverse Geocoding with C# and MapPoint 2009 and run the code in VisualStudio2005 compiler , but it give compilation error
"Retrieving the COM class factory for component with CLSID {31851F82-AFE6-11D2-A3C9-00C04F72F340} failed due to the following error: 80040154."
plz any one suggest me how to remove this error and run it.
N.B > it contains an MapPoint dll file 'Interop.MapPoint.dll'
waiting an response
regards
sadab
|
|
|
|
|
Hi,
I have thread which runs in a separate class and I wanted to modify the form controls from my thread class.
I saw lots of articles describing cross threading, but all are having the thread in the same class.
It would be very very helpful to me, if somebody can help me to solve this issue.
Thanks a lot in advance,
Shaheer
|
|
|
|
|
Use BeginInvoke and Endinvoke function
|
|
|
|
|
Hi,
here is my view[^] on the subject.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Good reference. I always use the self-marhsalling approach for any event handler that does not come in from MY event handlers as they may be running on an alternate thread. I much prefer BeginInvoke to Invoke to avoid blocking issues -- IMHO, BeginInvoke should be the default pattern unless there is reason to block the caller or there is some other reason why the calls need to be syncronized. Typical MVC scenarios don't require such coordination, an event happens, the UI handles it by posting a message to itself, and when it gets context, it updates itself.
|
|
|
|
|
vtpdawg wrote: IMHO, BeginInvoke should be the default pattern
I don't agree. When SetText() is the method to set a Control's Text property, and you call it from the main thread, it does not invoke a thing, and runs synchronously. Calling it from another thread should not behave differently. If synchronous operation is not guaranteed, then call it SetTextSynchronouslyOrAsynchronously!
vtpdawg wrote: I much prefer BeginInvoke to Invoke to avoid blocking issues
Delegating towards the main thread should never take long as in a well designed app the GUI is always responsive, hence the main thread itself basically does not block.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Sometimes you WANT your background thread to update a GUI object, and you KNOW there won't be any race condition. .NET has a convenient way of disabling cross-thread checking for a given class:
Label.CheckForIllegalCrossThreadCalls = false;
This disables the annoying cross-thread complaints from .NET (in this case for Label objects) when you know there won't be any conflicts.
|
|
|
|
|
... and wait for the app to break later long after you've finished it and can't work out why - It's easy enough to handle it the correct way so I see no point in taking this risk.
Dave
"My code works, but I don't understand why!" - DaveyM69 (Me) BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Note the qualifier, "...and you KNOW there won't be any race condition...".
|
|
|
|
|
Problem -: How to add an function in existing dll. For eg: Suppose 'Abc 'is a dll and is referenced in an xyz project, now i want to add function in 'Abc' dll such that i dont to rereference the xyz project.
|
|
|
|
|
I am not quite sure if I understand correctly.
I wonder if extension methods are what you are looking for. .NET 3.5 Extension methods are a way of adding functionality to an existing type.
Read more here
Cheers,
Daniel
|
|
|
|
|
Actually i don't have code of Abc dll and i want to add a function in that. and this Abc dll is referenced in my xyz project.
Now if i use extension method then i have to create separate namespace 'bcd' and then create a new extension method on that and then if i build my project a new dll will be created which i don't want.
|
|
|
|
|
Member 6392036 wrote: Now if i use extension method then i have to create separate namespace 'bcd'
Says who?
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:29am.
|
|
|
|
|
exactly i dont have any source code of that dll yet i want to add a function in that dll. how can i do that.
|
|
|
|
|
Without resorting to hacking the binary, you can't!
|
|
|
|