Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
656be1f
Lingo-lens
trivedikavya Jan 22, 2026
cd1080d
Unwanted Folder Created
trivedikavya Jan 22, 2026
1697add
Advance Features Added
trivedikavya Jan 23, 2026
4e04cc2
test: verification
trivedikavya Jan 23, 2026
9dfae27
Testing
trivedikavya Jan 23, 2026
1f77b53
Going to re add Lingo-lens
trivedikavya Jan 23, 2026
e7a074a
Lingo-lens
trivedikavya Jan 23, 2026
9b3cdc4
feat: add changeset for LingoLens
trivedikavya Jan 23, 2026
97a4019
Merge branch 'lingodotdev:main' into community/lingo-lenss
trivedikavya Jan 28, 2026
e081d97
coderabbit feedback
trivedikavya Jan 28, 2026
1a7af03
Env Variable changed
trivedikavya Jan 29, 2026
555fe25
Merge branch 'lingodotdev:main' into lingolens
trivedikavya Jan 29, 2026
005bb9f
Merge branch 'main' into lingolens
sumitsaurabh927 Jan 29, 2026
7c9b04e
Merge branch 'lingodotdev:main' into lingolens
trivedikavya Jan 29, 2026
5f3c571
fix(community/lingo-lens): resolve PR feedback and add changeset
trivedikavya Jan 29, 2026
f835d0a
fix(community/lingo-lens): resolve PR feedback and add changeset
trivedikavya Jan 29, 2026
dc3d3d8
fix(community/lingo-lens): resolve PR feedback and add changeset
trivedikavya Jan 29, 2026
fc4b2d0
fix(community/lingo-lens): address reviewer feedback on README and up…
trivedikavya Jan 29, 2026
bd14e2f
fix(community/lingo-lens): address reviewer feedback on README and up…
trivedikavya Jan 29, 2026
5010ca9
fix(community/lingo-lens): address reviewer feedback on README
trivedikavya Jan 29, 2026
4902065
Merge branch 'main' into lingolens
sumitsaurabh927 Jan 30, 2026
d92f7e2
fix: improve translation accuracy and resolve local linting issues
trivedikavya Jan 30, 2026
19740c7
Merge branch 'main' into lingolens
sumitsaurabh927 Jan 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/busy-bars-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
25 changes: 25 additions & 0 deletions community/Lingo-lens/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env
79 changes: 79 additions & 0 deletions community/Lingo-lens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# LingoLens πŸ“Έ

**LingoLens** is a powerful **AI Visual Translator** built for the **Lingo.dev Community Sprint**.

It upgrades standard OCR with **Intelligent Script Detection** and **Lingo.dev's AI Language Inference**. Wrapped in a stunning **Glassmorphism UI**, it allows users to upload images of text (receipts, signs, documents) and automatically detects the language script and translation context in real-time.

## πŸŽ₯ Demo & Testing
We have provided resources to help you test the application quickly:

### 1. Watch the Demo
> **[Click here to watch the Demo Video on YouTube πŸ“Ί](https://youtu.be/ZJFpRb-49eE)**

### 2. Test with Sample Data
I have included a sample receipt image in this repository for you to test with:
* **File:** [`test.png`](./test.png)
* **Usage:** Drag and drop this image into the app to see the Auto-Detection and Translation in action immediately.

## πŸš€ Lingo.dev Features Highlighted
This project demonstrates key capabilities of the Lingo.dev ecosystem:
1. **AI Language Inference:** Uses the `sourceLocale: null` feature of the **Lingo.dev SDK** to automatically identify the source language from the text context.
2. **Smart Script Detection:** Implements **Tesseract OSD** (Orientation & Script Detection) to dynamically load the correct OCR alphabet (e.g., Japanese vs. Latin) before reading.
3. **Real-time Localization:** Uses `lingo.localizeText` to provide accurate, context-aware translations for dynamic user content.
4. **Secure Backend Proxy:** Implements a robust Node.js/Express bridge (`server.js`) to handle API authentication securely.

## πŸ› οΈ Setup Instructions

### Prerequisites
* Node.js (v18 or higher)
* A Lingo.dev API Key

### 1. Installation
Navigate to the project directory and install dependencies:
```bash
cd community/Lingo-lens
npm install
```

### 2. Configuration
Create a .env file in the root of the Lingo-lens directory and add your API key:
```bash
LINGO_API_KEY=link_your_actual_api_key_here
```

### 3. Running the App

This application requires **both the backend server** (to communicate with Lingo.dev) and the **frontend client** (React) to run simultaneously.

---

### Terminal 1 β€” Backend Server

```bash
node server.js
```

You should see: `βœ… Proxy Server running on http://localhost:3001`


### Terminal 2 β€” Frontend Client

```bash
npm run dev
```

Open the URL shown in the terminal: `(usually: http://localhost:5173)`

## πŸ“– How It Works

1. **Upload & Detect** User uploads an image. The app first runs **Tesseract OSD** to detect the script (e.g., "Han" for Chinese, "Latin" for English).

2. **Extract (OCR)** Based on the script, the app loads the optimized OCR model (e.g., `chi_sim` or `eng`) and extracts the raw text from the image.

3. **Inference** The frontend sends the text to the server with `sourceLang: 'auto'`.

4. **Translate** The **Lingo.dev SDK** analyzes the text content, infers the source language, and generates a context-aware translation.

5. **Result** The original text and the translation appear instantly on the animated Glassmorphism interface.


Binary file added community/Lingo-lens/demo.mp4
Binary file not shown.
29 changes: 29 additions & 0 deletions community/Lingo-lens/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
13 changes: 13 additions & 0 deletions community/Lingo-lens/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>lingo-lens</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading