Expand i18n locales and improve reviews UI
Add many new language packs with RTL support, refresh brand assets, and harden review rendering with tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -175,6 +175,9 @@ export function formatters(t: Translator): Formatters {
|
||||
/** Locale-free, so it lives here beside the rest rather than in two places. */
|
||||
export function starString(rating: number | null): string {
|
||||
if (rating === null) return '☆☆☆☆☆';
|
||||
const filled = Math.round(rating);
|
||||
return '★'.repeat(filled) + '☆'.repeat(Math.max(0, 5 - filled));
|
||||
// Ratings are integers 0 to 5 in the data; anything else is clamped rather than
|
||||
// trusted, so a stray fractional or out-of-range value can never emit a malformed
|
||||
// row (six stars, negative repeat counts, a half glyph).
|
||||
const filled = Math.min(5, Math.max(0, Math.round(rating)));
|
||||
return '★'.repeat(filled) + '☆'.repeat(5 - filled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user