Comments (13)
https://github.com/googleapis/google-cloud-ruby is the starting point to learn how to configure a google cloud account and generate a translation credentials json file.
To enable google translate, you just need a TRANSLATE_CREDENTIALS environment variable, with the content of that json file as a string. Once this is present the translation features will show up when they can be used.
The json file looks like what you can see on this page: https://cloud.google.com/iam/docs/creating-managing-service-account-keys
I hope that's enough to help you on your way, please let me know how you get on.
from loomio-deploy.
Thanks. I'm using loomio-deploy for my deployment and I'm assuming that the environment variable should be set for the loomio-app
container. Is my assumption right?
from loomio-deploy.
from loomio-deploy.
I recommend that you set all ENV's in the "env" file in the loomio-deploy directory.
I did. That hasn't enabled translations yet. I 'escaped' all double-quotes and removed spaces from the json string. Does this seem alright to you?
Only loomio-app has the .env
file referred to in the compose file.
from loomio-deploy.
yes, that looks right. That should work. If you write a comment in another language it should bring up the translate button. it might need to be a sentence or two long
from loomio-deploy.
Hmmm, that doesn't work for some reason. No requests are being made to the API either:
What could I be doing wrong? Is there a specific way service accounts need to be configured? I can see that the service account has owner
permission to the Google Cloud project and Translation API is enabled.
Anything to do on the app?
from loomio-deploy.
docker-compose config
does not list the TRANSLATE_CREDENTIALS
variable
from loomio-deploy.
I think docker compose can only have one of env_file
and environment
. I could be wrong though.
I set TRANSLATE_CREDENTIALS
in the environment key and it seems to have worked partially. I see the google translate icon but clicking on it does nothing.
from loomio-deploy.
from loomio-deploy.
You need to remove the containers, not just stop them, for new environment variables to be taken in. So docker-compose down and up are required, not just stop and start.
Yes, I've been doing this. But it still doesn't take the envvars in the .env
file.
If the translate button is appearing, then the ENV is detected and the in-app language detection is working, the problem is with your credentials and google translate is not translating for you. Have a look at your logs with docker-compose logs -f and see if there is anything in there.
Yes, you are correct. I have a problem with the way the JSON string is placed in the environment variable. I'm not sure how to make docker-compose read the contents of a file as value to an ENVVAR. Even though the string I sent was a valid JSON, there are issues with serializing it.
So the way I see it, there are three options that I can try
Option 1. Use one of the multi-line formats like so
TRANSLATE_CREDENTIALS: |
{
"JSON": "STRING",
...
}
or
TRANSlATE_CREDENTIALS: >
{
"JSON": "STRING",
...
}
Option 2: Mount the JSON file as a volume and refer to it
Option 3: Pass it as a secret with value defined from file.
from loomio-deploy.
Alright, the pipe style did the trick. Translation works now!
from loomio-deploy.
Can we add this to the documentation too, please?
from loomio-deploy.
from loomio-deploy.
Related Issues (20)
- No mail delivery HOT 5
- Cannot use LetsEncrypt HOT 3
- Group Data Import Progress [Stalled?] HOT 4
- Login Email / SMTP Failing HOT 2
- Replace Redis with Redict? HOT 1
- Storage location for user uploads? HOT 1
- "Connection refused" "failed to load command puma" after update HOT 4
- SMTP Problems HOT 2
- rake db:migrate fails after updating to stable HOT 6
- Postgres connection error HOT 8
- Custom OAuth Provider HOT 3
- FEATURES_DISABLE_PUBLIC_GROUPS=1 has not effect HOT 4
- ActiveRecord::ConnectionNotEstablished: FATAL: password authentication failed for user "postgres" HOT 8
- Mail not sent anymore after upgrade / SSL_connect returned=1 errno=0 state=error: wrong version number) HOT 3
- error on new install when setting up accounts HOT 1
- Cannot install the app with instructions HOT 6
- Trouble getting started behind a reverse proxy HOT 7
- OAuth set up clarification HOT 10
- Mailin alternatives HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loomio-deploy.