Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
So, I went into the Localization & Messaging Editor, created a new project and added a text value for testing. The key for the text value is "ParentTitle". I then generated teh xml files, and verified they are going to the correct location. In my InitApplication I have the following: SetActiveLanguage( "FactorSoft", 1033) MessageXmlPath = CtlCommonPath & "\Data" MessageKeyType = Messaging.MessageKeyDataType.XML MessageLocaleID = GetActiveLanguage("FactorSoft", UserName)The necessary imports have been put in to make it more readable. Since I only have one language set I shouldn't really need to do all of the Setting and Getting of ActiveLanguage, but I put it in there to make sure it is using the current LocaleID. All of this executes fine, but when it goes to retrieve the text value of "ParentTitle" it says "The specified key [ParentTitle] was not found within the localization database." Why is it looking in the database if I specified for it to look in the XML file? What did I do wrong?
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
Here is the Stack Trace: 8/16/2006 12:50:17 PM Source: MicroFour StrataFrame Base Message: The specified key [ParentTitle] was not found within the localization database. Stack: at MicroFour.StrataFrame.UI.Localization.RetrieveTextValue(String TextValueKey) at MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(ILocalizable ControlToSet) 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)
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
First, you do not need to call SetActiveLanguage. This is done in the GetActiveLanguage when settings the LocaleID. Next, make sure that the XML files are are deployed to the [CtlCommonPath & "\Data"] location.. Do you have two backslashes? Does the CtlCommanPath already have a backslash within in. Next, manually open the XML file labeled "MessageItems_1033.xml" and see if the key PackageFile exists within the table. FYI, whether it is coming from XML or the SQL Server database, it will still say "database."
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
I removed the call to SetActiveLanguage. I also checked my debug to make certain, but the path to the xml files is C:\Production\Data\. So, I am attaching the 2 xml files I have there. I see the ParentTitle key, but I see nothing about PackageFile...where would this come from?
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
Here are the XML files...I didn't see anything called MessageItems_Languages.xml Only Message_Languages.xml and Messages_1033.xml. Maybe this is the problem?
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
Typo....I didn't see anything called MessageItems_1033.xml
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Try this: MessageXmlPath = CtlCommonPath & "\Data" MessageKeyType = Messaging.MessageKeyDataType.XML MessageLocaleID = 1033 and see what happens... The SetActiveLanguage call isn't what actually sets the current langauge that the localization is going to use... I think it pulls up the editor so the end-user can choose the language, or something like that. The current language is chosen by the LocaleID property, so set that, set the MessageKeyType, and the XmlPath, and it should work. As for the XML files, they look fine, and the PackageFile Trent was talking about was probably a typo for "ParentTitle." Also, the exception's message is the same for if you're using XML files or the database, so don't worry about it. If you get that message, then the key couldn't be found for the language you're currently using.
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
I put in that code and i'm still getting the same message. It doesn't seem to be finding that ParentTitle field for some reason. I'm going to keep plugging away at it, but if you have any ideas let me know.
|
|
|
Andria Jensen
|
|
Group: Forum Members
Posts: 336,
Visits: 497
|
I'm still having no success getting this setup. It appears that the XmlPath is right, and I'm doing the following: Localization.MessageXmlPath = CtlCommonPath & "\Data" Localization.MessageKeyType = Messaging.MessageKeyDataType.XML Localization.MessageLocaleID = 1033 MsgBox(Localization.RetrieveTextValue("ParentTitle"))I still get an error on the Retrieve saying it can't find ParentTitle as a key. Is there possibly some step I'm leaving out when setting this up? You guys have the XML files I've created and they seem to be right. Is there anything else at all I can look at or try here?
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Well, you have everything configured correctly... what is the stack trace for the exception that is being thrown when that key is not found in the files?
|
|
|