Skip to content

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Nov 16, 2025

Summary by CodeRabbit

  • New Features
    • Added comprehensive multi-language support for settings documentation and help text across 21+ languages, including Arabic, Chinese, French, German, Japanese, Portuguese, Russian, Spanish, and more.
    • Enhanced localized descriptions and detailed guidance for all application settings, improving accessibility for international users.

@ildyria ildyria requested a review from a team as a code owner November 16, 2025 00:00
@coderabbitai
Copy link

coderabbitai bot commented Nov 16, 2025

📝 Walkthrough

Walkthrough

This PR adds comprehensive localization support for application settings across 21 languages. It introduces language-specific translation files containing documentation and details for each setting, and updates Vue form components to consume these translations through a new translation composable.

Changes

Cohort / File(s) Summary
Locale-specific settings translation files
lang/ar/all_settings.php, lang/cz/all_settings.php, lang/de/all_settings.php, lang/el/all_settings.php, lang/en/all_settings.php, lang/es/all_settings.php, lang/fa/all_settings.php, lang/fr/all_settings.php, lang/hu/all_settings.php, lang/it/all_settings.php, lang/ja/all_settings.php, lang/nl/all_settings.php, lang/no/all_settings.php, lang/pl/all_settings.php, lang/pt/all_settings.php, lang/ru/all_settings.php, lang/sk/all_settings.php, lang/sv/all_settings.php, lang/vi/all_settings.php, lang/zh_CN/all_settings.php, lang/zh_TW/all_settings.php
Each file returns a nested array with documentation and details sections, mapping setting keys to localized descriptions, labels, help text, and HTML snippets.
Form field component updates
resources/js/components/forms/settings/BoolField.vue, NumberField.vue, OldField.vue, SelectField.vue, SelectLang.vue, SelectOptionsField.vue, SliderField.vue, StringField.vue, ZipSliderField.vue
Replace direct prop access (props.config.documentation and props.config.details) with translation helper functions (tDoc() and tDetails()). Import and initialize useTranslation composable in each component.
Translation composable
resources/js/composables/useTranslation.ts
New composable exporting t(), tDoc(), and tDetails() functions. Integrates with laravel-vue-i18n for translation resolution, with fallback to provided default values. Prefixes tDoc and tDetails calls with all_settings.documentation. and all_settings.details. namespace.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

The changes are highly homogeneous: 21 language files follow an identical structure (data-only arrays), and 9 Vue components apply the same translation pattern. Logic density is minimal—mostly data declarations and straightforward composable wiring. While spanning many files, the repetitive nature and consistent patterns reduce cognitive load per file.

Poem

🐰 Hoppity-hop through languages we go,
Setting translations in a splendid show!
From Arabic to Chinese, each tongue speaks clear,
Twenty-one voices celebrating translations sincere!
Vue components dance with localized might,
Settings rendered beautifully in every tongue's light!

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.

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.

❤️ Share

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

@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Nov 16, 2025
Copy link

@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: 6

🧹 Nitpick comments (1)
resources/js/composables/useTranslation.ts (1)

13-19: Consider adding defensive null checks for robustness.

While the current implementation works when the config object has the expected shape, adding optional chaining or validation could prevent potential runtime errors if the config object is malformed.

Consider this defensive approach:

 function tDoc(config: { key: string; documentation: string }): string {
-	return t("all_settings.documentation." + config.key, config.documentation);
+	return t("all_settings.documentation." + config.key, config.documentation ?? "");
 }

 function tDetails(config: { key: string; details: string }): string {
-	return t("all_settings.details." + config.key, config.details);
+	return t("all_settings.details." + config.key, config.details ?? "");
 }

Or strengthen the TypeScript types to ensure non-null values at compile time.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb4efbc and f2c6fe2.

📒 Files selected for processing (31)
  • lang/ar/all_settings.php (1 hunks)
  • lang/cz/all_settings.php (1 hunks)
  • lang/de/all_settings.php (1 hunks)
  • lang/el/all_settings.php (1 hunks)
  • lang/en/all_settings.php (1 hunks)
  • lang/es/all_settings.php (1 hunks)
  • lang/fa/all_settings.php (1 hunks)
  • lang/fr/all_settings.php (1 hunks)
  • lang/hu/all_settings.php (1 hunks)
  • lang/it/all_settings.php (1 hunks)
  • lang/ja/all_settings.php (1 hunks)
  • lang/nl/all_settings.php (1 hunks)
  • lang/no/all_settings.php (1 hunks)
  • lang/pl/all_settings.php (1 hunks)
  • lang/pt/all_settings.php (1 hunks)
  • lang/ru/all_settings.php (1 hunks)
  • lang/sk/all_settings.php (1 hunks)
  • lang/sv/all_settings.php (1 hunks)
  • lang/vi/all_settings.php (1 hunks)
  • lang/zh_CN/all_settings.php (1 hunks)
  • lang/zh_TW/all_settings.php (1 hunks)
  • resources/js/components/forms/settings/BoolField.vue (2 hunks)
  • resources/js/components/forms/settings/NumberField.vue (2 hunks)
  • resources/js/components/forms/settings/OldField.vue (2 hunks)
  • resources/js/components/forms/settings/SelectField.vue (2 hunks)
  • resources/js/components/forms/settings/SelectLang.vue (2 hunks)
  • resources/js/components/forms/settings/SelectOptionsField.vue (3 hunks)
  • resources/js/components/forms/settings/SliderField.vue (3 hunks)
  • resources/js/components/forms/settings/StringField.vue (3 hunks)
  • resources/js/components/forms/settings/ZipSliderField.vue (2 hunks)
  • resources/js/composables/useTranslation.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3641
