Skip to content

feat(l10n): Add es support#275

Merged
jy95 merged 25 commits intomainfrom
automated/l10n-translation-es
Jan 1, 2026
Merged

feat(l10n): Add es support#275
jy95 merged 25 commits intomainfrom
automated/l10n-translation-es

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 1, 2026

🌍 New Language Support: es

This automated PR adds FHIR translation support for the es locale.
Generated using Argos Translate with recursive ICU parsing to ensure structural integrity.


🛠️ Step 1: Registry & Integration

To activate this new locale, you need to manually register it in the following files:

  • publiccode.yml: Add the BCP 47 code es to the availableLanguages list.
  • DosageMarkdown.java: Add the new Locale to the supported list.
  • LocaleProviderBase.java: Include the locale in the test provider for coverage.
  • R4 AbstractFhirTest.java: Register for R4 validation.
  • R5 AbstractFhirTest.java: Register for R5 validation.

🔍 Step 2: Quality Review (Compare with Reference)

Verify translations in common/src/main/java/io/github/jy95/fds/common/l10n/:

Generated File English Reference (Original)
DosageFields_es.java DosageFields.java
EventTiming_es.java EventTiming.java
QuantityComparator_es.java QuantityComparator.java

🧪 Step 3: Technical Validation

  • Build: Run ./mvnw clean install -DskipTests to check for compilation issues.
  • Tests: Run ./mvnw test to ensure ListResourceBundle loads es correctly.
  • ICU Logic: Double-check that plural forms (one, other) and select blocks are correctly translated for this language.

Note: This PR is in draft mode. Please review the translation quality before merging.

Summary by CodeRabbit

  • New Features

    • Added Spanish language support for dosage translations, including medication dosage fields, event timing, quantity comparators, and related instructions.
  • Tests

    • Added comprehensive test coverage for Spanish locale across all dosage translation scenarios to ensure accurate Spanish-language output.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 1, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This pull request introduces Spanish (es) localization support by adding three new resource bundle classes for dosage terminology and updating 17+ test classes with Spanish locale test cases to validate translations.

Changes

Cohort / File(s) Summary
Spanish Resource Bundles
common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java, EventTiming_es.java, QuantityComparator_es.java
Adds three new ListResourceBundle classes containing key-value pairs for Spanish translations. DosageFields_es covers dosage field labels (rate, duration, frequency, period, bounds, count, event, max dose); EventTiming_es maps event timing codes (MORN, NOON, AFT, EVE, NIGHT, etc.) to Spanish; QuantityComparator_es provides comparator symbols ("<", "<=", ">=", ">", "ad").
Test Locale Extensions
common/src/test/java/io/github/jy95/fds/translators/Abstract(AdditionalInstruction|AsNeeded|Bounds.*|Count.*|DayOfWeek|Dose.*|Duration.*|Frequency.*|MaxDose.*|Offset.*|Period.*|Rate.*|TimeOfDay)Test.java
Extends 17+ test classes with Spanish locale branches. Each test method gains a new else-if condition for Locale.forLanguageTag("es") returning corresponding Spanish translation expectations (e.g., "Instrucción 1 e instrucción 2", "como se requiere para el dolor de cabeza", "por 3 días"), placed between English and French branches.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Hola, amigos! The languages dance,
From English to French, now Spanish's chance,
With DosageFields and EventTiming strings,
Translations take flight on localization's wings! 🌍✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.48% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(l10n): Add es support' clearly and concisely summarizes the main change: adding Spanish (es) localization support to the project.

Comment @coderabbitai help to get the list of available commands and usage tips.

@jy95
Copy link
Owner

jy95 commented Jan 1, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 1, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
common/src/test/java/io/github/jy95/fds/translators/AbstractTimeOfDayTest.java (1)

50-60: Missing Spanish locale branch in getExpectedSingleTimeText.

Spanish was added to getExpectedMultipleTimesText but not to this method. When tests run with the Spanish locale, this will fall through to the Dutch default ("om 15:00"), causing incorrect test assertions.

Add the Spanish branch for consistency:

Proposed fix
 private static String getExpectedSingleTimeText(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "at 15:00";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "a las 15:00";  // Verify correct Spanish translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "à 15:00";
     } else if (locale.equals(Locale.GERMAN)) {
         return "um 15:00";
     } else {
         return "om 15:00";
     }
 }
