StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


12»»

Setting up LocalizationExpand / Collapse
Author
Message
Posted 08/16/2006 12:47:07 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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?

Post #2203
Posted 08/16/2006 12:50:31 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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)

Post #2204
Posted 08/16/2006 12:51:06 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
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."

Post #2205
Posted 08/16/2006 1:02:27 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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?
Post #2206
Posted 08/16/2006 1:04:32 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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?
Post #2207
Posted 08/16/2006 1:05:14 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
Typo....I didn't see anything called MessageItems_1033.xml
Post #2208
Posted 08/16/2006 3:02:00 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 2 days ago @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
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.


www.bungie.net
Post #2211
Posted 08/18/2006 3:55:32 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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.
Post #2290
Posted 08/21/2006 10:35:00 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 08/21/2008 11:49:01 AM
Posts: 303, Visits: 435
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?