Add a new language interface - uzbek

Hi! I’m trying to add uzbek as a language following this guide from @gerhard :

But when I add the plugin in the app.yml and rebuild the app I get this error:


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

This is the repository of my plugin(translation are yet to come):

What am I missing?

3 Likes

I didn’t see an obvious problem with your plugin.

It looks like the error might be related to something other than the plugin. Unfortunately you didn’t include the actual error message in your snippet. It should have been in the output somewhere above the “FAILED” message.

I was finally able to install the plugin and display correctly among the available interface languages.
But when I try to translate a post with the discourse translate plugin it doesn’t translate and it returns Translated from [missing% {language} value] by Google

2 Likes

Looks like the translator plugin has an internal mapping for Google. This is a total hack, but you could try patching it by appending the following snippet to your plugin.rb.

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

Hi @gerhard
Thank you very much for supporting!
Is there any chance to officially upgrade the Translator in order to consider the new languages without hacking?

We need to have 6 new languages integrated in Discourse. In the next months we’ll provide the translations via crowdin, but in the meantime we need to activate the functionalities of the Translator and Multilingual plugins (as we were discussing here). I think that a Translator upgrade would be more reliable and useful to other users with the same need.

In the last weeks we already raised a couple of PRs (such these ones) to incude new locales in the Translator, but maybe it is not the same kind of request…?

You can create a PR and someone will have a look.