Skip to content

feat: Add Chinese (Simplified) translation and fix i18n issues#175

Merged
basharovV merged 7 commits intobasharovV:mainfrom
Kwensiu:main
Dec 12, 2025
Merged

feat: Add Chinese (Simplified) translation and fix i18n issues#175
basharovV merged 7 commits intobasharovV:mainfrom
Kwensiu:main

Conversation

@Kwensiu
Copy link
Contributor

@Kwensiu Kwensiu commented Dec 11, 2025

  • Add complete Chinese (Simplified) translation support (cn locale)
  • Fix trackMenu i18n types to include missing properties
  • Fix SmartQueries to properly load translated names
  • Add fallbacks for text that might not be translated yet
  • Register cn locale in App.svelte
  • Update i18n files to include cn locale

I have filled in the key values for en, es, and tr simultaneously, but I have not translated the es and tr entries. For the empty key values in es and tr, I have provided respective fallbacks in the corresponding regions, so no blanks will appear.
Of course, if they are not needed, you can decline my modifications for es and tr.

- Add complete Chinese (Simplified) translation support (cn locale)
- Fix trackMenu i18n types to include missing properties
- Fix SmartQueries to properly load translated names
- Add fallbacks for text that might not be translated yet
- Register cn locale in App.svelte
- Update i18n files to include cn locale

I have filled in the key values for en, es, and tr simultaneously, but I have not translated the es and tr entries. For the empty key values in es and tr, I have provided respective fallbacks in the corresponding regions, so no blanks will appear.
I apologize for the oversight. Here, line 1402

``<p>{smartQuery.name}</p>``

needs to be replaced with

```
<p>
    {typeof smartQuery.name === "function" 
        ? smartQuery.name() 
        : smartQuery.name}
</p>
```

in order to correctly retrieve the name. I have tried to apply a patch for this.
@Kwensiu
Copy link
Contributor Author

Kwensiu commented Dec 11, 2025

Oh, should I have posted an issue for discussion beforehand? I apologize again for my rashness. I noticed that this project doesn't have a Chinese translation yet, so I added one. If this contribution aligns with the project's plans, I hope it can be merged. If you have any preferences regarding translation style or terminology, please let me know, and I'm happy to make adjustments.

@basharovV
Copy link
Owner

basharovV commented Dec 11, 2025

Hi, thank you for the contribution! Translations are always welcomed.

I checked out the branch and it's looking almost ready. Before merging, can I ask you to also i18n-ize the strings in AlbumMenu.svelte since it's quite similar to TrackMenu?

Also I'm not sure about the fallback conditions like text={$LL.trackMenu.separateTitle() || "Stems (click to play)"} because that implies mixing two languages, and maybe even reducing the urgency to add missing strings because "meh, there's already an English fallback". I would prefer to be intentional and treat missing strings in any locale as a bug.

After merging, I'll look at the placeholders for ES and fill those in. For Turkish I'll probably use Google Translate.

@Kwensiu
Copy link
Contributor Author

Kwensiu commented Dec 12, 2025

@basharovV
Hello, I've submitted some new commits where I've worked on improving the internationalization across several files, including AlbumMenu.svelte. Since both lib\library and lib\queue have a TrackMenu.svelte, I consolidated the identical translations under the TrackMenu structure in index.ts.

Regarding the fallbacks, I added them because they make it easier to compare the EN text during translation, but I agree they are not a sustainable solution—missing strings in other languages ​​still need to be filled in promptly. If they’re not needed, I can skip adding fallbacks in future i18n work, or perhaps use empty fallbacks instead?

I also have a small question: why is it called "Wiki panel" instead of "Wiki page" or simply "Wikipedia"? Using a proper name like Wikipedia might actually allow us to reduce some i18n structures haha, since proper nouns (e.g., YouTube, Wikipedia) are often left untranslated.

@basharovV
Copy link
Owner

basharovV commented Dec 12, 2025

Thank you! I'll review and merge.

Regarding the fallbacks, I added them because they make it easier to compare the EN text during translation

Ok, that's fair enough. Whenever adding or changing strings in the future I would try to get into the habit of updating all locales straight away, or maybe I'll find a tool that helps with automating this or flagging in CI which strings still need translating before release.

I also have a small question: why is it called "Wiki panel" instead of "Wiki page" or simply "Wikipedia"?

I think the reason I named it that is to suggest that the article opens in-app. Plus it's not just the raw article, the panel has features that link the content to your music library, highlighting mentions of albums, artists, songs.

@Kwensiu
Copy link
Contributor Author

Kwensiu commented Dec 12, 2025

Excuse me, after learning about typesafe-i18n, I realized I needed to run npm run typesafe-i18n to generate the type definitions. This is auto-generated content and can be safely merged.

@basharovV basharovV merged commit d7b5f1f into basharovV:main Dec 12, 2025
@basharovV
Copy link
Owner

Yes sorry it wasn't clear that typesafe-i18n is the way to do it automatically. Looks great, I merged it. Thanks again!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants