大家好,我刚刚搭建完 discourse,并按照 Content Localization - Manual and Automatic with Discourse AI 的指引设置了自动翻译。
现在从后台的翻译进度可以看到,帖子内容已经被翻译了。
但是在帖子的顶部或右侧没有出现语言切换图标,这导致无法浏览翻译结果。
如图中的中文帖子,在英文界面下无法看到翻译后的内容,也没有翻译按钮。
在界面右上角的语言选择按钮倒是出现了,但只能调整界面语言。
请问我应该如何调整配置或者定位问题?
大家好,我刚刚搭建完 discourse,并按照 Content Localization - Manual and Automatic with Discourse AI 的指引设置了自动翻译。
现在从后台的翻译进度可以看到,帖子内容已经被翻译了。
但是在帖子的顶部或右侧没有出现语言切换图标,这导致无法浏览翻译结果。
如图中的中文帖子,在英文界面下无法看到翻译后的内容,也没有翻译按钮。
在界面右上角的语言选择按钮倒是出现了,但只能调整界面语言。
请问我应该如何调整配置或者定位问题?
Hey, you can go to the site setting Content localization language switcher to turn it on.
Are you referring to this?
This will only show up if the post language is different from your user’s chosen language, to indicate the “original” language.
是的,顶部和右侧都不显示。我的界面选择的英文(从右侧的日期可以看出来),帖子是中文的。
我打开了 SiteSetting.ai_translation_verbose_logs = true 。
以下是相关的日志:
Message (4 copies reported)
DiscourseAi::Translation: Detected 2 topic locales
Backtrace
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:218:in block in dispatch' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:217:in map’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:217:in dispatch' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-8.0.4/lib/active_support/broadcast_logger.rb:129:in warn’
/var/www/discourse/plugins/discourse-ai/lib/translation/verbose_logger.rb:8:in log' /var/www/discourse/plugins/discourse-ai/app/jobs/scheduled/topics_locale_detection_backfill.rb:45:in execute’
/var/www/discourse/app/jobs/base.rb:318:in block (2 levels) in perform' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in with_connection’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in with_connection' /var/www/discourse/app/jobs/base.rb:305:in block in perform’
/var/www/discourse/app/jobs/base.rb:301:in each' /var/www/discourse/app/jobs/base.rb:301:in perform’
/var/www/discourse/app/jobs/base.rb:381:in perform' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:137:in process_queue’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:77:in worker_loop' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:63:in block (2 levels) in ensure_worker_threads’
不知道和这个有关系吗?
Can you edit this post, then check if the post locale has been detected yet?
It would ideally show up as zh_CN.
Automatic post locale detection takes time and is required to determine what the language of the post is. You can also set this yourself in the composer, then the automatic detection will be skipped if the value is set.

没有显示语言,看起来是语言的自动检测有点问题,我再跟进下看看。感谢。
I don’t think there’s an issue per se, the job takes time to go through all posts. Increasing the backfill rate in settings should make things go faster. From your logs above it looks like only 2 posts every 5 minutes.
调整 rate 后,我使用一个新的浏览器测试发现显示正确了。原来的浏览器在我退出管理账号并清理掉 Cookie 也可以显示多语言了。感谢。