Add-In that prompt the user if the translation contain invalid character



With the information i received with my last question i now want to create an add-in that prompt the translator if there is an invalid character in the translation or in the validation of a translation. Check the first photo to see what I want to show the user. I've tried to use the TokenCheck component but there is nothing happening when I change change the translated string. See second photo to see my TokenCheckComponent. I then chose to use the translation component but it is only working when I use the "translate", "pre-translate' and "find fuzzy translations' tools. See third photo to look at my TranslationComponent. I finally tried the event component but I had nothing showing up on in the log. See the fourth photo to look at the EventComponent. Is this possible to show a warning after the user pressed "enter" to change a token from the stringList?

P.S : I found that the there is no GetToken() method in the CPAITranslation class from the .Net Reference documentation and there is no method description in the .Net documentation for the OnTokenEvents() method from the Event Component. The method is present in the .dll but not in the documentation.

3 Replies Latest Replies: 7 Mar 2017 8:21 AM by Achim Herrmann
  • Without going into detail I would suggest to implement a checking utility using PAIFN_CheckToken(). This callback function was exactly designed for the use case you have. You can even automatically correct the string if possible. All other approaches will not work. From a usability point of view I would never implement it using a message box as it will distract the translators.

    Each token that is confirmed by the user will be checked immediately (which is the default setting) and an exclamation mark icon will be displayed in front of the erroneous entry.
  • The problem is solved. I used the wrong add-in type. To use the TokenCheck, the addin.type in the addin initialization need to be set to AddinType.Tools and I declared a ToolComponent class with the getToolInfo() and ToolExecute functions. See the image below