Skip to content

Commit

Permalink
write translated columns and to levels
Browse files Browse the repository at this point in the history
  • Loading branch information
jflamy committed Feb 18, 2025
1 parent 0c25760 commit 1736082
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.LoggerFactory;

import app.owlcms.i18n.Translator;
import ch.qos.logback.classic.Logger;

public class TechnicalOfficialWriter {
Expand All @@ -35,7 +36,28 @@ public static InputStream write() {
String[] headers = {"LastName", "FirstName", "Level", "IWFId", "Federation", "FederationId"};
for (int i = 0; i < headers.length; i++) {
Cell cell = headerRow.createCell(i);
cell.setCellValue(headers[i]);
switch (headers[i]) {
case "LastName":
cell.setCellValue(Translator.translate("LastName"));
break;
case "FirstName":
cell.setCellValue(Translator.translate("FirstName"));
break;
case "Level":
cell.setCellValue(Translator.translate("TechnicalOfficials.Level"));
break;
case "IWFId":
cell.setCellValue(Translator.translate("TechnicalOfficials.IWFId"));
break;
case "Federation":
cell.setCellValue(Translator.translate("TechnicalOfficials.Federation"));
break;
case "FederationId":
cell.setCellValue(Translator.translate("TechnicalOfficials.FederationId"));
break;
default:
cell.setCellValue(headers[i]);
}
cell.setCellStyle(headerStyle);
}

Expand All @@ -46,7 +68,7 @@ public static InputStream write() {
Row row = sheet.createRow(rowNum++);
row.createCell(0).setCellValue(official.getLastName() != null ? official.getLastName() : "");
row.createCell(1).setCellValue(official.getFirstName() != null ? official.getFirstName() : "");
row.createCell(2).setCellValue(official.getLevel() != null ? official.getLevel().toString() : "");
row.createCell(2).setCellValue(official.getLevel() != null ? Translator.translate("TOLevel."+official.getLevel().toString()) : "");
row.createCell(3).setCellValue(official.getIwfId() != null ? official.getIwfId() : "");
row.createCell(4).setCellValue(official.getFederation() != null ? official.getFederation() : "");
row.createCell(5).setCellValue(official.getFederationId() != null ? official.getFederationId() : "");
Expand Down

0 comments on commit 1736082

Please sign in to comment.