-
Notifications
You must be signed in to change notification settings - Fork 475
feat(i18n): Add Croatian translation #2523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds Croatian language support across backend and frontend. Updates backend LANGUAGES, inserts “croatian” labels in multiple locale JSON files, introduces a new Croatian messages file, extends LOCALE_MAP with hr, and adds hr to Inlang project locales. No control-flow or logic changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/messages/en.json (1)
1-30
: Action required: complete Croatian i18n wiring
- All frontend/messages/*.json parse successfully; frontend/messages/hr.json exists and contains "english" and "croatian".
- frontend/messages/uk.json is missing the top-level "croatian" key — add the mapping/translation at frontend/messages/uk.json.
- No literal
"hr"
found in a repo-wide search; ensure "hr" is included in your locale lists/config (check frontend/project.inlang/settings.json, frontend/src/lib/utils/locales.ts, backend/ciso_assistant/settings.py) and add where missing.
🧹 Nitpick comments (20)
frontend/messages/el.json (1)
22-22
: Fix capitalization for consistencyUse title case like other language names in this file.
- "croatian": "κροατικά", + "croatian": "Κροατικά",frontend/messages/hu.json (1)
19-19
: Capitalize to match file’s styleLanguage names here use initial caps (e.g., Francia, Angol, Dán). Update to “Horvát” for consistency.
Apply this diff:
- "croatian": "horvát", + "croatian": "Horvát",frontend/messages/da.json (1)
19-19
: Capitalize to match file’s styleLanguage names are capitalized (Fransk, Engelsk, Dansk). Update to “Kroatisk”.
Apply this diff:
- "croatian": "kroatisk", + "croatian": "Kroatisk",frontend/src/lib/utils/locales.ts (1)
81-85
: hr added to LOCALE_MAP — LGTMKeys and flag align with other locales. Verify any places that enumerate supported locales (e.g., sidebar selector) include "hr".
Optionally expose a single source of truth for supported locales to reduce drift:
export const LOCALE_MAP = { … hr: { name: 'croatian', flag: '🇭🇷' } }; + +export const SUPPORTED_LOCALES = Object.keys(LOCALE_MAP) as const;frontend/src/lib/components/SideBar/SideBarFooter.svelte (1)
12-34
: Optional: add a type forlanguage
to catch missing entries at build time.Define as
Record<'english'|'croatian'|..., string>
or derive fromLOCALE_MAP
keys to get compile‑time safety.frontend/messages/hr.json (15)
271-271
: Fix month name typo.December should be “Prosinac”.
-"december": "Prosrinac", +"december": "Prosinac",
41-41
: Typos: “kontole” → “kontrole”.-"associatedReferenceControls": "Povezane referentne kontole", +"associatedReferenceControls": "Povezane referentne kontrole", -"referenceControlsColon": "Referentne kontole:", +"referenceControlsColon": "Referentne kontrole:",Also applies to: 73-73
75-76
: Consistent spelling: “primjenjene/Primjenjena” → “primijenjene/Primijenjena”.Standard Croatian uses “ij” (primijenjene). Update across affected strings.
-"appliedControls": "Primjenjene kontrole", +"appliedControls": "Primijenjene kontrole", -"appliedControlsStatus": "Status primjenjene kontrole", +"appliedControlsStatus": "Status primijenjenih kontrola", -"measuresToReview": "Primjenjene kontrole za pregledati", +"measuresToReview": "Primijenjene kontrole za pregled", -"noAppliedControlYet": "Još nema primjenjenih kontrola", +"noAppliedControlYet": "Još nema primijenjenih kontrola", -"theExistingAppliedControlsToManageThisRisk": "Postojeće primjenjene kontrole za upravljanje ovim rizikom", +"theExistingAppliedControlsToManageThisRisk": "Postojeće primijenjene kontrole za upravljanje ovim rizikom", -"riskScenarioMeasureHelpText": "Postojeće primjenjene kontrole za upravljanje ovim rizikom", +"riskScenarioMeasureHelpText": "Postojeće primijenjene kontrole za upravljanje ovim rizikom", -"effortHelpText": "Trud potreban za implementaciju primjenjene kontrole", +"effortHelpText": "Trud potreban za implementaciju primijenjene kontrole", -"costHelpText": "Trošak implementacije primjenjene kontrole", +"costHelpText": "Trošak implementacije primijenjene kontrole", -"appliedControlNoLink": "Primjenjena kontrola nema priloženi vanjski link. To će pomoći oko praćenja.", +"appliedControlNoLink": "Primijenjena kontrola nema priloženi vanjski link. To će pomoći oko praćenja.", -"requirementAssessmentNoAppliedControl": "Rezultat procjene zahtjeva je usklađeno ili djelomično usklađeno bez primjenjene kontrole.", +"requirementAssessmentNoAppliedControl": "Rezultat procjene zahtjeva je usklađeno ili djelomično usklađeno bez primijenjene kontrole.", -"duplicateAppliedControl": "Dupliciraj primjenjenu kontrolu", +"duplicateAppliedControl": "Dupliciraj primijenjenu kontrolu", -"createAppliedControlsFromSuggestionsHelpText": "Kreiraj primjenjene kontrole iz predloženih referentnih kontrola na temelju zahtjeva okvira", +"createAppliedControlsFromSuggestionsHelpText": "Kreiraj primijenjene kontrole iz predloženih referentnih kontrola na temelju zahtjeva okvira", -"createAppliedControlsFromSuggestionsSuccess": "Primjenjene kontrole uspješno kreirane iz predloženih referentnih kontrola", +"createAppliedControlsFromSuggestionsSuccess": "Primijenjene kontrole uspješno kreirane iz predloženih referentnih kontrola", -"createAppliedControlsFromSuggestionsError": "Došlo je do pogreške pri kreiranju primjenjenih kontrola iz predloženih referentnih kontrola", +"createAppliedControlsFromSuggestionsError": "Došlo je do pogreške pri kreiranju primijenjenih kontrola iz predloženih referentnih kontrola",Also applies to: 212-212, 220-220, 227-227, 291-291, 457-457, 485-486, 645-645, 651-651, 742-742, 822-824
123-123
: Typo in help text.-"referenceControlHelpText": "Ovo služi kao predložak te će pregaziti vrijednosti nekih polja (kategorija, CSF funckije, itd.)", +"referenceControlHelpText": "Ovo služi kao predložak te će pregaziti vrijednosti nekih polja (kategorija, CSF funkcije, itd.)",
426-426
: Typo: “njižnice” → “knjižnice”.-"libraryFileInYaml": "Datoteka njižnice u YAML formatu", +"libraryFileInYaml": "Datoteka knjižnice u YAML formatu",
905-905
: Typo: “geneiran” → “generiran”.-"enterCodeGeneratedByApp": "Unesite kod geneiran od strane authenticator aplikacije", +"enterCodeGeneratedByApp": "Unesite kod generiran od strane authenticator aplikacije",
958-958
: Typo: “Ovjde” → “Ovdje”.-"youCanSetPasswordHere": "Ovjde možete postaviti lozinku", +"youCanSetPasswordHere": "Ovdje možete postaviti lozinku",
915-915
: Typo: missing space in “za oporavak”.-"regenerateRecoveryCodes": "Regeneriraj kodove zaoporavak", +"regenerateRecoveryCodes": "Regeneriraj kodove za oporavak",
1556-1556
: Typo: “Utejcaj” → “Utjecaj”.-"impactISO": "Utejcaj", +"impactISO": "Utjecaj",
1582-1582
: Typo: “Moblini” → “Mobilni”.-"assetClassMobile": "Moblini", +"assetClassMobile": "Mobilni",
1612-1612
: Typo: “Proceduri” → “Procedure”.-"assetClassProcedures": "Proceduri", +"assetClassProcedures": "Procedure",
1164-1164
: Spelling: “Procjeni” → “Procijeni”.Croatian imperative uses “ij”.
-"ebiosWs2_2": "Procjeni RS/TO parove", +"ebiosWs2_2": "Procijeni RS/TO parove", -"ebiosWs5_4": "Procjeni i dokumentiraj preostali rizik", +"ebiosWs5_4": "Procijeni i dokumentiraj preostali rizik",Also applies to: 1174-1174
1290-1290
: Typo: “imatei” → “imati”.-"ebiosWs3_3_tooltip": "Morate imatei najmanje jednog dionika da bi definirali povezane sigurnosne mjere", +"ebiosWs3_3_tooltip": "Morate imati najmanje jednog dionika da bi definirali povezane sigurnosne mjere",
986-986
: Pluralization mismatch.
associatedDataRecipients
is plural; value should be plural too.-"associatedDataRecipients": "Povezani primatelj podataka", +"associatedDataRecipients": "Povezani primatelji podataka",
1703-1705
: Untranslated OIDC strings (optional).Consider translating these for consistency; leaving in English is acceptable if intentional.
-"clientSecretAlreadySetHelpText": "The client secret is already set.", -"resetClientSecret": "Reset client secret", -"oidcTokenAuthMethodHelpText": "Optional token endpoint authentication method. If omitted, a method from the server's auth token method list is used", +"clientSecretAlreadySetHelpText": "Tajni ključ klijenta je već postavljen.", +"resetClientSecret": "Resetiraj tajni ključ klijenta", +"oidcTokenAuthMethodHelpText": "Neobavezna metoda autentikacije za token endpoint. Ako se izostavi, koristi se metoda s popisa metoda poslužitelja.",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (25)
backend/ciso_assistant/settings.py
(1 hunks)frontend/messages/ar.json
(1 hunks)frontend/messages/cs.json
(1 hunks)frontend/messages/da.json
(1 hunks)frontend/messages/de.json
(1 hunks)frontend/messages/el.json
(1 hunks)frontend/messages/en.json
(1 hunks)frontend/messages/es.json
(1 hunks)frontend/messages/fr.json
(1 hunks)frontend/messages/hi.json
(1 hunks)frontend/messages/hr.json
(1 hunks)frontend/messages/hu.json
(1 hunks)frontend/messages/id.json
(1 hunks)frontend/messages/it.json
(1 hunks)frontend/messages/nl.json
(1 hunks)frontend/messages/pl.json
(1 hunks)frontend/messages/pt.json
(1 hunks)frontend/messages/ro.json
(1 hunks)frontend/messages/sv.json
(1 hunks)frontend/messages/tr.json
(1 hunks)frontend/messages/uk.json
(1 hunks)frontend/messages/ur.json
(1 hunks)frontend/project.inlang/settings.json
(1 hunks)frontend/src/lib/components/SideBar/SideBarFooter.svelte
(2 hunks)frontend/src/lib/utils/locales.ts
(1 hunks)
🔇 Additional comments (23)
frontend/messages/id.json (1)
19-19
: LGTM; optional wording check“Kroasia” matches the pattern used for other languages here. If you prefer the explicit form, consider “Bahasa Kroasia.”
frontend/messages/ur.json (1)
19-19
: LGTMTranslation looks correct and consistent with other entries.
frontend/messages/es.json (1)
19-19
: LGTM“croata” is correct; casing aligns with nearby entries in this file.
frontend/messages/ro.json (1)
19-19
: LGTM: Romanian label for Croatian addedValue and placement look consistent with nearby language entries.
frontend/messages/en.json (2)
23-23
: LGTM: English label for Croatian addedSpelling and placement are fine.
21-24
: AI summary mismatch: insertion pointThe AI summary says “after greek,” but the key is added after "turkish" (Line 22). No action needed—just noting the discrepancy.
frontend/messages/tr.json (1)
23-23
: Croatian label added — looks good“Hırvatça” is correct in Turkish and placement near other language labels matches the file’s pattern.
frontend/messages/hi.json (1)
19-19
: Croatian label added — looks good“क्रोएशियाई” is an appropriate Hindi label for Croatian.
frontend/messages/nl.json (1)
19-19
: Croatian label added — looks good“Kroatisch” is correct in Dutch; no issues spotted.
frontend/messages/de.json (1)
19-19
: Croatian label added — looks good“Kroatisch” is correct in German; addition aligns with the surrounding keys.
frontend/messages/fr.json (1)
23-23
: Approve — Croatian label added; verify all locales & align orderingCroatian translation is correct ("Croate" in frontend/messages/fr.json). Verified wiring: frontend/messages/hr.json ("Hrvatski"); frontend/src/lib/utils/locales.ts contains hr { name: 'croatian', flag: '🇭🇷' }; frontend/src/lib/components/SideBar/SideBarFooter.svelte maps croatian: m.croatian() and hr: 'Hrvatski'; frontend/project.inlang/settings.json includes "hr"; backend/ciso_assistant/settings.py contains ("hr","Croatian"). Verification incomplete: the automated check for presence of "croatian" in every frontend/messages/*.json failed to run — confirm every locale file includes the "croatian" key. Optional: normalize the insertion point of "croatian" across locale JSONs (e.g., place after "danish") for consistent diffs.
backend/ciso_assistant/settings.py (1)
385-386
: Croatian added to Django LANGUAGES — LGTMConsistent with frontend additions. Ensure compilemessages is run if backend strings for hr are present, else it will gracefully fall back.
frontend/messages/pt.json (1)
19-19
: Language label added — LGTM"croata" reads fine alongside existing labels.
frontend/messages/it.json (1)
19-19
: Language label added — LGTM"Croato" fits the pattern.
frontend/messages/sv.json (1)
19-19
: Language label added — LGTM"kroatiska" looks good.
frontend/messages/pl.json (1)
22-22
: Language label added — LGTM"Chorwacki" is correct.
frontend/messages/ar.json (1)
19-19
: Language label added — LGTM"الكرواتية" is appropriate.
frontend/project.inlang/settings.json (1)
24-25
: Locales list updated to include hr — LGTM; verification failed, re-run checksSandbox verification failed with "/bin/bash: line 10: !: command not found". Re-run JSON/key checks locally with the corrected script below:
#!/bin/bash set -euo pipefail missing=0 # 1) Validate frontend/messages JSON files for f in frontend/messages/*.json; do [ -e "$f" ] || continue if jq -e . "$f" >/dev/null 2>&1; then : else echo "Invalid JSON: $f" missing=1 fi done # 2) Ensure every locale file defines the "croatian" key for f in frontend/messages/*.json; do [ -e "$f" ] || continue if jq -e 'has("croatian")' "$f" >/dev/null 2>&1; then : else echo "Missing 'croatian' key in: $f" missing=1 fi done exit $missingfrontend/src/lib/components/SideBar/SideBarFooter.svelte (3)
32-34
: Croatian locale entry wired correctly.
m.croatian()
added and mapped inlanguage
— looks good.
58-60
: Default label for hr added.
hr: 'Hrvatski'
is correct and consistent with other labels.
144-147
: ```shell
#!/bin/bash
set -euo pipefailecho "1) Search for LOCALE_MAP symbol"
rg -n --hidden -S '\bLOCALE_MAP\b' || trueecho
echo "2) Search for 'hr' key occurrences (object keys / mappings)"
rg -n --hidden -S "['"]hr['"]\s*:" || trueecho
echo "3) Search for 'croatian' string across repo"
rg -n --hidden -S "croatian" || trueecho
echo "4) List frontend/messages (if present)"
ls -la frontend/messages 2>/dev/null || trueecho
echo "5) Search frontend/messages for 'croatian' and 'hr'"
rg -n --hidden -S '"croatian"' frontend/messages || true
rg -n --hidden -S '"hr"' frontend/messages || true</blockquote></details> <details> <summary>frontend/messages/cs.json (1)</summary><blockquote> `19-20`: **Czech label for Croatian added.** `"croatian": "chorvatština"` looks correct and casing matches neighboring entries. </blockquote></details> <details> <summary>frontend/messages/hr.json (1)</summary><blockquote> `1-10`: **Validate frontend/messages/hr.json — JSON syntax and placeholder parity with en.json** Sandbox automation failed (/dev/fd error). Run these locally and share results. Location: frontend/messages/hr.json (snippet shown lines 1–10) ```sh # 1) Validate JSON syntax for all locale files find frontend/messages -type f -name '*.json' -print0 | while IFS= read -r -d '' f; do jq -e . "$f" >/dev/null || echo "Invalid JSON: $f" done # 2) Compare placeholder sets between en.json and hr.json python - <<'PY' import json,re,sys,pathlib def ph(s): return set(re.findall(r"\{([A-Za-z0-9_]+)\}", s or "")) en=pathlib.Path("frontend/messages/en.json") hr=pathlib.Path("frontend/messages/hr.json") if not en.exists() or not hr.exists(): print("Missing en.json or hr.json"); sys.exit(1) enobj=json.loads(en.read_text(encoding="utf-8")) hrobj=json.loads(hr.read_text(encoding="utf-8")) bad=[] for k in sorted(set(enobj.keys()) & set(hrobj.keys())): ev=enobj[k]; hv=hrobj[k] if isinstance(ev,str) and isinstance(hv,str) and ph(ev)!=ph(hv): e=sorted(ph(ev)); h=sorted(ph(hv)) bad.append((k,e,h)) if bad: print("Placeholder mismatches (key, en, hr):") for k,e,h in bad: print(f"- {k}: en={e} hr={h}") me=set(e)-set(h) if me: print(f" Missing in hr: {sorted(me)}") ex=set(h)-set(e) if ex: print(f" Extra in hr: {sorted(ex)}") else: print("No placeholder mismatches.") PY # 3) Quick grep for common Croatian typos in hr.json grep -nE 'Primjenjen|Prosrinac|kontole|zaoporavak|geneiran|Ovjde|Utejcaj|Moblini|Proceduri' frontend/messages/hr.json || true
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@EmilUnger LGTM. Can you solve the conflict before I merge? |
Yeah, no problem. I'll get on it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/messages/ar.json (1)
18-19
: Optional: normalize language-name style for Danish.Nearby entry uses "دانماركي" (adjective, no article). Most other language names use the feminine noun with the definite article (e.g., "الفرنسية", "الألمانية"). Consider aligning Danish to "الدانماركية" for consistency.
Apply:
- "danish": "دانماركي", + "danish": "الدانماركية",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
backend/ciso_assistant/settings.py
(1 hunks)frontend/messages/ar.json
(1 hunks)frontend/messages/cs.json
(1 hunks)frontend/messages/da.json
(1 hunks)frontend/messages/de.json
(1 hunks)frontend/messages/el.json
(1 hunks)frontend/messages/en.json
(1 hunks)frontend/messages/es.json
(1 hunks)frontend/messages/fr.json
(1 hunks)frontend/messages/hi.json
(1 hunks)frontend/messages/hu.json
(1 hunks)frontend/messages/id.json
(1 hunks)frontend/messages/it.json
(1 hunks)frontend/messages/nl.json
(1 hunks)frontend/messages/pl.json
(1 hunks)frontend/messages/pt.json
(1 hunks)frontend/messages/ro.json
(1 hunks)frontend/messages/sv.json
(1 hunks)frontend/messages/tr.json
(1 hunks)frontend/messages/uk.json
(1 hunks)frontend/messages/ur.json
(1 hunks)frontend/src/lib/utils/locales.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (21)
- frontend/messages/de.json
- frontend/messages/el.json
- frontend/messages/id.json
- frontend/messages/es.json
- frontend/messages/ro.json
- frontend/messages/fr.json
- frontend/messages/pl.json
- frontend/messages/hu.json
- frontend/messages/hi.json
- frontend/messages/tr.json
- frontend/messages/it.json
- frontend/messages/cs.json
- frontend/messages/ur.json
- frontend/src/lib/utils/locales.ts
- frontend/messages/uk.json
- backend/ciso_assistant/settings.py
- frontend/messages/pt.json
- frontend/messages/nl.json
- frontend/messages/sv.json
- frontend/messages/en.json
- frontend/messages/da.json
🔇 Additional comments (1)
frontend/messages/ar.json (1)
19-19
: Croatian label correct in ar.json — inconsistent across localesfrontend/messages/ar.json contains "croatian": "الكرواتية" (correct). frontend/messages/uk.json is missing the "croatian" key (validation script output). Add the "croatian" label to frontend/messages/uk.json and re-run the provided checks.
Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Added the Croatian translation of the frontend messages.
Summary by CodeRabbit