Skip to content

Commit

Permalink
Fixes issue with setting Language Index
Browse files Browse the repository at this point in the history
Closes #50
  • Loading branch information
lukaszlenart committed Dec 15, 2016
1 parent 8e3fa6c commit fde4553
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/main/java/com/akathist/maven/plugins/launch4j/VersionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ public class VersionInfo {
String originalFilename;

/**
* Language to be used during installation
* Language to be used during installation, default ENGLISH_US
*/
String language;
String language = LanguageID.ENGLISH_US.name();

/**
* Trademarks of author
*/
String trademarks;

/**
* Index of language to be used during installation
* Index of language to be used during installation, default index of ENGLISH_US
*/
int languageIndex;
int languageIndex = LanguageID.ENGLISH_US.getIndex();

net.sf.launch4j.config.VersionInfo toL4j() {
net.sf.launch4j.config.VersionInfo ret = new net.sf.launch4j.config.VersionInfo();
Expand All @@ -115,22 +115,18 @@ net.sf.launch4j.config.VersionInfo toL4j() {
ret.setCompanyName(companyName);
ret.setInternalName(internalName);
ret.setOriginalFilename(originalFilename);
ret.setLanguage(LANGUAGE_TO_LANGUAGE_ID.get(language));
if (isLanguageIndex()) {
ret.setLanguageIndex(languageIndex);
}
setLanguage(ret);
ret.setTrademarks(trademarks);

return ret;
}

private boolean isLanguageIndex() {
for (LanguageID languageID : LanguageID.values()) {
if (languageID.getIndex() == languageIndex) {
return true;
}
private void setLanguage(net.sf.launch4j.config.VersionInfo ret) {
LanguageID languageID = LANGUAGE_TO_LANGUAGE_ID.get(language);
if (languageID != null) {
ret.setLanguage(languageID);
ret.setLanguageIndex(languageID.getIndex());
}
return false;
}

@Override
Expand Down

0 comments on commit fde4553

Please sign in to comment.