添加新的语言界面 - 乌兹别克语

您好!我正在尝试按照 @gerhard 的指南添加乌兹别克语:

但是,当我将插件添加到 app.yml 并重建应用程序时,我遇到了这个错误:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1414 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
e0e2e2e1c65a3ca953eb44d052e2982b14799220bcf9863dc2b19ac01f035f02

这是我的插件的存储库(翻译尚未完成):

我错过了什么?

4 个赞

我没有发现你的插件有什么明显的问题。

看起来错误可能与插件无关。不幸的是,你的代码片段中没有包含实际的错误消息。它应该在“FAILED”消息的某个位置的上方。

我终于成功安装了插件,并在可用的界面语言中正确显示。
但是,当我尝试使用 discourse translate 插件翻译帖子时,它不会翻译,而是返回“Translated from [missing% {language} value] by Google”。

2 个赞

看起来翻译插件对 Google 有内部映射。这是一种非常规的解决方法,但您可以尝试通过将以下代码片段附加到 plugin.rb 来修补它。

after_initialize do
  if defined? DiscourseTranslator::Google::SUPPORTED_LANG_MAPPING
    DiscourseTranslator::Google::SUPPORTED_LANG_MAPPING[:uz] = "uz"
  end
end
1 个赞

你好 @gerhard
非常感谢你的支持!

有没有可能正式升级 Translator 以便在不进行黑客攻击的情况下考虑新语言?

我们需要在 Discourse 中集成 6 种新语言。在接下来的几个月里,我们将通过 crowdin 提供翻译,但与此同时,我们需要激活 Translator 和 Multilingual 插件的功能(正如我们之前在这里讨论过的 here)。我认为升级 Translator 对其他有相同需求的用户来说会更可靠、更有用。

在过去的几周里,我们已经提交了几个 PR(例如 these ones)来在 Translator 中包含新的 locale,但这可能不是同一类型的请求……?

您可以创建一个 PR,然后会有人查看。

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.