Skip to content

Commit

Permalink
Ai translate only uesd strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-openai authored and aurambaj committed Dec 19, 2024
1 parent eeb70c1 commit 9fa6c7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.box.l10n.mojito.service.tm.search.TextUnitDTO;
import com.box.l10n.mojito.service.tm.search.TextUnitSearcher;
import com.box.l10n.mojito.service.tm.search.TextUnitSearcherParameters;
import com.box.l10n.mojito.service.tm.search.UsedFilter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
Expand Down Expand Up @@ -456,6 +457,7 @@ Function<RepositoryLocale, CreateBatchResponse> createBatchForRepositoryLocale(
textUnitSearcherParameters.setStatusFilter(StatusFilter.UNTRANSLATED);
textUnitSearcherParameters.setLocaleId(repositoryLocale.getLocale().getId());
textUnitSearcherParameters.setLimit(sourceTextMaxCountPerLocale);
textUnitSearcherParameters.setUsedFilter(UsedFilter.USED);
List<TextUnitDTO> textUnitDTOS = textUnitSearcher.search(textUnitSearcherParameters);

CreateBatchResponse createBatchResponse = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public void checkTMTextUnitIntegrity(Long tmTextUnitId, String contentToCheck)
try {
textUnitChecker.check(tmTextUnit.getContent(), contentToCheck);
} catch (IntegrityCheckException e) {
if (tmTextUnit.getPluralForm() != null && pluralIntegrityCheckerRelaxer.shouldRelaxIntegrityCheck(
tmTextUnit.getContent(),
contentToCheck,
tmTextUnit.getPluralForm().getName(),
textUnitChecker)) {
if (tmTextUnit.getPluralForm() != null
&& pluralIntegrityCheckerRelaxer.shouldRelaxIntegrityCheck(
tmTextUnit.getContent(),
contentToCheck,
tmTextUnit.getPluralForm().getName(),
textUnitChecker)) {
logger.debug(
"Relaxing the check for plural string with form: {}",
tmTextUnit.getPluralForm().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ public void testBasics() throws RepositoryLocaleCreationException {
public void testUploadTagToLocalDateTimeValid() {
LocalDateTime localDateTime = uploadTagToLocalDateTime("push_test_2024_11_21_18_55_38_004_502");
assertEquals(
"Parsed LocalDateTime does not match the expected value",
"2024-11-21T18:55:38.004",
localDateTime.format(DateTimeFormatter.ISO_DATE_TIME)
);
"Parsed LocalDateTime does not match the expected value",
"2024-11-21T18:55:38.004",
localDateTime.format(DateTimeFormatter.ISO_DATE_TIME));
}

@Test
Expand Down

0 comments on commit 9fa6c7b

Please sign in to comment.