Skip to content

Conversation

@ashwintemkar
Copy link

@ashwintemkar ashwintemkar commented Oct 30, 2025

Issue

This PR solves #500


Description

Adds Gujarati(gu) locale support to the app: registers the locale in the i18n config, updates existing locale manifests, and introduces the full Gujarati translation bundle.


Scope of Change

Select all applicable areas impacted by this PR:

  • View (UI/UX)
  • API
  • CLI
  • Infra / Deployment
  • Docs
  • Other (specify): ________

Screenshot / Video / GIF (if applicable)

Attach or embed screenshots, screen recordings, or GIFs demonstrating the feature or fix.
N/A


Related PRs (if any)

Link any related or dependent PRs across repos.

below image shows translation correctly
image
below image shows the Gujarati translation option in the selector for all languages
image

Additional Notes for Reviewers (optional)

  • Focus review on the new view/lib/i18n/locales/gu.json entries and the locale registration in view/lib/i18n/config.ts.

Developer Checklist

To be completed by the developer who raised the PR.

  • Add valid/relevant title for the PR
  • Self-review done
  • Manual dev testing done
  • No secrets exposed
  • No merge conflicts
  • Docs added/updated (if applicable)
  • Removed debug prints / secrets / sensitive data
  • Unit / Integration tests passing
  • Follows all standards defined in Nixopus Docs

Reviewer Checklist

To be completed by the reviewer before merge.

  • Peer review done
  • No console.logs / fmt.prints left
  • No secrets exposed
  • If any DB migrations, migration changes are verified
  • Verified release changes are production-ready

Summary by CodeRabbit

Release Notes

  • New Features
    • Added Gujarati language support, allowing users to switch their interface language to Gujarati and access all UI text and features in the new language.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

Gujarati language support is added to the internationalization system by extending the locales configuration, updating language name mappings across existing locale files, and creating a comprehensive Gujarati translation resource file.

Changes

Cohort / File(s) Summary
I18n Configuration
view/lib/i18n/config.ts
Added 'gu' to the locales array and added Gujarati entry to languageNames mapping
Language References in Existing Locales
view/lib/i18n/locales/en.json, view/lib/i18n/locales/es.json, view/lib/i18n/locales/fr.json, view/lib/i18n/locales/kn.json, view/lib/i18n/locales/ml.json
Added "gu": "Gujarati" (or equivalent translation) entry to the languages object in each locale file
New Gujarati Locale File
view/lib/i18n/locales/gu.json
Created comprehensive Gujarati localization file with translations for common UI actions, authentication flows, settings, notifications, team management, dashboards, file manager, extensions, navigation, layout, and toast messages

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Changes follow a consistent, repetitive pattern across multiple locale files (same addition applied uniformly)
  • New gu.json file is sizable but contains straightforward translation mappings with no runtime logic
  • All modifications are data-driven with no behavioral or control-flow changes

Possibly related issues

Possibly related PRs

Suggested labels

nixopus-view

Suggested reviewers

  • zhravan
  • raghavyuva

Poem

🐰 A rabbit hops through languages new,
Adding Gujarati hues to your view!
From config to locales, translations bloom,
ગુજરાતી fills each digital room! 🌍

Pre-merge checks and finishing touches

❌ 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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat(support-gujarati) : supports gujarati langugae translations in nixopus" directly relates to the main objective of the changeset, which is to add comprehensive Gujarati locale support to the application. The title clearly identifies the specific language being added (Gujarati) and the scope of changes (translations), making it easy for a teammate to understand the primary purpose. While the title contains a minor typo ("langugae" instead of "language") and inconsistent spacing around the colon, these do not detract from the clarity or accuracy of the message in communicating the core change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@ashwintemkar
Copy link
Author

I had also commented on the issue for Guajarati translational Issue Assignment @zhravan

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: 3

🧹 Nitpick comments (3)
view/lib/i18n/locales/es.json (1)

748-750: Languages entry added — OK

Optional: consider localizing to “Guyaratí” for Spanish consistency.

view/lib/i18n/locales/fr.json (1)

749-751: Languages entry added — OK

Optional: French often uses “gujarati”. Current “Gujarati” is acceptable if you prefer endonyms.

view/lib/i18n/locales/kn.json (1)

745-747: Languages entry added — OK

Unrelated nit: there are a few Kannada typos elsewhere (e.g., Notifications strings). Can be corrected in a follow-up.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 750c234 and 5cd4548.

📒 Files selected for processing (7)
  • view/lib/i18n/config.ts (1 hunks)
  • view/lib/i18n/locales/en.json (1 hunks)
  • view/lib/i18n/locales/es.json (1 hunks)
  • view/lib/i18n/locales/fr.json (1 hunks)
  • view/lib/i18n/locales/gu.json (1 hunks)
  • view/lib/i18n/locales/kn.json (1 hunks)
  • view/lib/i18n/locales/ml.json (1 hunks)
🔇 Additional comments (2)
view/lib/i18n/config.ts (1)

2-2: Locale registration looks good

'gu' is added to locales and mapped in languageNames; types stay sound with as const.

Also applies to: 10-12

