Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Hiya. I'm getting the following when trying to localize a label control. I have embedded the exported XML files for the message store, but still looks like the key is being searched into the database. Before embedding, I've tried to deploy it via DDT, and the same was happening. a LocalizationKeyNotFoundException The specified key [teste1] was not found within the localization database. KeyNotFoundException The message key [teste1] could not be found in the localization data. Source : MicroFour StrataFrame Base Stack Trace: at MicroFour.StrataFrame.UI.Localization.ThrowKeyNotFoundException(String Key) at MicroFour.StrataFrame.UI.Localization.GetKeyRowFromXml(String Key) at MicroFour.StrataFrame.UI.Localization.RetrieveTextValue(String TextValueKey) at MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(ILocalizable ControlToSet) at MicroFour.StrataFrame.UI.Windows.Forms.Label.InitializeObject() at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects() at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Thanks for any help.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML This one I commented, as the help file states it's not necessary
MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("TestingDate") This one is there, pointing to my project. Second, have you right-clicked on your localization files and made sure that they are embedded? I went and right-clicked it, but didn't know what to check to see if it is embedded in the context-menu. But in the Properties sheet, the "Build Action" is set top "Embedded Resource"
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Could it be that my Messages table got a bit messed up?
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Try this just for grins...add this code to the InitApplication: MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(Reflection.Assembly.GetExecutingAssembly(),"Internal Path to the XML files")
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
That file is the languages file...not the message file  You can include them both. What files do you have embedded?
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Trent L. Taylor (11/09/2006)
Try this just for grins...add this code to the InitApplication: Did it ... got this: MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(Reflection.Assembly.GetExecutingAssembly(),"Internal Path to the XML files") ArgumentException The stream could not be evaluated because the resource could not be located. Source : MicroFour StrataFrame Base Stack Trace: at MicroFour.StrataFrame.UI.Localization.CreateDataTableFromStream(Stream Input) at MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(Assembly ContainingAssembly, String FullPath) at ProFilmeNET.AppMain.InitApplication(InitializingApplicationEventArgs e) in C:\ProFilme.NET\ClientDotNET\ProFilmeNETSolution\ProFilmeNET\AppMain.vb:line 181 at MicroFour.StrataFrame.Application.StrataFrameApplication.Raise_InitializingApplication(InitializingApplicationEventArgs e) at MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication() at ProFilmeNET.AppMain.Main() in C:\ProFilme.NET\ClientDotNET\ProFilmeNETSolution\ProFilmeNET\AppMain.vb:line 22 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Something must have gone wrong, because I have made this work in the past.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
You have to replace the second parm to the path where your XML files are embedded.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Trent L. Taylor (11/09/2006) You have to replace the second parm to the path where your XML files are embedded.I did it.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Is there a size limit for the path ? MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(Reflection.Assembly.GetExecutingAssembly(), "C:\ProFilme.NET\ClientDotNET\ProFilmeNETSolution\ProFilmeNET\Localization Files\Message_Languages.xml")MicroFour.StrataFrame.UI.Localization.RegisterEmbeddedXmlFile(Reflection.Assembly.GetExecutingAssembly(), "C:\ProFilme.NET\ClientDotNET\ProFilmeNETSolution\ProFilmeNET\Localization Files\Messages_1046.xml")
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Oh...this is your problem here...it is expecting the internal path to the XML files... how it is referenced within the assembly. This command should give you an array with all of your resource names as they appear within the assembly: Reflection.Assembly.GetExecutingAssembly.GetManifestResourceNames() Find the name of your localization files in there and then replace your paths.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
 Sorry for the trouble Trent. I thought it was the address. Now it worked fine! But only the labels. I'm trying to send a localized message for deletion, for example. So I created a message key in the Common Repository and set the AutoDeleteMessageKey to it. This one isn't showing up.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Is it not in the XML file that was created? If not, I will have to take a look at the common repository. You do have your project including the repository...correct? 
Please let me know if the repository items are not showing up and I will get it fixed for you
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
No, it is there, I open the .XML file and the message is there.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
So did you set the message to use on the form? You have to set the AutoDeleteMessageKey on the SF form...which from the sounds of it, you have already done....correct? To check and see if it is still using the AutoDeleteTitle property instead of the key, change the AutoDeleteTitle property to "Testing" ... you should never see testing....it should show the AutoDeleteMessageKey message.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
So did you set the message to use on the form? You have to set the AutoDeleteMessageKey on the SF form...which from the sounds of it, you have already done....correct? Correct. To check and see if it is still using the AutoDeleteTitle property instead of the key, change the AutoDeleteTitle property to "Testing" ... you should never see testing....it should show the AutoDeleteMessageKey message. Did it. It shows "Testing".
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
OK....I will have to look into this then. Thanks for the info.
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Thank you, Trent. And don't worry, we know it's Ben's fault.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
 Well at least you guys are learning
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Hi Trent. I found out what Ben did ...   I was using a "Message" key, where it should be a "Text Value" key. But one thing I still think is funny, when you have a Common Repository, the XML generated gets a bit mixed up. But I might find another Ben's mistake here ... hauhauhauhauhauhauhauhauhauha
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Well...it is important that you keep Ben in line...(even though I wrote that editor...he must have gone in and put in a gremlin or two ha ha  ) He'll be back in the office on Monday so I will have to quit blaming him
|
|
|