Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup local dev environment #10

Open
OGoodness opened this issue Sep 15, 2020 · 10 comments
Open

Setup local dev environment #10

OGoodness opened this issue Sep 15, 2020 · 10 comments

Comments

@OGoodness
Copy link

I was wondering if there was a readme or some documentation on how to set this application up locally so that others can extend upon it.

I've run into several issues due to missing dependencies

@farshed
Copy link
Owner

farshed commented Sep 17, 2020

Hey @OGoodness, can you please give an example of what kind of issues you're running into?

@OGoodness
Copy link
Author

@farshed
At the moment it's just simple issues.
I npm install, then try and run react-native.
Unsure if it's setup to be run in a emulator, direct connect to hardware, using expo, or if it can run via web interface for testing.

Granted, this is kind of a user issue, but I was hoping that you could add something to the readme on how to set up the system locally. Whether that is a simple "Just npm install and run an emulator"
But I feel like a guide would go a long way :D

@OGoodness
Copy link
Author

Also, some info on what private.js should be, because that's another issue I had

@OGoodness
Copy link
Author

OGoodness commented Sep 17, 2020

Also, some info on what private.js should be, because that's another issue I had

Sorry, just realized that was a dumb question
But documentation on what the constants should be would be good

@farshed
Copy link
Owner

farshed commented Sep 17, 2020

@OGoodness It should be able to run in an android emulator/device after a simple npm install. It's not using expo so you won't be able to run it via expo cli and neither on the web. You'll need to have the React Native setup configured in your system to run it. I'll take a look at it tomorrow morning and make sure that it's runnable after pull and npm install.

private.js contains a single function called translateApiUrl that takes three arguments:

  1. ISO 639-1 language code for the source language (string)
  2. ISO 639-1 language code for the target language (string)
  3. Text to translate (string)

It returns a url that can then be pinged to get a translation back. I'm thinking about making it visible in the repo but I'm not sure since it could lead to abuse if everyone found out.

@OGoodness
Copy link
Author

@farshed
Much appreciated!
If it's using something like an API Key, then you could just make a Global Env Var and hide that

@rafaelsaback
Copy link
Contributor

@farshed, out of curiosity, soes this private.js contains the API url/key to the Google Translate API?

@OGoodness, if you haven't set up the dev environment yet, this tutorial from RN's is quite good, I went through it just a week ago: https://reactnative.dev/docs/environment-setup

@farshed
Copy link
Owner

farshed commented Sep 18, 2020

@rafaelsaback yes that's right

@OGoodness
Copy link
Author

@rafaelsaback
Thanks for the link 😄. I already had the Dev Env setup, but I agree it is pretty good.
My main issue was with the constants and the fact that I was running everything on windows and trying to use a hardware device. I switched over to Linux and used a VM and got everything working.

@mahmut-gundogdu
Copy link

mahmut-gundogdu commented Dec 3, 2020

I think if we setup a mock rest api , we would develop easily without worry about prod url or api key then i develop a code and i sent a pr #16 . if you accept pr, you could add constant/private to git, then you hide url on .env.prod file. we can use without compile error.

BTW I wish i develop a reader with built-in dictionary feature (with large amount of language support like google translate) so i am happy because i found this repo. there is a lot of pdf reader but i cant found turish dictionary. i hate switct reader to dictionary, over and over

Repository owner deleted a comment Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants