Krypton Toolkit localization issue - localization

I am using componentfactory krypton toolkit. I am trying to apply localization to it, but it does not work. I have tried normal button and kryptonbutton at same form, and applied below code. Normal button will localize , but kryptonbutton does not . Does KryptonToolkit support localization ?
Below is my code:
For Each c As Control In Me.Controls
Dim crmLang As ComponentResourceManager = New ComponentResourceManager(GetType(Form1))
crmLang.ApplyResources(c, c.Name, New CultureInfo(Language)) 'Set desired language
Next c

Related

Lotusscript - Printing a Notes-Document with NotesUIDocument.Print does not work as documented

I want to print Notes-documents directly to an pdf-printer. The documents are selected in a view. I do not want to open the printer dialog form.
Using the "NotesUIView.Print"- method works in principle, however, the generated pdf-documents sometimes look not exactly like the Notes-documents (especially regarding tables).
Therefore I tried to use the "NotesUIDocument.Print" - method:
Option Public
Option Explicit
Const pdfAppName = "PDF-XChange Standard"
Dim dc As NotesDocumentCollection
Dim curDoc As NotesDocument
Dim uidoc As NotesUIDocument
Dim workspace As New NotesUIWorkspace
...
Set dc = curDB.UnprocessedDocuments
...
Set curdoc = dc.GetFirstDocument
Call workspace.EditDocument(False,curDoc)
Set uidoc = workspace.Currentdocument
Call uidoc.Print(1,0,0,False,pdfAppName)
...
Dispite the first parameter in "uidoc.print" is set to "1" the printer dialog form opens. In the printer dialog form the printer "PDF-XChange Standard" is selected correctly. Selecting the "OK"-Button prints the document correctly.
Many thanks in advance for hints.

How change app language in real time?

I am working on an app which runs in 2 languages, English and Persian (farsi). So user can select his desired language and app is displayed in that language. What should I do?
Depends on what are your trying to achieve, there is an approach that might be useful to your case, which is:
Declare a global variable which should represents the key of the current used language in the app, call it appLanguageKey String -for example-:
var appLanguageKey = "english"
Create a datastore for storing both languages desired caption for each term, it might looks like (contains):
term_key term_english term_farsi
greeting_key Hello Hoi
bye_key Bye Doei
For now, you could get the desired value if you tried to do:
desiredTerm = "select term_\(appLanguageKey) where term_key = 'greeting_key'"
Consider it as pseudo-code, the condition should be similar to it.
By implementing such a function that returns a string (I will assume that it is: getDesiredCaption(_ termKey: String) -> String in the following code snippet), you will be able to automatically set the desired caption for any UI component, just call it in viewWillAppear method the view controller:
override func viewWillAppear(_ animated: Bool) {
.
.
.
label.text = getDesiredCaption("greeting_key")
// Since that 'appLanguageKey' global viriable is "english",
// the output should be "Hello"
.
.
.
}
All you have to do for changing the language of the app is to change the value of appLanguageKey to "farsi".
For another approach which related to the Internationalization and Localization, you might want to check this answer, it should affect the app to let its navigation to be from right to left.
Hope this helped.
First you should use realm, magical records or an API to store what the user picks. Then you could create your own type of localizeable string handeler, by having an array with 2 dictionaries 1 with english and 1 with persian that all the texts in your application will read from just as you do with a normal localizeable.

How to force BE users to paste as plain text in TYPO3 6.x?

CMS users tend to paste anything into CMS text editors. To prevent website destruction - and as log as there's no non-wysiwyg editor (like markitup) for TYPO3, I would like to as least have some good old "force plain text paste" in place.
TYPO3's RTE has a button "pastetoggle, pastebehaviour, pasteastext". But I haven't managed to configure it so it's always active.
Also, there's an extension ad_rtepasteplain, but it produced no result in TYPO3 6.1.
Is there a usable way to implement paste-as-plain-text for TYPO3 6.x?
[EDIT]
I found (for user TSConfig)
setup.default.rteCleanPasteBehaviour
setup.override.rteCleanPasteBehaviour
as well as (for page TSConfig)
buttons.pastetoggle.setActiveOnRteOpen
buttons.pastetoggle.hidden
... none of which I got running yet. If that's the way to go: is there a working tutorial?
Got it. This is my current setup
RTE.default {
enableWordClean = 1
removeTrailingBR = 1
removeComments = 1
removeTags = center, font, o:p, sdfield, u
removeTagsAndContents = link, meta, script, style, title
hidePStyleItems = h5,h6,pre,address,div
// buttons
showButtons = chMode, formatblock, insertcharacter, removeformat, unorderedlist, orderedlist, outdent, indent, link, copy, cut, paste, showhelp, about,line, bold,pastetoggle, pastebehaviour, pasteastext
buttons.pastetoggle.setActiveOnRteOpen = 1
buttons.pastetoggle.hidden = 1
}
as well as setup.override.rteCleanPasteBehaviour=pasteStructure or plainText in user TSConfig

Unable to change say voice in Tropo MVC

I'm using the Tropo MVC classes and have a problem with changing the voice in the say. Setting the voice property of the say object does not seem to change the voice for example:
Say say1 = new Say("This is first voice");
say1.Voice = "susan";
Say say2 = new Say("This is the male voice");
say2.Voice = "dave";
List<Say> sayList = new List<Say>();
sayList.Add(say1);
sayList.Add(say2);
Script.Ask(null, null, new Choices("[1 DIGIT]", "dtmf", "#"), null, strArgs, true, sayList, Convert.ToSingle(action.Timeout));
The voice does not change. In fact it appears that the only way to change the voice is to set Script.Voice = "voice" which doesn't work for me as I have to handle language select in the first Ask which requires English voice followed by French voice.
Tropo also supports SSML, which is a super powerful markup language for mixing voices and adjusting voice tempo/cadence.
You can mix voices in a single Say command by doing something like:
new Say("<?xml version='1.0'?><speak>For English please press 1.<voice name='Carlos' xml:lang='es'>para el espaƱol por favor pulse 2</voice></speak>")
The inline XML is kinda yukkie but it gets the job done and learning SSML will allow you to create some really professional-sounding apps.

DynamicUpdateCommand stops working after QlikView restart

I'm using DynamicUpdateCommand inside a macro in this way:
sub addOrder
set choosen = ActiveDocument.Fields("NUMORD").GetPossibleValues
for i = 0 to choosen.Count - 1
set result = ActiveDocument.DynamicUpdateCommand("UPDATE * SET CHOOSE = 'S' WHERE NUMORD = '" & choosen.Item(i).text & "' " )
if result = false then
MsgBox result.ErrorMessage
end if
next
end sub
Dinamic Data Update is enabled.
It works, but, when I close QlikView and reopen it, it doesn't work anymore. Even if try reloading.
I empirically realized that to make it work again I need to click the "Save" button, even without changing anything...
How can I solve this little issue? Maybe is it connected with RAM and way of saving .qvw file to the file system?
Many thanks!
Without any other solution I ended with this workaround, which saves the document programmatically on document opening:
Document Properties... > Triggers > Document Event Triggers > OnOpen > Add Action(s)... > Add > External > Run macro > set Macro name = reactivateDynamicUpdateCommand
Tools > Edit Module...: add this subroutine:
sub reactivateDynamicUpdateCommand
' I know, it's weird
'... but needed to reactivate DynamicUpdateCommand functionality after a restart
ActiveDocument.Save
end sub
It works, though a better solution would be preferred.
Starting from version 11 Dynamic Update can be done as Actions rather than through VB macro. It is preferable to use Actions when possible. However, sometimes even using Dynamic Update action I noticed freezes similar to what you described. I ended up adding one more dummy action right after Dynamic Update (e.g. assigning a value to dummy variable or adding Selection -> Back action to compensate triggering OnSelect).

Resources