Skip to content

[Bug] Chinese-named items disappear when using A-Z sorting (recipes, pantry, categories) #41

Description

@xiaojwus

I've been testing CookTrace with Chinese localization and found a critical compatibility issue with non-ASCII characters.

Issue: Chinese-named items not displayed when sorted A-Z
When creating recipes, pantry items, or categories with Chinese characters as the name, they do not appear in the list when A-Z sorting is selected.

Steps to reproduce:

Create a recipe with a Chinese name (e.g. "番茄炒蛋")

Create a recipe with an English name (e.g. "Tomato Egg Stir Fry")

In the recipe list, select A-Z sorting

Observe: the English-named recipe appears, the Chinese-named recipe does not (or appears blank)

Switch to other sorting options (e.g. "Newest", "Recently Cooked") — the Chinese recipe reappears

Same issue applies to:

Pantry items with Chinese names

Categories/Tags with Chinese names

Expected behavior:
Chinese-named items should be sorted alongside English-named items in A-Z view, or at least should not disappear from the list.

Actual behavior:
A-Z sorting appears to only recognize ASCII characters and filters out or fails to render entries whose names start with non-ASCII characters.

Environment:

CookTrace version: 1.1.3

Deployment: Docker (self-hosted)

Browser: Chrome / [your browser]

Additional context:
This is likely related to how the localeCompare or sorting function is implemented — it may be using ASCII-only sorting logic that doesn't account for Unicode characters. The same issue may affect other non-Latin scripts.

Screenshots:
[Add before/after screenshots showing the missing items]

Offer to help
I'm willing to help test and fix this issue if you can point me to the relevant sorting code. I can also assist with completing the zh_CN.json translation and submitting a PR.

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions