You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use GCS for cache, make it public.
Use official Google Translate API
Design
Ops
We will operate this under the ops@getcourgaenow account. We use it for other things like this.
Sec
Because we are going to use this for the CLI and Server, the caller needs to handle collecting credentials and passing it down.
At runtime, the CLi should ask for auth credentials, and then cache and proceed.
At runtime, the Server ( for product example below ) needs to pull credentials from config.
Logic flow
Check cache for miss, etc
check google trans, and update cache and return data.
HIL ( human in loops )
Cli can edit the cache on Google.
Ops needed are search, listall, replace, delete, deleteall ( requires special "-f" flag for force ).
HA
google gives it for free.
But we might need to copy all of a cache and then move all the data to another account..
So maybe we need a backup and restore. THis is really like what our real Operations needs to backup data to google and then restore from it. So if we make this work for this Issue we can reuse it for that too.
Suggested code approach:
shared/servers/google
shared code for accessing google storage that can be used by bs-lang but also other things we will need for various functionality we need now and going forward.
Seems like a good fit because its a KV the Ops and Auth aspects we need.
We will need to also do the same with badger acting as a Lang Service cache for the Product. By Product i mean that the system will need to provide at runtime a translation service ( for example real time translated chat), and we will want to cache it in our google storage cache and in their server ( which uses badger ).
rename it hackgoogletranslation.go, in case the hack gets fixed, but dont call it from anywhere.
shared/tool/bs-lang/services/googletranslation.go
new file.
match the funcs from translation.go
imports shared/servers/google
does the logic
shared/tool/bs-lang/services/write.go
func GenerateMultiLanguageFilesFromTemplate is the entry point from the looks of it.
calls translation.go, so change to call same method signature in googtranslation.go
auth approach:
Make it work with and without auth. We will need both.
For auth, use a Google Service Token. The caller ( CLi and later other things ) needs to have that in their config.
Its a pain that bs-lang for a developer will need a config. But looks like we have no choice.
The text was updated successfully, but these errors were encountered:
joe-getcouragenow
changed the title
bs-lang needs to use official API.
bs-lang hack has stopped working, so lets use the official API.
Jan 27, 2021
joe-getcouragenow
changed the title
bs-lang hack has stopped working, so lets use the official API.
bs-lang hack has stopped working, so lets use the official API ( Ready for review )
Jan 27, 2021
Use GCS for cache, make it public.
Use official Google Translate API
Design
Ops
Sec
Logic flow
HIL ( human in loops )
HA
Suggested code approach:
shared/servers/google
shared/tool/bs-lang/services/translation.go
shared/tool/bs-lang/services/googletranslation.go
shared/tool/bs-lang/services/write.go
auth approach:
The text was updated successfully, but these errors were encountered: