Riccardo_Terzaghi is attempting to add Uzbek as a new language interface in Discourse by following a guide from gerhard, but encounters a migration error during app rebuild. gerhard suggests the error may lie elsewhere since the plugin itself appears correct, urging Riccardo to check earlier logs. Eventually, Riccardo succeeds in installing the plugin and displaying Uzbek among interface languages, but faces translation issues with the Discourse Translator plugin, which returns “Translated from [missing% {language} value] by Google”. gerhard offers a temporary workaround by patching the plugin’s internal Google language mapping. Davide_Montenovi1 then asks if the Translator plugin can be officially upgraded to support new languages without hacks, noting their team plans to contribute 6 new languages via Crowdin and has already submitted PRs for locale inclusion. gerhard responds that a PR can be submitted for review. The discussion highlights both technical hurdles in adding new languages and the community’s interest in making translation support more robust and officially maintainable.
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
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
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
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…?