hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Localization of script messages

Hi,

localizing messages in AI is relatively easy. But what if the message originates in a user action? I created a few PowerShell scripts which may return error or other messages, and I'd love to use AI's localization mechanism so that I have all translated strings in the same dictionary file. How can I achieve this?

Thanks
Hans
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Localization of script messages

I found a solution. If you know a more elegant one, please comment.
  • In the PowerShell script, instead of using the hard coded message "File not found", I call (AI_GetMsiProperty MESSAGE_FILENOTFOUND). (Note that PowerShell syntax, depending on the situation, may require the parentheses around the call to AI_GetMsiProperty.)
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Localization of script messages

Hello Hans,

Thank you for your followup on this and for sharing your solution with us!

I am sure this will be of help for further users facing a similar scenario.

Also, your approach is indeed the correct one. :D

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”