Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
André Laugks committed Oct 17, 2024
1 parent 9a88264 commit 829e366
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void parseXliffDocuments(List<TranslationFile> xliffFiles)
.orElse(null);

if (xliffVersionObject != null) {
xliffDocument.getTransUnits(
xliffDocument.getTransUnitsMap(
xliffVersionObject.getTransUnitName(),
this.resolveIdentifiers(this.identifiers, xliffVersionObject).list()
).forEach((code, value) -> this.transUnits.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public XliffDocument(Document document) {
this.root = document.getDocumentElement();
}

public Map<String, String> getTransUnits(String transUnitName, List<String> transUnitIdentifiers) {
public Map<String, String> getTransUnitsMap(String transUnitName, List<String> transUnitIdentifiers) {
if (this.isXliffDocument()) {
return this.getNodes(
this.root.getElementsByTagName(transUnitName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void test_getXliffVersion() throws ParserConfigurationException, IOException, SA
void test_noXliffFile() throws ParserConfigurationException, IOException, SAXException {
var xliffDocument = new XliffDocument(this.getDocument("fixtures/no-xliff.xml"));

assertEquals(new HashMap<>(), xliffDocument.getTransUnits("segment", List.of("id")));
assertEquals(new HashMap<>(), xliffDocument.getTransUnitsMap("segment", List.of("id")));
assertNull(xliffDocument.getXliffVersion());
}

Expand All @@ -39,7 +39,7 @@ void test_getElementValue_getCharacterDataFromElement_TextNode()
throws ParserConfigurationException, IOException, SAXException {

var xliffDocument = new XliffDocument(this.getDocument("fixtures/xliff-value-test.xliff"));
Map<Object, Object> transUnits = new HashMap<>(xliffDocument.getTransUnits("segment", List.of("id")));
Map<Object, Object> transUnits = new HashMap<>(xliffDocument.getTransUnitsMap("segment", List.of("id")));

assertEquals("value", transUnits.get("element"));
assertEquals("value", transUnits.get("element-newline"));
Expand Down

0 comments on commit 829e366

Please sign in to comment.