KIRAKIRA-DOUGA / KIRAKIRA-Cerasus

KIRAKIRA's frontend powered by Nuxt 3.
https://kirakira.moe
BSD 3-Clause "New" or "Revised" License
96 stars 17 forks source link

通过某种方式来检测评论的语言 #239

Open otomad opened 2 weeks ago

otomad commented 2 weeks ago

例如通过前端层面检测评论的语言,方法可以检测包含特定语言的字符数目的多少等,也可依照翻译软件中“自动检测源语言”的工作方式来行动。

这将为特定语言的评论应用正确的字体、对齐方式等。


Reference: https://github.com/KIRAKIRA-DOUGA/KIRAKIRA-Cerasus/issues/196#issuecomment-2308886463

This should depend on the language of the comment, if the language of the comment is Chinese, Japanese, or Korean, it should be justified alignment, and left alignment for other languages. However, there is no easily way to know the language of the comment now, only know the language currently used by the user. This results in, for example, if you post a comment in English or Vietnamese, but another user is browsing the web in Chinese, your comment will be rendered as if it were in Chinese, and it will still be justified alignment.

A fundamental solution is that the front-end checks the language of the comment in some way, such as the number of characters in a particular language, which may not be accurate, but the translation software's automatic detection of the source language can do so. This solves the problem.

Originally posted by @otomad in https://github.com/KIRAKIRA-DOUGA/KIRAKIRA-Cerasus/issues/196#issuecomment-2308886463

AkutaZehy commented 2 weeks ago

现在的状况是,不同语言的评论区似乎并不通用,如中文语言设置下看不到英文语言设置下的评论,不知是否数据库设计如此——尽管中文语言下肯定还是会出现纯英文的评论。

此外,如果不仅仅考虑评论,再考虑例如个人页等配置,可能这个功能要再往上放。

otomad commented 2 weeks ago

此外,如果不仅仅考虑评论,再考虑例如个人页等配置,可能这个功能要再往上放。

个人页、视频稿件信息、甚至用户昵称等预计将会参考 YouTube 那样,用户可以为视频的简介翻译成各种语言,使用不同语言界面的用户会呈现所需的语言来显示。

hafterain commented 2 weeks ago

  建议只通过「发布者所用语言」或「发布者所指定的语言」来套用相应的字体设置。   出于网络用语的特殊性,Twitter等网站已经向我们证明了「自动检测」的效果会有多么糟糕。