File: lang/no/settings.php:9-9
Timestamp: 2025-08-22T06:11:18.329Z
Learning: For lang/* translation files in the Lychee project: only review PHP-related issues (syntax, structure, etc.), not translation content, grammar, or language-related nitpicks. The maintainer ildyria has explicitly requested this approach.
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3637
File: lang/nl/renamer.php:10-94
Timestamp: 2025-08-20T20:35:04.474Z
Learning: In Lychee, translation files are initially created with English strings as placeholders, and actual translations are handled through Weblate (a web-based translation management system). This means finding English text in non-English locale files (like lang/nl/, lang/de/, etc.) is expected and part of their translation workflow, not an issue to flag.
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3654
File: lang/cz/gallery.php:210-210
Timestamp: 2025-08-27T08:48:27.520Z
Learning: For this Lychee project, the maintainer prefers to keep language strings in English across all locale files rather than translating them to local languages.
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3654
File: lang/pl/gallery.php:210-210
Timestamp: 2025-08-27T08:48:32.956Z
Learning: The user ildyria does not prioritize strict localization consistency for new menu items in language files, as indicated by their "Lang = don't care" response when suggested to translate 'Import from Server' to Polish in lang/pl/gallery.php.
📚 Learning: 2025-08-22T06:11:18.329Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3641
File: lang/no/settings.php:9-9
Timestamp: 2025-08-22T06:11:18.329Z
Learning: For lang/* translation files in the Lychee project: only review PHP-related issues (syntax, structure, etc.), not translation content, grammar, or language-related nitpicks. The maintainer ildyria has explicitly requested this approach.

Applied to files:

  • lang/es/all_settings.php
  • lang/sv/all_settings.php
  • lang/fa/all_settings.php
  • lang/it/all_settings.php
  • lang/el/all_settings.php
📚 Learning: 2025-08-20T20:35:04.474Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3637
File: lang/nl/renamer.php:10-94
Timestamp: 2025-08-20T20:35:04.474Z
Learning: In Lychee, translation files are initially created with English strings as placeholders, and actual translations are handled through Weblate (a web-based translation management system). This means finding English text in non-English locale files (like lang/nl/, lang/de/, etc.) is expected and part of their translation workflow, not an issue to flag.

Applied to files:

  • lang/fa/all_settings.php
  • lang/el/all_settings.php
📚 Learning: 2025-08-27T08:48:27.520Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3654
File: lang/cz/gallery.php:210-210
Timestamp: 2025-08-27T08:48:27.520Z
Learning: For this Lychee project, the maintainer prefers to keep language strings in English across all locale files rather than translating them to local languages.

Applied to files:

  • lang/el/all_settings.php
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: 3️⃣ PHP dist / 8.4 - sqlite
  • GitHub Check: 3️⃣ PHP dist / 8.4 - mariadb
  • GitHub Check: 3️⃣ PHP dist / 8.4 - postgresql
  • GitHub Check: 3️⃣ PHP dist / 8.3 - sqlite
  • GitHub Check: 3️⃣ PHP dist / 8.3 - mariadb
  • GitHub Check: 3️⃣ PHP dist / 8.3 - postgresql
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Webshop
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- ImageProcessing
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Unit
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Webshop
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Webshop
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- ImageProcessing
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- ImageProcessing
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Unit
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Unit
🔇 Additional comments (24)
lang/ar/all_settings.php (1)

1-602: PHP structure and syntax look correct

File cleanly returns a nested array with balanced brackets, valid commas, and properly quoted strings under documentation and details. No PHP-level issues found.

lang/sv/all_settings.php (1)

1-602: Valid PHP array resource

The file correctly declares <?php and returns a well-formed associative array with documentation and details. Array/quote syntax is consistent; no PHP errors apparent.

lang/de/all_settings.php (1)

1-602: Well-formed localization array

lang/de/all_settings.php is a syntactically correct PHP file returning the expected nested array; keys and values are structurally consistent, with no detectable PHP errors.

lang/ja/all_settings.php (1)

1-602: PHP syntax/structure OK

The Japanese all_settings resource cleanly returns a nested associative array; bracket, comma, and quoting usage are correct. No PHP-level problems found.

lang/en/all_settings.php (1)

1-602: Base English catalog is structurally sound

lang/en/all_settings.php is a valid PHP file returning the expected documentation and details arrays. Array layout, commas, and quoting are correct; no syntax or structural issues detected.

lang/zh_TW/all_settings.php (1)

1-602: Array and file structure are valid

This translation file is well‑formed PHP: single top‑level return array with 'documentation' and 'details' sub‑arrays, all keys and values correctly comma‑separated and brackets properly closed. No PHP syntax or structural issues from what I can see.

lang/sk/all_settings.php (1)

1-602: Syntactically correct localization array

The Slovak all_settings file is structurally consistent with the other locales: valid <?php header, a single returned array, and two associative sub‑arrays for 'documentation' and 'details' with proper PHP syntax. No structural problems identified.

lang/no/all_settings.php (1)

1-602: Norwegian all_settings file is structurally sound

This file follows the expected pattern (returning an array with 'documentation' and 'details'), and the PHP syntax (quotes, commas, brackets) is correct throughout. No PHP‑level issues from this diff.

lang/es/all_settings.php (1)

1-602: Spanish all_settings localization: PHP looks correct

The file is a clean, syntactically valid PHP array with the expected 'documentation' and 'details' sections. Bracing and comma usage are consistent; I don’t see any structural or PHP‑level problems here.

lang/nl/all_settings.php (1)

1-602: PHP structure and key consistency verified—no issues found.

The file is syntactically valid. Verification confirms metrics_logged_in_users_enabed is used consistently across the entire codebase (tests, migrations, controllers, middleware, and all language files). The key naming matches the established configuration system, so the translation file is correct as-is.

lang/ru/all_settings.php (1)

1-602: LGTM! PHP structure is correct.

The file structure is valid with proper array declaration and consistent key-value pairs. English content in this Russian locale file is expected per the Weblate translation workflow.

Based on learnings

lang/it/all_settings.php (1)

1-602: LGTM! PHP structure is correct.

The file structure is valid with proper array declaration and consistent key-value pairs. English content in this Italian locale file is expected per the Weblate translation workflow.

Based on learnings

resources/js/components/forms/settings/SelectField.vue (1)

23-25: LGTM! Translation integration is correct.

The translation composable is properly imported and used with the correct fallback pattern (props.label ?? tDoc(props.config)), maintaining backward compatibility.

resources/js/components/forms/settings/SelectOptionsField.vue (1)

47-49: LGTM! Translation integration is correct.

Both tDoc and tDetails helpers are properly integrated with correct fallback patterns, maintaining backward compatibility while enabling localized documentation and details rendering.

resources/js/components/forms/settings/ZipSliderField.vue (1)

21-23: LGTM! Translation integration is correct.

The translation composable is properly integrated, replacing direct access to props.config.documentation with the localized tDoc(props.config) helper.

resources/js/components/forms/settings/SelectLang.vue (1)

16-18: LGTM! Translation integration is correct.

The translation composable is properly imported and used with the correct fallback pattern, enabling localized labels while maintaining backward compatibility.

resources/js/components/forms/settings/OldField.vue (1)

25-27: LGTM! Translation integration is correct.

Both tDoc and tDetails helpers are properly integrated, replacing direct access to props.config.documentation and props.config.details with localized versions.

resources/js/components/forms/settings/BoolField.vue (1)

26-28: LGTM! Translation integration is correct.

Both tDoc and tDetails helpers are properly integrated with correct fallback patterns, enabling localized documentation and details while maintaining backward compatibility.

resources/js/components/forms/settings/SliderField.vue (1)

28-30: LGTM! Translation integration implemented correctly.

The translation composable is properly imported and used to provide localized documentation and details. This follows the consistent pattern across all settings components.

lang/fa/all_settings.php (1)

1-602: PHP structure looks correct.

The file follows proper PHP syntax with correct array structure. The translation content (English placeholders) is expected and will be handled via Weblate.

Based on learnings

lang/zh_CN/all_settings.php (1)

1-602: PHP structure looks correct.

The file follows proper PHP syntax with correct array structure. English placeholders are expected and will be translated via Weblate.

Based on learnings

resources/js/components/forms/settings/StringField.vue (1)

38-40: LGTM! Translation integration properly implemented.

The component correctly uses the translation helpers to provide localized content while maintaining backward compatibility with optional label and details props.

resources/js/components/forms/settings/NumberField.vue (1)

33-35: LGTM! Translation helpers correctly integrated.

The component properly uses tDoc and tDetails for localized content rendering.

lang/pl/all_settings.php (1)

1-602: PHP structure looks correct.

The file has proper PHP syntax and array structure. English placeholder content is expected and will be translated through Weblate.

Based on learnings

@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.37%. Comparing base (eb4efbc) to head (f2c6fe2).
⚠️ Report is 1 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria enabled auto-merge (squash) November 16, 2025 00:30
@ildyria ildyria merged commit e4c2718 into master Nov 16, 2025
48 checks passed
@ildyria ildyria deleted the translations-settings branch November 16, 2025 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: easy Easy review expected: probably just need a quick to go through.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants