-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add handling translation unit identifiers attributes - Improvement sourcecode - Improvement and extended README.md - Extended tests (spy tests for caching vs. create catalog)
- Loading branch information
Showing
26 changed files
with
657 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- main | ||
- stage | ||
- dev | ||
- feature/* | ||
# workflow_dispatch: | ||
jobs: | ||
tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/io/github/alaugks/spring/messagesource/xliff/catalog/xliff/Xliff2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.github.alaugks.spring.messagesource.xliff.catalog.xliff; | ||
|
||
import io.github.alaugks.spring.messagesource.xliff.catalog.CatalogInterface; | ||
import org.w3c.dom.Document; | ||
import org.w3c.dom.NodeList; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
final class Xliff2 extends XliffAbstract implements XliffInterface { | ||
private List<String> translationUnitIdentifiers = new ArrayList<>(List.of("id")); | ||
|
||
@Override | ||
public boolean support(String version) { | ||
return List.of("2.0", "2.1").contains(version); | ||
} | ||
|
||
@Override | ||
public void setTranslationUnitIdentifiersOrdering(List<String> translationUnitIdentifiers) { | ||
this.translationUnitIdentifiers = translationUnitIdentifiers; | ||
} | ||
|
||
@Override | ||
public void read(CatalogInterface catalog, Document document, String domain, Locale locale) { | ||
NodeList translationUnits = XliffParserUtility.getTranslationUnits(document, "segment"); | ||
this.readItems(catalog, domain, locale, translationUnits, this.translationUnitIdentifiers); | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
src/main/java/io/github/alaugks/spring/messagesource/xliff/catalog/xliff/Xliff20.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/main/java/io/github/alaugks/spring/messagesource/xliff/catalog/xliff/Xliff21.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.