﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Editing Localisation Messages in Application's SQL Database</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 10:34:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Editing Localisation Messages in Application's SQL Database</title><link>http://forum.strataframe.net/FindPost9487.aspx</link><description>G'day&lt;P&gt;I'm working on developing a system that will be sold overseas, potentially into countries where english is not the main language. It also deals with an industry where local nomenclature can be very different,&amp;nbsp;and we believe&amp;nbsp;it is important that the end-user is able to customise the terms used in the system&amp;nbsp;(ie Localisation text values and messages) to match their usage.&lt;/P&gt;&lt;P&gt;For this reason we have decided to use the application's database to hold the Localisation Tables. I've written an editor that alows the text values and messages to be edited from there, however I'm having a slight problem with the messages. When I change one of the parameters of a message I can see that my editor saves that change to the database, but when I try to test the message as follows I don't get what I expect:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[codesnippet]Private Sub btnMessageItemTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMessageItemTest.Click&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Me.PrimaryBusinessObject.IsDirty Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.PrimaryBusinessObject.Save()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageForm.ShowMessageByKey(BoMessageItemMessage1.msg_key, "P0", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10", "P11", "P12", "P13", "P14", "P15", "P16", "P17", "P18", "P19", "P20")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Back into editing mode&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Edit()&lt;BR&gt;End Sub[/codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;I get a dialog displayed, but the most recent change (or in fact any since the editor was opened) is not reflected. Is there a cache of the messages that I need to refresh somehow, or have I got something a little (or totally) confused?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;I have the MessageLanguages and MessageItems tables in the application database (Unchanged from the definition in the Strataframe database, except for the addition of defaults on some columns). &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Any advice greatly appreciated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Peter&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 13 Jun 2007 08:53:27 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item><item><title>RE: Editing Localisation Messages in Application's SQL Database</title><link>http://forum.strataframe.net/FindPost9537.aspx</link><description>Good to hear :)</description><pubDate>Wed, 13 Jun 2007 08:53:27 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Editing Localisation Messages in Application's SQL Database</title><link>http://forum.strataframe.net/FindPost9524.aspx</link><description>Thanks Ben&lt;/P&gt;&lt;P&gt;Worked perfecty.&lt;/P&gt;&lt;P&gt;The other problem with setting language, you had already sorted out for me (&lt;A href="http://forum.strataframe.net/Topic7964-10-1.aspx"&gt;http://forum.strataframe.net/Topic7964-10-1.aspx&lt;/A&gt;) with some updated dlls, but I have since inadvertantly reverted to the old ones.&lt;/P&gt;&lt;P&gt;Peter</description><pubDate>Tue, 12 Jun 2007 19:22:01 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item><item><title>RE: Editing Localisation Messages in Application's SQL Database</title><link>http://forum.strataframe.net/FindPost9491.aspx</link><description>Yes, there is a cache of the values within the application.&amp;nbsp; It is faster to cache the values in a dictionary than to retrieve them every time from the database.&amp;nbsp; There is not an explicit ClearCache() method, but you can clear the cache by setting the MessageLocaleID just like you did in your code sample.&amp;nbsp;&amp;nbsp;I wouldn't call the GetActiveLanguage() again, just do this:&lt;/P&gt;&lt;P&gt;Localization.MessageLocaleID = Localization.MessageLocaleID&lt;/P&gt;&lt;P&gt;It will do this in the Setter of that property:&lt;/P&gt;&lt;FONT color=#0000ff size=1&gt;&lt;P&gt;[codesnippet]Set(ByVal value As Integer)&lt;BR&gt;_MessageCodePage = value&lt;BR&gt;'-- Clear out the cache&lt;BR&gt;Try&lt;BR&gt;_MessageCache.Clear()&lt;BR&gt;_TextValueCache.Clear()&lt;BR&gt;Catch ex As Exception&lt;BR&gt;End Try&lt;BR&gt;'-- Set the button localized values&lt;BR&gt;Try&lt;BR&gt;SetActiveLanguageButtonText(value)&lt;BR&gt;Catch&lt;BR&gt;End Try&lt;BR&gt;End Set[/codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=1&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 12 Jun 2007 09:01:30 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Editing Localisation Messages in Application's SQL Database</title><link>http://forum.strataframe.net/FindPost9488.aspx</link><description>G'day again,&lt;P&gt;I just realised that I need to change language to that of the Message I'm attempting to test. It's not the solution to my problem and my attempt to change language doesn't&amp;nbsp;work properly either, but the code snippet should look more like this:&lt;/P&gt;&lt;P&gt;[code]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; btnMessageItemTest_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.Object, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; btnMessageItemTest.Click&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Save Bo if necessary&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.PrimaryBusinessObject.IsDirty &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/FONT&gt;&lt;FONT size=2&gt;.PrimaryBusinessObject.Save()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Change language to that used by the current "Message", test "Message", and put language back how it was.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim&lt;/FONT&gt;&lt;FONT size=2&gt; my_lang &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT size=2&gt; = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MicroFour.StrataFrame.UI.Localization.SetActiveLanguage(MicroFour.StrataFrame.Data.ConnectionManager.ApplicationKey, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CType&lt;/FONT&gt;&lt;FONT size=2&gt;(BoMessageItemMessage1.msg_language, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Integer&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MicroFour.StrataFrame.UI.Localization.WriteApplicationDataToDisk()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageForm.ShowMessageByKey(BoMessageItemMessage1.msg_key, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P0"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P1"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P2"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P3"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P4"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P5"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P6"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P7"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P8"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P9"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P10"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P11"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P12"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P13"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P14"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P15"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P16"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P17"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P18"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P19"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"P20"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MicroFour.StrataFrame.UI.Localization.SetActiveLanguage(MicroFour.StrataFrame.Data.ConnectionManager.ApplicationKey, my_lang)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MicroFour.StrataFrame.UI.Localization.WriteApplicationDataToDisk()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Back into editing mode&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Edit()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/code]&lt;P&gt;Any ideas?</description><pubDate>Tue, 12 Jun 2007 03:21:55 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item></channel></rss>