Transifex upload #76

Merged
akinwale merged 3 commits from transifex-upload into master 2019-12-05 13:13:10 +01:00
akinwale commented 2019-11-20 03:28:48 +01:00 (Migrated from github.com)
No description provided.
neb-b (Migrated from github.com) reviewed 2019-11-20 19:31:12 +01:00
neb-b (Migrated from github.com) commented 2019-11-20 19:31:12 +01:00

Should this be in some env?

Should this be in some env?
kauffj (Migrated from github.com) reviewed 2019-11-20 20:08:02 +01:00
kauffj (Migrated from github.com) commented 2019-11-20 20:08:01 +01:00

yes and now we're going to have to update it everywhere 😠

yes and now we're going to have to update it everywhere :angry:
kauffj (Migrated from github.com) reviewed 2019-11-20 20:09:30 +01:00
kauffj (Migrated from github.com) commented 2019-11-20 20:09:30 +01:00

it looks like this one may be just for this project, so possibly not as bad

it looks like this one may be just for this project, so possibly not as bad
kauffj (Migrated from github.com) reviewed 2019-11-20 20:40:14 +01:00
@ -0,0 +1,78 @@
const apiBaseUrl = 'https://www.transifex.com/api/2/project';
kauffj (Migrated from github.com) commented 2019-11-20 20:39:42 +01:00

all of this code should only be happening in trusted dev environments (i.e. those we have given a key too)

this is potentially an argument to keeping the model of PR'ing the translation file and having the push happen on build, because it would allow all developers to add translations without us needing to give keys out

all of this code should only be happening in trusted dev environments (i.e. those we have given a key too) this is potentially an argument to keeping the model of PR'ing the translation file and having the push happen on build, because it would allow all developers to add translations without us needing to give keys out
kauffj (Migrated from github.com) commented 2019-11-20 20:39:55 +01:00

(and code should not ship in production bundle)

(and code should not ship in production bundle)
@ -0,0 +22,4 @@
try {
// transifex api returns Python dicts for some reason.
// Any way to get the api to return valid JSON?
json = JSON.parse(text);
kauffj (Migrated from github.com) commented 2019-11-20 20:40:07 +01:00

I'm confused, you can call JSON.parse but not .json()?

I'm confused, you can call JSON.parse but not .json()?
akinwale (Migrated from github.com) reviewed 2019-11-22 03:00:55 +01:00
@ -0,0 +22,4 @@
try {
// transifex api returns Python dicts for some reason.
// Any way to get the api to return valid JSON?
json = JSON.parse(text);
akinwale (Migrated from github.com) commented 2019-11-22 03:00:55 +01:00

Yes. The parse call is an attempt to see if the response returned is valid JSON. If it's not, I just call the success callback with the raw text response instead. This happens whether or not it was a successful operation, or if an error occurred.

Yes. The `parse` call is an attempt to see if the response returned is valid JSON. If it's not, I just call the success callback with the raw text response instead. This happens whether or not it was a successful operation, or if an error occurred.
akinwale (Migrated from github.com) reviewed 2019-11-22 03:03:02 +01:00
@ -0,0 +1,78 @@
const apiBaseUrl = 'https://www.transifex.com/api/2/project';
akinwale (Migrated from github.com) commented 2019-11-22 03:03:02 +01:00

I'm not aware of a way to exclude the code specifically, but I can look into a way of loading the key dynamically instead of hardcoding.

I'm not aware of a way to exclude the code specifically, but I can look into a way of loading the key dynamically instead of hardcoding.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbryinc#76
No description provided.