view/lib/i18n/locales/en.json (1)

765-767: LGTM

English languages list updated correctly.

Comment on lines +43 to +44
"prune_build_cache": "કેશ બનાવો",
"prune_images_success": "છબીઓ સફળતાપૂર્વક કાપવામાં આવી",
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

Fix non-translatable tokens and a few mistranslations (functional and UX impact)

  • Keep keyboard shortcuts, commands, and code/env samples in Latin/English.
  • Use proper nouns unchanged (Discord).
  • Correct mislabeled cache action; fix a couple of UI terms.

Apply these edits:

-    "prune_build_cache": "કેશ બનાવો",
+    "prune_build_cache": "બિલ્ડ કેશ કાપો",
@@
-    "title": "કેશ બનાવો",
+    "title": "બિલ્ડ કેશ કાપો",
@@
-        "title": "વિખવાદ",
+        "title": "Discord",
@@
-          "placeholder": "NODE_ENV=ઉત્પાદન"
+          "placeholder": "NODE_ENV=production"
@@
-          "placeholder": "એનપીએમ ઇન્સ્ટોલ કરો"
+          "placeholder": "npm install"
@@
-          "placeholder": "એનપીએમ રન ટેસ્ટ"
+          "placeholder": "npm run test"
@@
-          "placeholder": "NODE_ENV=ઉત્પાદન"
+          "placeholder": "NODE_ENV=production"
@@
-          "placeholder": "એનપીએમ ઇન્સ્ટોલ કરો"
+          "placeholder": "npm install"
@@
-          "placeholder": "એનપીએમ રન ટેસ્ટ"
+          "placeholder": "npm run test"
@@
-    "shortcut": "⌘જે",
+    "shortcut": "⌘J",
@@
-        "move": "ચાલ",
+        "move": "ખસેડો",
@@
-    "executions": "ફાંસીની",
+    "executions": "અમલીકરણો",

These avoid broken shortcuts, misleading commands, or labels.

Also applies to: 82-85, 531-545, 859-866, 1010-1027, 1203-1222, 1321-1324, 886-890, 1365-1369

Comment on lines +822 to +827
"title": "સિસ્ટમ માહિતી",
"osType": "ઓએસ પ્રકાર",
"cpu": "સીપીયુ",
"uptime": "અપટાઇમ",
"lastUpdated": "છેલ્લું અપડેટ"
},
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 | 🔴 Critical

🧩 Analysis chain

Fill missing keys vs en.json (ensure parity to avoid fallbacks/gaps)

The gu bundle appears to omit sections/keys (e.g., dashboard.cpu, system.hostname/kernelVersion/architecture/memory, system.labels.*). This can cause English fallbacks or blank UI.

Recommend syncing gu.json keys with en.json; populate with Gujarati (or temporarily copy English strings), then iterate on translation.

Run this parity and placeholder audit:

Also applies to: 752-771, 809-815


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ROOT="view/lib/i18n/locales"
EN="$ROOT/en.json"
GU="$ROOT/gu.json"

python - <<'PY'
import json, re, sys
from pathlib import Path

en = json.loads(Path(sys.argv[1]).read_text(encoding='utf-8'))
gu = json.loads(Path(sys.argv[2]).read_text(encoding='utf-8'))

def flatten(d, prefix=""):
    out={}
    if isinstance(d, dict):
        for k,v in d.items():
            out.update(flatten(v, f"{prefix}.{k}" if prefix else k))
    elif isinstance(d, list):
        for i,v in enumerate(d):
            out.update(flatten(v, f"{prefix}[{i}]"))
    else:
        out[prefix]=d
    return out

def tokens(s):
    if not isinstance(s,str): return set()
    return set(re.findall(r"\{([A-Za-z0-9_]+)\}", s))

enf=flatten(en); guf=flatten(gu)

missing = sorted([k for k in enf.keys() if k not in guf])
if missing:
    print("Missing keys in gu.json:", len(missing))
    for k in missing[:200]: print("  ", k)
else:
    print("No missing keys in gu.json.")

mismatch=[]
for k in enf.keys() & guf.keys():
    te=tokens(enf[k]); tg=tokens(guf[k])
    if te!=tg:
        mismatch.append((k,te,tg))
if mismatch:
    print("\nPlaceholder mismatches (en vs gu):", len(mismatch))
    for k,te,tg in mismatch[:200]:
        print(f"  {k}  en={sorted(te)}  gu={sorted(tg)}")
else:
    print("\nNo placeholder mismatches.")
PY
"$EN" "$GU"

Length of output: 108


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ROOT="view/lib/i18n/locales"
EN="$ROOT/en.json"
GU="$ROOT/gu.json"

python3 <<'PY'
import json, re, sys
from pathlib import Path

en = json.loads(Path("view/lib/i18n/locales/en.json").read_text(encoding='utf-8'))
gu = json.loads(Path("view/lib/i18n/locales/gu.json").read_text(encoding='utf-8'))

def flatten(d, prefix=""):
    out={}
    if isinstance(d, dict):
        for k,v in d.items():
            out.update(flatten(v, f"{prefix}.{k}" if prefix else k))
    elif isinstance(d, list):
        for i,v in enumerate(d):
            out.update(flatten(v, f"{prefix}[{i}]"))
    else:
        out[prefix]=d
    return out

def tokens(s):
    if not isinstance(s,str): return set()
    return set(re.findall(r"\{([A-Za-z0-9_]+)\}", s))

enf=flatten(en); guf=flatten(gu)

missing = sorted([k for k in enf.keys() if k not in guf])
if missing:
    print("Missing keys in gu.json:", len(missing))
    for k in missing[:200]: print("  ", k)
else:
    print("No missing keys in gu.json.")

mismatch=[]
for k in enf.keys() & guf.keys():
    te=tokens(enf[k]); tg=tokens(guf[k])
    if te!=tg:
        mismatch.append((k,te,tg))
if mismatch:
    print("\nPlaceholder mismatches (en vs gu):", len(mismatch))
    for k,te,tg in mismatch[:200]:
        print(f"  {k}  en={sorted(te)}  gu={sorted(tg)}")
else:
    print("\nNo placeholder mismatches.")
PY

Length of output: 592


Add 17 missing translation keys to gu.json

Verification confirms gu.json is missing 17 keys present in en.json: 5 under dashboard.cpu (title, cores, overall, perCore, usage) and 12 under dashboard.system (hostname, kernelVersion, architecture, memory, and their label variants). These gaps will cause English fallbacks in the Gujarati UI.

Add the missing keys with Gujarati translations or temporarily copy English strings from en.json, then refine translations iteratively.

Missing keys:

  • dashboard.cpu.cores, dashboard.cpu.overall, dashboard.cpu.perCore, dashboard.cpu.title, dashboard.cpu.usage
  • dashboard.system.architecture, dashboard.system.hostname, dashboard.system.kernelVersion, dashboard.system.memory
  • dashboard.system.labels.architecture, dashboard.system.labels.cpu, dashboard.system.labels.cpuCores, dashboard.system.labels.hostname, dashboard.system.labels.kernelVersion, dashboard.system.labels.memory, dashboard.system.labels.operatingSystem, dashboard.system.labels.uptime
🤖 Prompt for AI Agents
In view/lib/i18n/locales/gu.json around lines 822-827, gu.json is missing 17
translation keys present in en.json under dashboard.cpu and dashboard.system
which causes English fallbacks; add the missing keys (dashboard.cpu.title,
dashboard.cpu.cores, dashboard.cpu.overall, dashboard.cpu.perCore,
dashboard.cpu.usage and dashboard.system.hostname,
dashboard.system.kernelVersion, dashboard.system.architecture,
dashboard.system.memory plus dashboard.system.labels.architecture,
dashboard.system.labels.cpu, dashboard.system.labels.cpuCores,
dashboard.system.labels.hostname, dashboard.system.labels.kernelVersion,
dashboard.system.labels.memory, dashboard.system.labels.operatingSystem,
dashboard.system.labels.uptime) in the appropriate sections of the JSON file,
populating them with Gujarati translations or temporary English strings copied
from en.json, keeping JSON structure and punctuation intact.

Comment on lines +764 to 766
"ml": "മലയാളം",
"gu": "ഗുജറാത്തി"
},
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 30, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Do not translate interpolation tokens like {count}/{value}/{name}

Spotted localized placeholders (e.g., "+{എണ്ണുക} കൂടുതൽ", "{മൂല്യം}", "{പേര്}"), which will break runtime interpolation. Keep the identifiers exactly as in en.json.

Run a quick check to find translated tokens:

Also applies to: 68-69, 782-791, 689-692


🏁 Script executed:

#!/bin/bash
rg -nP '\{[^}]+\}' view/lib/i18n/locales/ml.json | sed -n '1,200p'

Length of output: 1321


I need to check the English version to confirm the correct placeholder format and whether this is a pre-existing issue or newly introduced:

Let me check the specific lines being changed and compare with en.json:

Fix translated placeholder identifiers preventing runtime interpolation

The ml.json file contains translated placeholder identifiers in interpolation strings (lines 68, 689-690, 782, 788-790, 817-819, 863, 915-916, 949, 1110-1111, 1141, 1320) that will break runtime interpolation. Placeholder identifiers must use named placeholders and cannot be translated—they need to remain language-independent as {count}, {name}, {value}, etc.

Examples requiring fixes:

  • Line 68: "+{എണ്ണുക} കൂടുതൽ" → "+{count} കൂടുതൽ"
  • Line 689-690: "{പേര്}" → "{name}"
  • Line 782: "+{എണ്ണുക} കൂടുതൽ" → "+{count} കൂടുതൽ"
  • Line 788-790, 817-819: "{മൂല്യം}" → "{value}"

Update all translated placeholder names back to their English equivalents.

Copy link
Author

Choose a reason for hiding this comment

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

this was not done by me as this seems to be irrelevant to my commit pushed,

it has been there since the Malayalam language addition,

@raghavyuva let me know if this is necessary, if yes I will change that too, otherwise I will let it go as it is not from my push or fix it if y'all need it to be correct what someone else had pushed

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

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