Translator is a React Native-based mobile application that allows users to translate text, documents, and images into different languages using various input types. The app offers seamless translation services powered by API integrations, providing a user-friendly interface with multiple input options.
- Multi-Language Support: Translate between multiple languages.
- Multiple Input Types: Translate via text, documents, camera, and gallery.
- Debounced Messaging: Automatically translate text as the user types, minimizing API calls.
- File Handling: Upload and translate documents or images directly from the device.
- Real-Time Translation: Receive instant translations based on input.
- Node.js (version 14 or later)
- Expo CLI
- Android Studio (for Android emulation) or Xcode (for iOS)
-
Clone the repository:
git clone https://github.com/YOUR_GITHUB_USERNAME/translator.git cd translator
-
Install dependencies:
npm install
-
Create a
.env
file:BASE_URL=http://your-api-url.com API_KEY=your-api-key
-
Start the project:
expo start
or
npm run ios/android/web
- Choose the source and target languages for translation.
- Select an input type (text, file, camera, gallery).
- Submit your input to see the translated output.
- Select "Camera" or "Gallery" as the input type.
- Capture or choose an image to upload for translation.
- Type your text, and the debounced input mechanism will trigger translation after a short delay.
- React Native: Mobile app development framework.
- Expo: Manages the React Native environment and provides access to device features.
- Axios: Handles HTTP requests to the translation API.
- React Hooks: For managing state and lifecycle events.
- FileSystem API (Expo): Handles file uploads.
- Camera and Media Library: Captures and uploads images.
-
Text Translation
POST /translate Body: { "q": "string", "source": "en", "target": "tr", "format": "text", "api_key": "your_api_key" }
-
File, Image or Camera Input
POST /translate_file Body (multipart/form-data): { "file": <file>, "source": "en", "target": "tr", "api_key": "your_api_key" }
- Fork the project.
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add new feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.