ProjeDEV
(Proje DEV)
1
几天前我进行了更新。升级后,我遇到了一个问题。
如果“默认区域设置”是英语,则没有问题。弹出消息成功显示,但在其他语言中会出现问题。
我无法更改与聊天部分相关的某些文本。顺便说一句,我尝试过,可以在其他部分进行更改。我不确定这个问题是否仅与聊天部分有关,或者是否存在其他区域。
无论我是通过界面还是通过命令进行更新,我都遇到了同样的问题。
我今天又试了一次。我卸载了所有东西并进行了全新安装。
我有一个全新安装,没有安装任何插件或组件。
版本:3.1.0.beta2 -(6fa9a8990d)
有什么想法吗?
1 个赞
我刚刚在我的测试站点上运行了此内容,并且可以重现此问题。我有一段时间没有更新我的测试站点了,在版本 f19044af6a 上它可以正常工作,但更新到最新版本 39be3cb619 后出现了报告中的相同行为。
我的分步操作:
(版本 f19044af6a)
- 将
default locale 设置为 ‘Español’
- 将
chat dm retention days 设置为 ‘30’
- 转到
/admin/customize/site_texts 并编辑 js.chat.retention_reminders.dm
- 刷新并使用新测试用户检查消息:
更新到 39be3cb619
Message (4 copies reported)
NoMethodError (undefined method `scan' for {:one=>"Personal chat history is retained for %{count} day.", :other=>"Personal chat history is retained for %{count} days."}:Hash
keys = text.scan(pattern)
^^^^^)
lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:124:in `check_interpolation_keys'
app/models/translation_override.rb:65:in `upsert!'
app/controllers/admin/site_texts_controller.rb:88:in `update'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'
Backtrace
lib/i18n/i18n_interpolation_keys_finder.rb:6:in `find'
app/models/translation_override.rb:124:in `check_interpolation_keys'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:400:in `block in make_lambda'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:686:in `catch'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:686:in `block in default_terminator'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:200:in `block in halting'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:595:in `block in invoke_before'
activesupport (7.0.4.1) lib/active_support/callbacks.rb:595:in `each'
3 个赞
sam
(Sam Saffron)
3
@JammyDodger,有没有办法仅从 UI 纠正这种情况?
1 个赞
gerhard
(Gerhard Schlager)
4
3 个赞
ProjeDEV
(Proje DEV)
5
我认为这和你提到的链接中的有点不同。如果你将默认区域设置为非英语,并将“chat dm retention days”从 0 更改为 x 天,你就会看到问题。
另外,你提到的解决方案不起作用,即使在安全模式下也无法更改文本(js.chat.retention_reminders.dm)。尝试更改时会出现 500 错误。
2 个赞
我尝试了几种方法,但都无法重置并允许我手动更改。现在重新检查,文本已恢复为默认文本,但带有原始变量(因此没有可用的“恢复”选项),并且尝试手动编辑会引发 500 错误。我也尝试了针对另一个主题的安全模式解决方法,但似乎没有任何效果。
在英语(英国)区域设置中搜索 js.chat.retention_reminders.dm 会给我三个选项,但在西班牙语中它只提供两个。
2 个赞
gerhard
(Gerhard Schlager)
9
我们已更新翻译,因此在将 Discourse 更新到最新版本后,您应该可以在 UI 中修复此问题:
您可以通过转到“自定义”->“文本”来修复自定义字符串:
- 搜索“js.chat.retention_reminders.dm”
- 点击“编辑”
- 点击“恢复更改”并用“是”确认问题
- 点击“返回搜索”
- 搜索“js.chat.retention_reminders.dm”
- 您将看到 3 个结果,根据您的喜好自定义这些字符串
7 个赞
gerhard
(Gerhard Schlager)
12
您是否能够恢复自定义的“js.chat.retention_reminders.dm”字符串?如果这解决了您的问题,我想关闭这个 bug。
嗯,问题 #2 是我的疏忽。我会修复它。FIX: Wrong interpolation key by gschlager · Pull Request #20374 · discourse/discourse · GitHub
问题 #1 是一个不同的问题。您介意为此创建一个新的 bug 报告吗?
4 个赞
gerhard
(Gerhard Schlager)
关闭
14
此主题在上次回复后 24 小时自动关闭。不再允许回复。