Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
[ci skip]
WalkthroughAdded ChangesArray usage localization
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
[ci skip]
[ci skip]
[ci skip]
[ci skip]
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/src/locales/ar.json`:
- Line 424: Update the Arabic headerArrayUsage.usedOfArray translation to use
the locale-aware percentage interpolation format instead of the raw %{0}
placeholder, ensuring the rendered percentage has correct Arabic formatting and
sign placement.
In `@web/src/locales/pl.json`:
- Line 424: Update the “headerArrayUsage.usedOfArray” translation to use
idiomatic Polish wording, such as placing “Wykorzystano” before the percentage
and “macierzy” after it, while preserving the {0} placeholder.
In `@web/src/locales/uk.json`:
- Line 422: Update the "headerArrayUsage.array" localization value in uk.json
from the instrumental form to the nominative label "Масив", leaving surrounding
translations unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e6f6b5ed-7537-4f1c-9325-af7cf4ba2986
📒 Files selected for processing (24)
web/src/locales/ar.jsonweb/src/locales/bn.jsonweb/src/locales/ca.jsonweb/src/locales/cs.jsonweb/src/locales/da.jsonweb/src/locales/de.jsonweb/src/locales/es.jsonweb/src/locales/fr.jsonweb/src/locales/hi.jsonweb/src/locales/hr.jsonweb/src/locales/hu.jsonweb/src/locales/it.jsonweb/src/locales/ja.jsonweb/src/locales/ko.jsonweb/src/locales/lv.jsonweb/src/locales/nl.jsonweb/src/locales/no.jsonweb/src/locales/pl.jsonweb/src/locales/pt.jsonweb/src/locales/ro.jsonweb/src/locales/ru.jsonweb/src/locales/sv.jsonweb/src/locales/uk.jsonweb/src/locales/zh.json
| "downgradeOs.pleaseFinishTheInitiatedUpdateTo": "الرجاء إنهاء التحديث المُبادر بتمكين عملية التخفيض.", | ||
| "headerArrayUsage.array": "المصفوفة", | ||
| "headerArrayUsage.offline": "غير متصل", | ||
| "headerArrayUsage.usedOfArray": "%{0} من المصفوفة مستخدم", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)locales/ar\.json$|(^|/)translation|react-intl|vue-i18n|formatMessage|messageformat|format-number|number-format|format-percent' || true
echo "== ar.json relevant lines =="
if [ -f web/src/locales/ar.json ]; then
nl -ba web/src/locales/ar.json | sed -n '415,430p'
fi
echo "== i18n libraries/config =="
rg -n '"react-intl"|"vue-i18n"|`@formatjs`|formatMessage|formatNumber|format-percent|headerArrayUsage.usedOfArray|usedOfArray' . --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | head -n 200Repository: unraid/api
Length of output: 355
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== ar.json relevant lines =="
awk 'NR>=415 && NR<=430 { printf "%6d\t%s\n", NR, $0 }' web/src/locales/ar.json
echo "== i18n usage/usages =="
python3 - <<'PY'
from pathlib import Path
patterns = ['react-intl', 'vue-i18n', '`@formatjs`', 'formatMessage', 'formatNumber', 'format-percent', 'headerArrayUsage.usedOfArray', 'usedOfArray']
for p in patterns:
print(f"\n--- {p} ---")
for path in Path('.').rglob('*'):
if any(part in {'node_modules','dist','build','.git'} for part in path.parts):
continue
if not path.is_file():
continue
try:
text = path.read_text(errors='ignore')
except Exception:
continue
if p in text:
print(f"matches: {path}")
print("(done)")
PY
echo "== package/locale metadata =="
for f in package.json web/package.json; do
[ -f "$f" ] && python3 - <<'PY' "$f"
import json, sys
p=sys.argv[1]
data=json.load(open(p))
for sec in ('dependencies','devDependencies'):
if sec in data:
hits={k:v for k,v in data[sec].items() if any(s in k for s in ('react-intl','vue-i18n','formatjs','i18n'))}
if hits:
print(p, sec, hits)
PY
doneRepository: unraid/api
Length of output: 7682
🌐 Web query:
ICU NumberFormat percent symbol position Arabic numberFormat percent percentSignBeforeNumber locale
💡 Result:
In ICU (International Components for Unicode), the positioning of the percent sign (%) is locale-dependent and is determined by the locale's CLDR (Common Locale Data Repository) data [1][2]. For the Arabic locale (ar), the percent sign is conventionally placed after the number (when read in the direction of the script) to reflect correct linguistic and typographic standards [3][4][5]. Key points regarding ICU number formatting and the percent sign: 1. Locale-Driven Positioning: ICU automatically handles the placement of the percent sign based on the provided locale [6][7]. When you use a percent instance of NumberFormat (e.g., NumberFormat.getPercentInstance(new Locale("ar"))), ICU selects the correct pattern from the locale's data [4][2]. In the Arabic locale, this pattern is configured so the percent sign appears in the correct position for Right-to-Left (RTL) text rendering [3][4]. 2. CLDR Configuration: The specific pattern used for percentages is stored in the CLDR data for each locale [4][2]. For Arabic, the pattern is defined to ensure the percent sign (which may be the standard '%' or the Arabic-specific '٪') is placed appropriately relative to the digits [4][5]. 3. Handling Issues: If you encounter an issue where the percent sign appears at the "start" of the string (e.g., %100) instead of the "end" (100%), it is often due to how the resulting string is rendered in a UI component rather than the ICU formatting itself [3]. Because Arabic is an RTL language, the visual ordering is handled by the Bidi (bidirectional) algorithm [3][5]. Simply concatenating the percent sign to a number can bypass this logic, causing it to render incorrectly [3]. To ensure correct display, it is recommended to let ICU's NumberFormatter perform the full formatting of the number and the percent sign as a single unit [7]. 4. Numbering Systems: ICU also supports different numbering systems (e.g., Western digits vs. Arabic-Indic digits) [6][8][2]. You can specify the numbering system using the u-nu- extension (e.g., ar-u-nu-latn for Arabic language with Western digits) [2]. The percent sign's position remains consistent with the chosen locale's conventions regardless of the numbering system used [9]. There is no "percentSignBeforeNumber" configuration setting in the ICU API because the position is inherently defined by the locale's data for consistency and correctness [1][2]. If manual formatting is required, you should use the symbols provided by DecimalFormatSymbols for that specific locale to maintain accuracy [8][9].
Citations:
- 1: https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
- 2: https://unicode.org/reports/tr35/tr35-numbers.html
- 3: https://stackoverflow.com/questions/66750748/android-wrong-location-of-percent-character-in-arabic-language
- 4: https://android.googlesource.com/platform/external/icu/+/1b7d32f919554dda9c193b32188251337bc756f1/icu4c/source/data/locales/ar.txt
- 5: https://www.localeplanet.com/icu/ar/index.html
- 6: https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classDecimalFormat.html
- 7: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/number/NumberFormatter.html
- 8: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/number/NumberFormatterSettings.html
- 9: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/DecimalFormatSymbols.html
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
import pathlib, json
root = pathlib.Path('web')
for p in root.rglob('*.ts'):
if any(part in {'node_modules','dist','build','.git'} for part in p.parts):
continue
text = p.read_text(errors='ignore')
if 'percent' in text.lower() or 'formatNumber' in text or 'Number' in text:
print(f"\n--- {p} ---")
for i,line in enumerate(text.splitlines(),1):
if any(s in line for s in ['percent','formatNumber','Number']):
print(f"{i}: {line}")
PY
python3 - <<'PY'
from pathlib import Path
for p in ['web/src/plugins/i18n.ts','web/src/i18n.ts','web/src/helpers/i18n-loader.ts']:
if Path(p).exists():
print(f"\n--- {p} ---")
for i,line in enumerate(Path(p).read_text(errors='ignore').splitlines(),1):
print(f"{i}: {line}")
PY
echo "== Node Intl NumberFormat probe =="
node - <<'JS'
for (const digitSystem of ['latn','arab']) {
for (const currency of ['USD','EUR']) {
for (const display of ['currency', 'percent', 'decimal']) {
console.log(`${display} ar-${digitSystem}`, new Intl.NumberFormat(`ar-${digitSystem}`, { style: display, currency }).format(50));
}
}
}
JSRepository: unraid/api
Length of output: 11035
🌐 Web query:
CLDR Arabic percentage symbol after_number or before_number ICU ar.txt percent
💡 Result:
In the Unicode Common Locale Data Repository (CLDR) and the ICU (International Components for Unicode) library, the percentage format for the Arabic (ar) locale is defined with the percent symbol placed after the number [1][2]. The standard percent pattern for the Arabic locale is defined as #,##0% [1][2]. When rendered in a Right-to-Left (RTL) context, this pattern results in the percent symbol (the Arabic percent sign ٪) appearing to the left of the number [3]. Technical details: - Pattern: The CLDR pattern #,##0% instructs the formatter to place the percent sign adjacent to the number [4][5]. - Symbol: The Arabic locale uses the specific ARABIC PERCENT SIGN (U+066A, ٪) rather than the ASCII percent sign (%) [5][6]. - Behavior: Because Arabic is an RTL script, placing the sign "after" the number in the data pattern results in the symbol being displayed on the left side of the number visually [3]. While the CLDR data defines the default, implementations may vary depending on the specific rendering engine or if Western numerals (0-9) are used instead of Arabic-Indic digits [3]. However, the core library configuration in ar.txt maintains the #,##0% pattern [2].
Citations:
- 1: https://www.unicode.org/cldr/cldr-aux/charts/24/by_type/numbers.number_formatting_patterns.html
- 2: https://android.googlesource.com/platform/external/icu/+/1b7d32f919554dda9c193b32188251337bc756f1/icu4c/source/data/locales/ar.txt
- 3: https://ux.stackexchange.com/questions/143871/what-is-the-correct-way-to-represent-annotation-to-a-numerical-value-in-arabic
- 4: https://cldr.unicode.org/translation/number-currency-formats/number-and-currency-patterns
- 5: https://www.unicode.org/cldr/cldr-aux/charts/23/by_type/patterns.numbers.html
- 6: https://www.localeplanet.com/icu/ar/
Use percentage interpolation for Arabic usage labels.
"%{0}" bypasses % formatting and may display the sign before the value in Arabic; render the value as a locale-aware percentage instead of interpolating %{0} into the translation.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/locales/ar.json` at line 424, Update the Arabic
headerArrayUsage.usedOfArray translation to use the locale-aware percentage
interpolation format instead of the raw %{0} placeholder, ensuring the rendered
percentage has correct Arabic formatting and sign placement.
| "downgradeOs.pleaseFinishTheInitiatedUpdateTo": "Proszę dokończyć zainicjowaną aktualizację, aby umożliwić obniżenie wersji.", | ||
| "headerArrayUsage.array": "Macierz", | ||
| "headerArrayUsage.offline": "Offline", | ||
| "headerArrayUsage.usedOfArray": "{0}% macierzy użyte", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate locale files and inspect relevant strings"
wc -l web/src/locales/pl.json web/src/locales/*.json 2>/dev/null | sed -n '1,80p'
python3 - <<'PY'
import json, pathlib
p=pathlib.Path('web/src/locales/pl.json')
data=json.loads(p.read_text())
key='headerArrayUsage.usedOfArray'
print(key, data.get(key))
for f in pathlib.Path('web/src/locales').glob('*.json'):
d=json.loads(f.read_text())
v=d.get(key)
if v:
print(f'{f.name}: {v!r}')
PY
echo
echo "Search for headerArrayUsage keys across locales"
rg -n '"headerArrayUsage' web/src/locales || trueRepository: unraid/api
Length of output: 7328
Use idiomatic Polish wording for array usage.
"{0}% macierzy użyte" is awkward for UI copy; a natural form such as "Wykorzystano {0}% macierzy" reads better and matches the intended “usedOfArray” message.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/locales/pl.json` at line 424, Update the
“headerArrayUsage.usedOfArray” translation to use idiomatic Polish wording, such
as placing “Wykorzystano” before the percentage and “macierzy” after it, while
preserving the {0} placeholder.
| "connectSettings.updatedApiSettingsToast": "Оновлені налаштування API", | ||
| "downgradeOs.downgradeUnraidOs": "Знизити версію Unraid OS", | ||
| "downgradeOs.pleaseFinishTheInitiatedUpdateTo": "Будь ласка, завершіть ініційоване оновлення, щоб увімкнути зниження версії.", | ||
| "headerArrayUsage.array": "Масивом", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Locate locale files:\n'
fd -a 'uk\.json$' . | sed 's#^\./##'
printf '\nInspect target entry and nearby keys:\n'
python3 - <<'PY'
import json
from pathlib import Path
p = Path('web/src/locales/uk.json')
if not p.exists():
# try find
for path in Path('.').rglob('uk.json'):
if 'web/src' in str(path):
p = path
break
print(p)
data = json.loads(p.read_text())
print(type(data))
if isinstance(data, dict):
print(data.get('headerArrayUsage'))
for k, v in data.items():
if 'headerArrayUsage' in k or k == 'array' or k.endswith('.array'):
print(f'{k}: {v}')
else:
head = data[:50] if isinstance(data, list) else None
print(head)
PY
printf '\nSearch for headerArrayUsage/headerArrayUsage array references:\n'
rg -n 'headerArrayUsage|headerArrayUsage\.array|headerArrayUsage' web/src -S || trueRepository: unraid/api
Length of output: 5886
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Find source keys/components mentioning HeaderArrayUsage or headerArrayUsage:\n'
rg -n 'HeaderArrayUsage|headerArrayUsage|headerArrayUsage\.array|T\(' web/src -S --glob '!**/locales/**/*.json' -g '*.tsx' -g '*.ts' -g '*.js' -g '*.jsx' || true
printf '\nLocate language-related files:\n'
fd -i 'language|locale|i18n|translation|localization' web/src | sed 's#^\./##' | head -80Repository: unraid/api
Length of output: 539
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'i18n loader and util snippets:\n'
wc -l web/src/helpers/i18n-loader.ts web/src/helpers/i18n-utils.ts
sed -n '1,220p' web/src/helpers/i18n-loader.ts
printf '\n--- i18n-utils ---\n'
sed -n '1,220p' web/src/helpers/i18n-utils.ts
printf '\nFind headerArrayUsage in all tracked source files:\n'
git ls-files | rg '\.(m?js|tsx?|vue|jsx)$' | xargs rg -n 'headerArrayUsage|HeaderArrayUsage|headerArrayUsage\.array' -S || trueRepository: unraid/api
Length of output: 4804
Use the nominative Ukrainian label.
"Масивом" is instrumental case; this standalone array label should use "Масив".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/locales/uk.json` at line 422, Update the "headerArrayUsage.array"
localization value in uk.json from the instrumental form to the nominative label
"Масив", leaving surrounding translations unchanged.
Summary by CodeRabbit