feat: Add Chinese (Simplified) translation and fix i18n issues#175
feat: Add Chinese (Simplified) translation and fix i18n issues#175basharovV merged 7 commits intobasharovV:mainfrom
Conversation
- 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.
|
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. |
|
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 Also I'm not sure about the fallback conditions like After merging, I'll look at the placeholders for ES and fill those in. For Turkish I'll probably use Google Translate. |
|
@basharovV 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. |
|
Thank you! I'll review and merge.
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 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. |
|
Excuse me, after learning about typesafe-i18n, I realized I needed to run |
|
Yes sorry it wasn't clear that typesafe-i18n is the way to do it automatically. Looks great, I merged it. Thanks again! |
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.