In order to build versions that have various language translations, I can call the builder-cli.exe with a parameter project.allowedLanguages.

How can I only place the needed translation files (for our application) which are listed in that parameter?

The file names are of the form where the xx matches the codes in allowedLanguages, i.e. English is, German is

It seems like it should be possible to only include these files that match the codes in the allowedLanguages list, but I'm not seeing a way to do it.

Thank you very much for any help you can offer.


asked 24 Jan, 15:01

surferwill's gravatar image

accept rate: 0%

Unfortunately it's not possible to conditionally add languages to the <customLanguageFileList>.

it's possible though to pack only the custom language files from the languages in the <allowedLanguages>by using the <foreach> action to iterate over the allowedLanguages property and copy the resulting files to a temporary folder, which can then be packed.

First in the <prebuildactionlist> you create a directory where the files will be copied.


... Then in the same <prebuildactionlist> you add a <foreach> action to iterate over the allowedLanguages property.

  <foreach values="${project.allowedLanguages}">

</prebuildactionlist> And ultimately you pack the files from your temporary folder /tmp/tempfiles:



The problem is that if the builder encounters a language in <allowedLanguages> that has no custom .lng file it will throw an error. A workaround for this would be to create an empty custom .lng file for every language your installer supports. InstallBuilder will ignore the empty .lng files and only apply the ones that have your custom strings.


answered 31 Jan, 12:12

Michiel's gravatar image

Michiel ♦
accept rate: 19%

edited 31 Jan, 12:13

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 24 Jan, 15:01

Seen: 149 times

Last updated: 31 Jan, 12:13