Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2RC版本中於usr資料夾中建立langs並放入語言文件後出現錯誤 #1203

Closed
lee89tw14 opened this issue Oct 21, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@lee89tw14
Copy link

1. 该问题的重现步骤是什么?

上傳語言文件mo後進入後台即報錯
(只上傳了zh_tw.mo及ja_jp.mo)

2. 你期待的结果是什么?实际看到的又是什么?

實際看到的:Return value of Typecho\I18n\GetText::ngettext() must be of the type string, null returned
期待看到的:正常的後台環境

3. 问题出现的环境

  • 操作系统版本:Ubuntu 20.4 LTS
  • Apache/NGINX 版本:Apache2
  • 数据库版本:mariadb(版本不確定)
  • PHP 版本:7.4
  • Typecho 版本:1.2 RC
  • 浏览器版本:Microsoft edge 版本 94.0.992.50

image

@joyqi
Copy link
Member

joyqi commented Oct 21, 2021

看起来应该是日语的部分语言档翻译缺失导致,不过这个报错确实是个bug

@joyqi joyqi added the bug Something isn't working label Oct 21, 2021
@joyqi joyqi closed this as completed in 8a57b91 Oct 21, 2021
@lee89tw14
Copy link
Author

lee89tw14 commented Oct 21, 2021

日語翻譯文檔是依據ja_jp.po後引入新的pot文件來修改的,如果有遺漏的條目再麻煩開發大大更新一下我再來做pull request,感恩感恩

@joyqi
Copy link
Member

joyqi commented Oct 21, 2021

定位了一下,应该是日语档里关于时间的这几个复数没有翻译
截屏2021-10-21 下午9 37 12


截屏2021-10-21 下午9 37 25

@lee89tw14
Copy link
Author

剛才測試了一下,如果只留zh_tw的話正常,所以有問題的確定是ja_jp的檔案,不過關於時間的部分我應該是沒有動過的,而且在poedit中他被歸類為單複數合併譯文,我直接用複數的寫法也是會出錯

@lee89tw14
Copy link
Author

更新一下,我把poedit的日文格式強制切成單複數譯文分離後正常了,不好意思是我這邊搞大烏龍,我重新推上來

@lee89tw14
Copy link
Author

不好意思又再問個問題,
Typecho的語言文件似乎只能對應到預設主題,如果切換主題的話就會一樣出現狀況
舉例:
我使用日文介面,切換到G主題後返回以下錯誤
Return value of Typecho\I18n\GetText::ngettext() must be of the type string, null returned
這部分再麻煩排查一下,感謝

@joyqi
Copy link
Member

joyqi commented Oct 22, 2021

这应该是主题里用的部分语言没有翻译导致,你如果更新到最新的开发版就不会报错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants