Transifex upload #76
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbryinc#76
Loading…
Reference in a new issue
No description provided.
Delete branch "transifex-upload"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Should this be in some env?
yes and now we're going to have to update it everywhere 😠
it looks like this one may be just for this project, so possibly not as bad
@ -0,0 +1,78 @@
const apiBaseUrl = 'https://www.transifex.com/api/2/project';
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
(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);
I'm confused, you can call JSON.parse but not .json()?
@ -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);
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.@ -0,0 +1,78 @@
const apiBaseUrl = 'https://www.transifex.com/api/2/project';
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.