Skip to content

Commit 7595edb

Browse files
authored
docs: update log messages and comments in CellDataDemoHeadDataListener (#523)
- Translate log messages and comments from Chinese to English - Improve code readability and maintainability for international users
1 parent 8ec437d commit 7595edb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fastexcel/src/test/java/cn/idev/excel/test/demo/read/CellDataDemoHeadDataListener.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
import lombok.extern.slf4j.Slf4j;
99

1010
/**
11-
* 读取头
11+
* Read header
1212
*
1313
*
1414
*/
1515
@Slf4j
1616
public class CellDataDemoHeadDataListener implements ReadListener<CellDataReadDemoData> {
1717
/**
18-
* 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收
18+
* Store data to database every 5 records. In actual use, it can be 100 records, then clear the list to facilitate memory recycling
1919
*/
2020
private static final int BATCH_COUNT = 100;
2121

2222
private List<CellDataReadDemoData> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
2323

2424
@Override
2525
public void invoke(CellDataReadDemoData data, AnalysisContext context) {
26-
log.info("解析到一条数据:{}", JSON.toJSONString(data));
26+
log.info("Parsed one record: {}", JSON.toJSONString(data));
2727
if (cachedDataList.size() >= BATCH_COUNT) {
2828
saveData();
2929
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@@ -33,14 +33,14 @@ public void invoke(CellDataReadDemoData data, AnalysisContext context) {
3333
@Override
3434
public void doAfterAllAnalysed(AnalysisContext context) {
3535
saveData();
36-
log.info("所有数据解析完成!");
36+
log.info("All data parsing completed!");
3737
}
3838

3939
/**
40-
* 加上存储数据库
40+
* Save data to database
4141
*/
4242
private void saveData() {
43-
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
44-
log.info("存储数据库成功!");
43+
log.info("{} records, starting to save to database!", cachedDataList.size());
44+
log.info("Successfully saved to database!");
4545
}
4646
}

0 commit comments

Comments
 (0)