common/src/test/java/io/github/jy95/fds/translators/AbstractOffsetWhenTest.java (2)

37-47: Missing Spanish locale branch in getExpectedText1.

Spanish was added to getExpectedText3 but not to this method. When testWithWhenOnly runs with Spanish locale, it will fall through to the Dutch default, causing incorrect test assertions.

Proposed fix
 private String getExpectedText1(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "during the morning and during the night";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "durante la mañana y durante la noche";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "durant le matin et durant la nuit";
     } else if (locale.equals(Locale.GERMAN)) {
         return "während des Vormittags und über Nacht";
     } else {
         return "tijdens de ochtend en tijdens de nacht";
     }
 }

61-71: Missing Spanish locale branch in getExpectedText2.

Same issue: Spanish locale will fall through to Dutch default for testWithWhenAndCount.

Proposed fix
 private String getExpectedText2(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "1 hour and 30 minutes during the morning and during the night";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "1 hora y 30 minutos durante la mañana y durante la noche";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "1 heure et 30 minutes durant le matin et durant la nuit";
     } else if (locale.equals(Locale.GERMAN)) {
         return "1 Stunde und 30 Minuten während des Vormittags und über Nacht";
     } else {
         return "1 uur en 30 minuten tijdens de ochtend en tijdens de nacht";
     }
 }
common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsRangeTest.java (1)

99-161: Missing Spanish locale branches in getExpectedText1 through getExpectedText5.

Spanish was only added to getExpectedText6, but five other locale-dependent methods lack Spanish branches. Tests testBothLowAndHighWithoutUnit, testBothLowAndHighWithUnit, testOnlyHighWithoutUnit, testOnlyHighWithUnit, and testOnlyLowWithoutUnit will produce incorrect assertions for Spanish locale.

