-
Notifications
You must be signed in to change notification settings - Fork 2
Solution (#50): Help translate the explorer — add a locale #56
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| commit 1234567890abcdef | ||
| Author: Your Name <your@email.com> | ||
| Date: 2023-02-20 14:30:00 +0000 | ||
|
|
||
| Add Spanish locale (#50) | ||
|
|
||
| Added Spanish locale to the explorer. | ||
|
|
||
| diff --git a/locales/es.json b/locales/es.json | ||
| new file mode 100644 | ||
| index 0000000..1234567 | ||
| --- /dev/null | ||
| +++ b/locales/es.json | ||
| @@ -0,0 +1 @@ | ||
| +{ | ||
| + "title": "Explorador", | ||
| + "header": { | ||
| + "title": "Explorador", | ||
| + "description": "Explorador de datos" | ||
| + }, | ||
| + "sidebar": { | ||
| + "title": "Menú", | ||
| + "items": [ | ||
| + { | ||
| + "title": "Inicio", | ||
| + "icon": "home", | ||
| + "url": "/" | ||
| + }, | ||
| + { | ||
| + "title": "Datos", | ||
| + "icon": "database", | ||
| + "url": "/data" | ||
| + }, | ||
| + { | ||
| + "title": "Configuración", | ||
| + "icon": "cog", | ||
| + "url": "/settings" | ||
| + } | ||
| + ] | ||
| + }, | ||
| + "footer": { | ||
| + "text": "Copyright 2023" | ||
| + } | ||
| +} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Copy the English locale to Spanish | ||
| { | ||
| "title": "Explorador", | ||
| "header": { | ||
| "title": "Explorador", | ||
| "description": "Explorador de datos" | ||
| }, | ||
| "sidebar": { | ||
| "title": "Menú", | ||
| "items": [ | ||
| { | ||
| "title": "Inicio", | ||
| "icon": "home", | ||
| "url": "/" | ||
| }, | ||
| { | ||
| "title": "Datos", | ||
| "icon": "database", | ||
| "url": "/data" | ||
| }, | ||
| { | ||
| "title": "Configuración", | ||
| "icon": "cog", | ||
| "url": "/settings" | ||
| } | ||
| ] | ||
| }, | ||
| "footer": { | ||
| "text": "Copyright 2023" | ||
| } | ||
| } | ||
|
Comment on lines
+2
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Register Spanish in the locale registry, or this file stays unreachable.
🧰 Tools🪛 Biome (2.5.1)[error] 2-31: End of file expected (parse) 🤖 Prompt for AI Agents🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Flatten the locale to the keys the i18n loader actually reads.
Example- "header": {
- "title": "Explorador",
- "description": "Explorador de datos"
- },
- "sidebar": {
- "title": "Menú",
- "items": [
- ...
- ]
- }
+ "header.title": "Explorador",
+ "header.description": "Explorador de datos",
+ "nav.dashboard": "Inicio",
+ "nav.assets": "Datos",
+ "nav.lab": "Laboratorio"🧰 Tools🪛 Biome (2.5.1)[error] 2-31: End of file expected (parse) 🤖 Prompt for AI Agents |
||
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.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Remove the leading
#— this file is not valid JSON.The parser will fail on line 1, so the locale cannot be loaded at all.
Fix
-# Copy the English locale to Spanish {🧰 Tools
🪛 Biome (2.5.1)
[error] 1-1: unexpected character
#(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: String values must be double quoted.
(parse)
[error] 1-1: String values must be double quoted.
(parse)
🤖 Prompt for AI Agents
Source: Linters/SAST tools