-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat(support-gujarati) : supports gujarati langugae translations in nixopus #552
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: master
Are you sure you want to change the base?
Conversation
WalkthroughGujarati 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
I had also commented on the issue for Guajarati translational Issue Assignment @zhravan |
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: 3
🧹 Nitpick comments (3)
view/lib/i18n/locales/es.json (1)
748-750: Languages entry added — OKOptional: consider localizing to “Guyaratí” for Spanish consistency.
view/lib/i18n/locales/fr.json (1)
749-751: Languages entry added — OKOptional: French often uses “gujarati”. Current “Gujarati” is acceptable if you prefer endonyms.
view/lib/i18n/locales/kn.json (1)
745-747: Languages entry added — OKUnrelated 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
📒 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: LGTMEnglish languages list updated correctly.
| "prune_build_cache": "કેશ બનાવો", | ||
| "prune_images_success": "છબીઓ સફળતાપૂર્વક કાપવામાં આવી", |
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.
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
| "title": "સિસ્ટમ માહિતી", | ||
| "osType": "ઓએસ પ્રકાર", | ||
| "cpu": "સીપીયુ", | ||
| "uptime": "અપટાઇમ", | ||
| "lastUpdated": "છેલ્લું અપડેટ" | ||
| }, |
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.
🧩 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.")
PYLength 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.
| "ml": "മലയാളം", | ||
| "gu": "ഗുജറാത്തി" | ||
| }, |
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.
🧩 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.
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.
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
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.
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!
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:
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
below image shows the Gujarati translation option in the selector for all languages
Additional Notes for Reviewers (optional)
view/lib/i18n/locales/gu.jsonentries and the locale registration inview/lib/i18n/config.ts.Developer Checklist
To be completed by the developer who raised the PR.
Reviewer Checklist
To be completed by the reviewer before merge.
Summary by CodeRabbit
Release Notes