|
|||
|
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Text from inherited userdefined Control can't be translated ...Bug in Sisulizer?
|
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| Text from inherited userdefined Control can't be translated ...Bug in Sisulizer? - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
FredyWenger Member
|
Environment: - Visual Basic / Visual Studio 2008 / Windows XP / Sisulizer Enterprise I have maked a userdefined Control with a Label (with defaul Text), two Text-Boxes and some custom Propertys and Functions. Then i placed the UDC a 5 times on a Test-Form. Then i can change the default Text of the Label with the custom propertys at Design-time to the Values (Text) i need. The new Text is displayed properly at Design-time and - after compilation - at Run-time. The UDC and the Test-Form are both set to "Localizable = True" If i then load the Ressources from the .exe in Sisulizer, i only see the default-Text from the UDC (5 times) on the Test-Mask (not the values that i have changed at Design-Time). Is this a Bug in Sisulizer or is there any solution for this problem? Help please
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Markus.Kreisel Administrator
|
Hi, I don't know how you named your properties. Perhaps they do not have standard names. Then it helps to add them under Tools- Platforms - Windows Forms|WPF - Properties. Hope this helps Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Can you send me the .resx file of the form what contains your controls. Click Private Upload to send it. Jaakko
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Thank you for the .resx file. I did not contain the property strings. Make sure that you have added Localizable attribute in those properties that you want to localize. If you do not add the attribute Visual Studio does not store the property value into .resx but hard codes it into the .cs file. [Localizable(true)] public int MyProperty { get { // Insert code here. return 0; } set { // Insert code here. } } Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Nieminen Administrator
|
My previous message contains C# same. You seem to use VB. Here is VB sample <Localizable(True)> _ Public Property MyProperty() As Integer Get ' Insert code here. Return 0 End Get Set ' Insert code here. End Set End Property
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Can you check this. Open Test_HilfstabellenWerte.Designer.cs into VS and open InitializeComponent function. From there try to locate "!WPF Eigenshaften setzen!". It should be there because it is not in .resx. Even you added the attribute VS does not rewrite .resx unles you force it to save (e.g. move a component a little bit and then move it back). After that VS saves the forms and it should save the property into .resx instead of .cs Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
Hy Jaako I don't find a File with the name "Test_HilfstabellenWerte.Designer.cs" Did you mean "Test_HilfstabellenWerte.Designer.vb" In "Test_HilfstabellenWerte.Designer.vb" i don't find the Text "!WPE..." Examples to one of the UDC -> Named "HilfstabellenWertAuslesen15/14": The Text to my Property P_LabelText is correct (see bold Statements) resources.ApplyResources(Me.HilfstabellenWertAuslesen15, "HilfstabellenWertAuslesen15") Me.HilfstabellenWertAuslesen15.Name = "HilfstabellenWertAuslesen15" Me.HilfstabellenWertAuslesen15.P_AuswahlKategorie = WPE.NET.HilfstabellenWertAuslesen.EKategorieAuswahl.Tarifbuchstabe_tTBs Me.HilfstabellenWertAuslesen15.P_LabelText = "Tarifbuchstabe" Me.HilfstabellenWertAuslesen15.P_Mussfeld = True Me.HilfstabellenWertAuslesen15.P_ReadOnly = True Me.HilfstabellenWertAuslesen15.P_Sprache = "" Me.HilfstabellenWertAuslesen15.P_Sprachfilter = WPE.NET.HilfstabellenWertAuslesen.ESprachfilterAuswahl.Benutzer_WPE Me.HilfstabellenWertAuslesen15.P_ZusatzBedingung = "" ' 'HilfstabellenWertAuslesen14 ' resources.ApplyResources(Me.HilfstabellenWertAuslesen14, "HilfstabellenWertAuslesen14") Me.HilfstabellenWertAuslesen14.Name = "HilfstabellenWertAuslesen14" Me.HilfstabellenWertAuslesen14.P_AuswahlKategorie = WPE.NET.HilfstabellenWertAuslesen.EKategorieAuswahl.Statuscode_tStC Me.HilfstabellenWertAuslesen14.P_LabelText = "Statuscode" Me.HilfstabellenWertAuslesen14.P_Mussfeld = True Me.HilfstabellenWertAuslesen14.P_ReadOnly = True Me.HilfstabellenWertAuslesen14.P_Sprache = "" Me.HilfstabellenWertAuslesen14.P_Sprachfilter = WPE.NET.HilfstabellenWertAuslesen.ESprachfilterAuswahl.Benutzer_WPE Me.HilfstabellenWertAuslesen14.P_ZusatzBedingung = "" I have changed the Object an the Test-Mask (add the udc a next time, modify the Property P_Label_Text, renew and recompile the project and import the .exe in Sisulizer. The new Object (named HilfstabellenWertAuslesen16" is showed in Sisulizer, but no Property P_LabelText:-( Thanks for your next response
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Sorry I made a mistake. I ment .vb and not .cs (I work with C# so sometimes I forgot how it is in VB).Me.HilfstabellenWertAuslesen15.P_LabelText = "Tarifbuchstabe" In the above code the property value has been hard coded into .vb file. This is why Sisulizer does not find it. Sisulizer only reads the resource file (.resx). in order to localize a string the string must be in .resx file. Can you recheck. If the other string ("!WPF Eigenshaften setzen!") is not in .vb or not in .resx is very odd. Where is it? Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
Hello Jaakoo Maybe we have maked a step foreward. I have renewed and compiled the Project a few times. Now i can't find the Text in the .designer.vb File Now i can find the Text in the .resx-File (see below) But... i don't see the Text in Sisulizer (import new.exe in sisuziler) I hope, there is only a little step to a Solution from now Text in Test_HilfstabellenWerte.resx: <value>44</value> </data> - <data name="HilfstabellenWertAuslesen15.Location" type="System.Drawing.Point, System.Drawing"> <value>84, 612</value> </data> - <data name="HilfstabellenWertAuslesen15.P_LabelText" xml:space="preserve"> <value>Tarifbuchstabe</value> </data>
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Can you send me the new .resx? Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
See private Upload
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Thank you for the file. Now Sisulizer scanned the P_LabelText properly. Select your source (.csproj or .resx) in the project tree and choose Components. Make sure that you have not disabled scaning of eny properties (green box). Also make sure that the active filter also includes the new items (red box) If this does not help please send you Sisulizer project file (.slp + .sds) to me. Jaakko Attachment: Untitled.png (Downloaded 35 times)
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
Hello Jaakko It do not work See private Upload.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Thank you for the sample. I start working on it. Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
I have maked a step forward - but the Chain-test failed . -> See private Upload. If we find a Solution, i paste the Solution for all Developers on Forum. Thanks for your good Support.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
I tested the project your set. You had disabled localization of P_LabelText To enable the property right mouse click the EXE file in the project tree and choose Components. Double click wpe.net.Hilf... Choose Properties sheet Select P_LabelText and click Remove. Click OK twice New time you scan the project Sisulizer scans P_LabelText properties. When I tested your EXE, Sisulizer correctly added localized P_LabelText values in the satellite assembly files. I could not run your application to check why .NET does not use the localized values. Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
FredyWenger Member
|
Hello Jaakko It do not work. See private Upload with all the relevant files. I hope we find a solution soon... Thanks a lot for your support.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
FredyWenger Member
|
Solution (now it works): Make sure, that the custom Property's that you want to translate have the attribute set (direct before the Property): <DescriptionAttribute("Description-Text at Runtime for the Developer"), _ CategoryAttribute("Category where to display the Property in the Property-Sheet to the UDC"), Localizable(True)> _ Public Property P_LabelText() As String ' Get Return _InternalVarible End Get Set(ByVal value As String) _InternalVarible = value End Set End Property Make sure, that all the Forms, on that you place the UDC hat set the Property Localizable to True. Don't overwrite the _InternalVarible in the UDC with own code (that was my mistake) Thanks a lot to Jaakko for the excellent Support
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Nieminen Administrator
|
This is related to the private message about importing Excel with context. Jaakko Attachment: Untitled.png (Downloaded 6 times)
|
||||||||||||||||
| |||||||||||||||||
| Current time is 08:11 am | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Text from inherited userdefined Control can't be translated ...Bug in Sisulizer? | |
Sisulizer software localization tool - Three simple steps to localize