Proposed fix - add Spanish branches to all methods
 private static String getExpectedText1(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "for 1 to 3";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "por 1 a 3";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "pour 1 à 3";
 private String getExpectedText2(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "for 1 to 3 days";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "por 1 a 3 días";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "pour 1 à 3 jours";
 private String getExpectedText3(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "for up to 3";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "por hasta 3";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "pour 3 maximum";
 private String getExpectedText4(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "for up to 3 days";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "por hasta 3 días";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "pour 3 jours maximum";
 private String getExpectedText5(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "for at least 3";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "por lo menos 3";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "pour au moins 3";
common/src/test/java/io/github/jy95/fds/translators/AbstractFrequencyFrequencyMaxPeriodPeriodMaxTest.java (1)

73-95: Missing Spanish locale branches in getExpectedText1 and getExpectedText2.

Spanish was added to getExpectedText3 but not to the other two methods. testWithFrequencyOnly and testWithPeriodOnly will produce incorrect assertions for Spanish locale.

Proposed fix
 private String getExpectedText1(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "3 times";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "3 veces";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "3 fois";
     } else if (locale.equals(Locale.GERMAN)) {
         return "3 Mal";
     } else {
         return "3 keer";
     }
 }

 private String getExpectedText2(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "every 2 days";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "cada 2 días";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "chaque 2 jours";
     } else if (locale.equals(Locale.GERMAN)) {
         return "alle 2 Tage";
     } else {
         return "per 2 dagen";
     }
 }
common/src/test/java/io/github/jy95/fds/translators/AbstractDayOfWeekTest.java (1)

50-60: Missing Spanish locale branch in getExpectedSingleDayText.

Spanish was added to getExpectedMultipleDaysText but not to this method. When testSingleDayOfWeek runs with Spanish locale, it will fall through to the Dutch default ("op vrijdag"), causing incorrect test assertions.

Proposed fix
 private static String getExpectedSingleDayText(Locale locale) {
     if (locale.equals(Locale.ENGLISH)) {
         return "on Friday";
+    } else if (locale.equals(Locale.forLanguageTag("es"))) {
+        return "el viernes";  // Verify translation
     } else if (locale.equals(Locale.FRENCH)) {
         return "le vendredi";
     } else if (locale.equals(Locale.GERMAN)) {
         return "am Freitag";
     } else {
         return "op vrijdag";
     }
 }
🧹 Nitpick comments (1)
common/src/test/java/io/github/jy95/fds/translators/AbstractDoseRangeTest.java (1)

40-42: LGTM! Spanish locale support added correctly.

The implementation properly adds Spanish locale support with the expected range format "1 a 3". The conditional structure, locale comparison using Locale.forLanguageTag("es"), and placement are all appropriate.

Since the PR description mentions translations were auto-generated using Argos Translate, you may optionally want to verify the translation "1 a 3" with a native Spanish speaker to ensure it's the most natural phrasing in medical/pharmaceutical contexts, though "a" (to) is grammatically correct for ranges.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17a939d and 4199581.

📒 Files selected for processing (23)
  • common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java
  • common/src/main/java/io/github/jy95/fds/common/l10n/EventTiming_es.java
  • common/src/main/java/io/github/jy95/fds/common/l10n/QuantityComparator_es.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractAdditionalInstructionTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractAsNeededTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsDurationTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsPeriodTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsRangeTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractCountCountMaxTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractDayOfWeekTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractDoseRangeTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractDurationDurationMaxTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractFrequencyFrequencyMaxPeriodPeriodMaxTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractFrequencyFrequencyMaxTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractMaxDosePerAdministrationTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractMaxDosePerLifetimeTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractMaxDosePerPeriodTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractOffsetWhenTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractPeriodPeriodMaxTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractRateQuantityTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractRateRangeTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractRateRatioTest.java
  • common/src/test/java/io/github/jy95/fds/translators/AbstractTimeOfDayTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (17)
common/src/test/java/io/github/jy95/fds/translators/AbstractAdditionalInstructionTest.java (1)

53-55: LGTM!

The Spanish translation correctly uses "e" instead of "y" for the conjunction, which is grammatically correct in Spanish when the following word starts with "i" or "hi" (in this case, "instrucción"). The code structure follows the existing pattern consistently.

common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsPeriodTest.java (1)

101-103: LGTM! Spanish date formatting correctly added.

The Spanish locale branch correctly handles the start-date-only scenario with appropriate date formatting ("del 23 de mayo de 2011").

common/src/test/java/io/github/jy95/fds/translators/AbstractDurationDurationMaxTest.java (1)

88-90: LGTM! Spanish duration range correctly implemented.

The Spanish translation properly handles both duration and duration max values with appropriate formatting.

common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsDurationTest.java (1)

41-43: LGTM! Spanish bounds duration correctly added.

The Spanish locale handling is correctly implemented with appropriate translation.

common/src/test/java/io/github/jy95/fds/translators/AbstractRateQuantityTest.java (1)

40-42: LGTM! Spanish rate quantity correctly implemented.

The Spanish locale branch follows the established pattern and provides appropriate translation for rate quantity text.

common/src/test/java/io/github/jy95/fds/translators/AbstractTimeOfDayTest.java (1)

66-68: Verify Spanish time format consistency.

The Spanish expectation uses "15.00 horas" (period separator with "horas" suffix) while other locales use "15:00" (colon separator, no suffix). Ensure this matches the actual output from the Spanish resource bundle and is intentional.

common/src/test/java/io/github/jy95/fds/translators/AbstractMaxDosePerPeriodTest.java (1)

40-42: LGTM!

Spanish locale branch correctly added with appropriate translation for max dose per period.

common/src/test/java/io/github/jy95/fds/translators/AbstractOffsetWhenTest.java (1)

88-90: Spanish branch added correctly here.

common/src/test/java/io/github/jy95/fds/translators/AbstractBoundsRangeTest.java (1)

167-169: Spanish branch correctly added to getExpectedText6.

common/src/test/java/io/github/jy95/fds/translators/AbstractFrequencyFrequencyMaxPeriodPeriodMaxTest.java (1)

100-102: Spanish branch correctly added to getExpectedText3.

common/src/test/java/io/github/jy95/fds/translators/AbstractMaxDosePerLifetimeTest.java (1)

40-42: LGTM!

Spanish locale branch correctly added with appropriate translation for max dose per lifetime.

common/src/test/java/io/github/jy95/fds/translators/AbstractDayOfWeekTest.java (1)

66-68: Spanish branch correctly added to getExpectedMultipleDaysText.

common/src/test/java/io/github/jy95/fds/translators/AbstractAsNeededTest.java (1)

66-68: LGTM! Spanish locale branch added correctly.

The Spanish locale handling follows the existing pattern and is positioned appropriately in the conditional chain. Note that getExpectedText1 (lines 50-60) does not include a Spanish branch, which means Spanish locale tests for the boolean form will fall back to the default (Dutch). This partial coverage appears intentional.

Since the PR notes indicate translations were generated using Argos Translate, please verify the translation quality with a native Spanish speaker to ensure "como se requiere para el dolor de cabeza" accurately conveys "as required for head pain" in a medical/pharmaceutical context.

common/src/test/java/io/github/jy95/fds/translators/AbstractRateRatioTest.java (1)

147-149: LGTM! Spanish support added for the common rate ratio case.

The implementation correctly adds Spanish locale handling for the common case scenario. Note that methods getExpectedText1 through getExpectedText4 (lines 48-130) do not include Spanish branches, so those rate ratio test scenarios will fall back to the default locale.

Please verify that "a una tasa de 10 mg cada 2 ml" accurately translates the medical/pharmaceutical meaning of "at a rate of 10 mg every 2 ml" with a native Spanish speaker, as the PR indicates these translations were machine-generated.

common/src/test/java/io/github/jy95/fds/translators/AbstractCountCountMaxTest.java (1)

64-66: LGTM! Spanish locale added for count range scenario.

The Spanish branch is correctly implemented for the count range case. The single count scenario in getExpectedText1 (lines 49-59) does not have Spanish support and will fall back to the default locale.

Verify with a native Spanish speaker that "tomar 2 a 3 veces" appropriately conveys the pharmaceutical instruction "take 2 to 3 times" in Spanish-speaking regions, as translations were generated automatically.

common/src/test/java/io/github/jy95/fds/translators/AbstractPeriodPeriodMaxTest.java (1)

64-66: LGTM! Spanish locale support added for period range.

The Spanish locale handling is correctly implemented for the period range scenario. Note that getExpectedText1 (lines 37-47) does not include Spanish support, so the single period test will fall back to the default locale.

Please verify that "cada 2 a 3 días" accurately represents the medical instruction "every 2 to 3 days" in Spanish with a native speaker, as the PR indicates machine-generated translations.

common/src/test/java/io/github/jy95/fds/translators/AbstractRateRangeTest.java (1)

40-42: LGTM! Spanish locale support added correctly.

The Spanish locale branch is properly implemented and follows the established pattern. This file has complete Spanish coverage as it only has one expected text method.

Verify with a native Spanish speaker that "a una tasa de 1 a 3" accurately conveys the pharmaceutical meaning of "at a rate of 1 to 3" in Spanish, as translations were automatically generated per the PR description.

Comment on lines +56 to +58
{ "fields.count", "{0, plural, one{Toma. {0} tiempo} other{Toma. {0} veces}}" },
{ "fields.countMax",
"{maxCount, plural, one{Toma. {minCount} a {maxCount} tiempo} other{Toma. {minCount} a {maxCount} veces}}" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "*DosageFields*" | head -20

Repository: jy95/fds

Length of output: 423


🏁 Script executed:

cat -n common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java | head -70

Repository: jy95/fds

Length of output: 3708


🏁 Script executed:

# Check if there's an English version for comparison
find . -type f -name "*DosageFields*" -exec basename {} \;

Repository: jy95/fds

Length of output: 153


🏁 Script executed:

cat -n common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields.java | grep -A 5 "fields.count"

Repository: jy95/fds

Length of output: 477


🏁 Script executed:

# Check French version
cat -n common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_fr.java | grep -A 5 "fields.count"

Repository: jy95/fds

Length of output: 486


🏁 Script executed:

# Check German version
cat -n common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_de.java | grep -A 5 "fields.count"

Repository: jy95/fds

Length of output: 489


🏁 Script executed:

# Check Dutch version
cat -n common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_nl.java | grep -A 5 "fields.count"

Repository: jy95/fds

Length of output: 481


🏁 Script executed:

# Check frequency fields in all languages
echo "=== ENGLISH frequency ===" && grep -A 1 "fields.frequency\"" common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields.java
echo "=== FRENCH frequency ===" && grep -A 1 "fields.frequency\"" common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_fr.java
echo "=== GERMAN frequency ===" && grep -A 1 "fields.frequency\"" common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_de.java
echo "=== SPANISH frequency ===" && grep -A 1 "fields.frequency\"" common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java

Repository: jy95/fds

Length of output: 679


🏁 Script executed:

# Let me check if there are any comments or documentation about these translations
grep -r "Toma\|tiempo\|veces" common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java | head -20

Repository: jy95/fds

Length of output: 587


Fix Spanish translation terminology in count fields.

The translations have two issues:

  1. Remove the period after "Toma"—it's inconsistent with other language versions and with the pattern used in the parallel fields.frequency field.

  2. The singular form uses "tiempo" (time period) but plural uses "veces" (occurrences). In medical dosage context, use "vez" (instance) paired with "veces" for consistency: one{Toma {0} vez} other{Toma {0} veces}. This aligns with how other languages use single consistent terms ("fois" in French, "Mal" in German).

Note: The frequency fields (fields.frequency, fields.frequencyMax, fields.frequencyAndFrequencyMax) have the same "tiempo"/"veces" inconsistency and should be corrected as well.

🤖 Prompt for AI Agents
In common/src/main/java/io/github/jy95/fds/common/l10n/DosageFields_es.java
around lines 56-58, the Spanish translations use an extra period after "Toma"
and inconsistent singular/plural terms ("tiempo" vs "veces"); remove the period
after "Toma" and change the singular term from "tiempo" to "vez" so the plural
stays "veces" (e.g., one{Toma {0} vez} other{Toma {0} veces}), and apply the
same fixes to the parallel frequency fields (fields.frequency,
fields.frequencyMax, fields.frequencyAndFrequencyMax) to ensure consistent
terminology and punctuation across these entries.

Comment on lines +89 to +91
}
else if (locale.equals(Locale.forLanguageTag("es"))) {
return "3-5 veces";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent Spanish locale coverage across test helper methods.

The Spanish locale branch is added only to getExpectedText3, but the other two helper methods (getExpectedText1 at lines 38-48 and getExpectedText2 at lines 62-72) lack Spanish branches. This means testWithFrequencyOnly and testWithFrequencyMaxOnly will fall through to the default Dutch case when tested with Spanish locale, resulting in incomplete test coverage.

🔎 Proposed fix to add Spanish branches to all helper methods

For getExpectedText1:

     private String getExpectedText1(Locale locale) {
         if (locale.equals(Locale.ENGLISH)) {
             return "3 times";
+        } else if (locale.equals(Locale.forLanguageTag("es"))) {
+            return "3 veces";
         } else if (locale.equals(Locale.FRENCH)) {
             return "3 fois";
         } else if (locale.equals(Locale.GERMAN)) {
             return "3 Mal";
         } else {
             return "3 keer";
         }
     }

For getExpectedText2:

     private String getExpectedText2(Locale locale) {
         if (locale.equals(Locale.ENGLISH)) {
             return "up to 3 times";
+        } else if (locale.equals(Locale.forLanguageTag("es"))) {
+            return "hasta 3 veces";
         } else if (locale.equals(Locale.FRENCH)) {
             return "jusqu'à 3 fois";
         } else if (locale.equals(Locale.GERMAN)) {
             return "bis zu 3 Mal";
         } else {
             return "tot 3 keer";
         }
     }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
common/src/test/java/io/github/jy95/fds/translators/AbstractFrequencyFrequencyMaxTest.java
around lines 38-48, 62-72 and 89-91, the Spanish locale branch exists only in
getExpectedText3 (lines ~89-91) but is missing from getExpectedText1 and
getExpectedText2; add else-if branches checking
locale.equals(Locale.forLanguageTag("es")) to both getExpectedText1 and
getExpectedText2 and return the correct Spanish strings (matching the pattern
used in getExpectedText3) so Spanish tests no longer fall through to the
default/dutch case.

jy95 and others added 2 commits January 1, 2026 13:44
…ds_es.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ds_es.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@codacy-production
Copy link

codacy-production bot commented Jan 1, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (17a939d) 1563 1563 100.00%
Head commit (519a786) 3146 (+1583) 3146 (+1583) 100.00% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#275) 11 11 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

jy95 and others added 5 commits January 1, 2026 13:46
…g_es.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…g_es.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ds_es.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@jy95 jy95 marked this pull request as ready for review January 1, 2026 13:22
@jy95 jy95 merged commit c0c4029 into main Jan 1, 2026
20 checks passed
@jy95 jy95 deleted the automated/l10n-translation-es branch January 1, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant