only include language files listed in project.allowedLanguages



1 comment

  • Avatar

    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.

    Comment actions Permalink

Please sign in to leave a comment.