Augmented Reality Language Learning Application
Lingua AR is an immersive AR mobile application that helps users learn new languages by detecting real-world objects and providing instant translations, example sentences, and audio pronunciation. Built with Unity and powered by Niantic Lightship ARDK.
Screen_Recording_20251214_130116_Lingua.AR.mp4
Lingua AR enables bilingual language learning where users can:
- Learn a target language (e.g., Italian) while speaking their source language (e.g., French)
- Point their camera at real-world objects to get instant translations
- Save vocabulary words for later review
- Listen to native pronunciation
- View contextual example sentences
Supported Languages: English, French, German, Italian
Platforms: iOS (ARKit), Android (ARCore), VR (OpenXR), Unity Editor (XR Simulation)
- Uses Niantic Lightship AR for advanced object recognition
- Detects 80+ common object categories (furniture, animals, vehicles, etc.)
- Confidence-based filtering (0.6 threshold)
- Visual bounding boxes with color-coded labels
- Source Language: Language you already speak
- Target Language: Language you want to learn
- Offline translation database with 4 languages
- Displays: "Source โ Target" format (e.g., "la chaise โ la sedia")
- Manual save: Tap objects to add to vocabulary
- Persistent storage via JSON
- Delete unwanted words
- Track detection count and last seen time
- Word count badge indicator
- Context-rich example sentences for each word
- Bilingual display (source โ target)
- Database of pre-written sentences
- Text-to-speech for target language
- Native platform integration (iOS/Android)
- Instant playback on demand
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LINGUA AR โ
โ (Unity 6000.2.10f1) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโ โโโโโโผโโโโโ โโโโโโผโโโโโ
โ AR โ โ UI โ โ Data โ
โ Systems โ โ Layer โ โ Layer โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโดโโโโโโโโโโ
โ โ
โโโโโโโผโโโโโโ โโโโโโผโโโโโ
โ Niantic โ โPlatform โ
โ Lightship โ โ Servicesโ
โโโโโโโโโโโโโ โโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AR DETECTION LAYER โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ARObjectDetectionManager (Niantic Lightship) โ โ
โ โ - Hardware camera input โ โ
โ โ - ML object recognition โ โ
โ โ - 80+ object categories โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ObjectDetectionSample.cs (Controller) โ โ
โ โ - Filters by confidence (0.6 threshold) โ โ
โ โ - Fetches translations (source + target) โ โ
โ โ - Emits OnFoundItemAtPosition event โ โ
โ โ - Can pause/resume detection โ โ
โ โโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโผโโโโโโโโโโโ โโโโโโโโโโโโโโโผโโโโโโโ
โ UI VISUALIZATION โ โ TRANSLATION โ
โ โ โ โ
โ DrawRect.cs โ โ TranslationDB โ
โ - Object pooling โ โ - Offline lookup โ
โ - Bounding boxes โ โ - 4 languages โ
โ - Labels โ โ - 80+ words โ
โ - Color coding โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER INTERACTION LAYER โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ USER TAPS DETECTED OBJECT โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ UIRectObject.cs (Clickable Rectangle) โ โ
โ โ - Category, Translation, SourceTranslation โ โ
โ โ - Confidence, ScreenPosition โ โ
โ โ - OnPointerClick handler โ โ
โ โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ObjectSelectionManager.cs (Focus Handler) โ โ
โ โ - Focuses clicked object โ โ
โ โ - Hides other rectangles โ โ
โ โ - Fires OnObjectFocused event โ โ
โ โ - Creates DetectedObjectData โ โ
โ โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ActionMenuPanel.cs (Action Menu) โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ โ
โ โ โ Pronunciation โ โ Examples โ โ Save Word โ โ โ
โ โ โ Button โ โ Button โ โ Button โ โ โ
โ โ โโโโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโฌโโโโโโโ โ โ
โ โ โ โ โ โ โ
โ โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโ โ
โ โ โ โ โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ TTS Manager โ โ Examples โ โ Vocabulary โ
โ (Platform) โ โ Panel โ โ Manager โ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VOCABULARY SYSTEM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ VocabularyManager.cs (Singleton) โ โ
โ โ - SaveWord(category, translation, languages) โ โ
โ โ - DeleteWord(category) โ โ
โ โ - GetAllWords() โ List<SavedWord> โ โ
โ โ - IsWordSaved(category) โ bool โ โ
โ โ - Fires OnVocabularyUpdated event โ โ
โ โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโดโโโโโโโโโโโโ โ
โ โ โ โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โ
โ โVocabularyDataโ โ SavedWord โ โ
โ โ โ โ - category โ โ
โ โ- Contains() โ โ - translation โ โ
โ โ- GetWord() โ โ - source/tgt โ โ
โ โ- AddOrUpdate()โ โ - timestamps โ โ
โ โโโโโโโโโโโโโโโโ โ - timesDetect โ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ JSON Persistence โ โ
โ โ Application.persistentDataPath โ โ
โ โ /vocabulary.json โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Subscribers to OnVocabularyUpdated: โ
โ โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ VocabularyListPanelโ โ VocabularyBadge โ โ
โ โ - Refreshes list โ โ - Updates count โ โ
โ โ - Object pooling โ โ - Shows/hides โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LANGUAGE SETTINGS SYSTEM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LanguageSettings.cs (ScriptableObject) โ โ
โ โ โ โ
โ โ Properties: โ โ
โ โ - CurrentLanguage (Target: e.g., Italian) โ โ
โ โ - CurrentSourceLanguage (Source: e.g., French) โ โ
โ โ โ โ
โ โ Events: โ โ
โ โ - OnLanguageChanged โ โ
โ โ - OnSourceLanguageChanged โ โ
โ โ โ โ
โ โ Persistence: โ โ
โ โ - PlayerPrefs: "LinguaAR_TargetLanguage" โ โ
โ โ - PlayerPrefs: "LinguaAR_SourceLanguage" โ โ
โ โ โ โ
โ โ Static Helpers: โ โ
โ โ - GetLanguageDisplayName() โ "Franรงais" โ โ
โ โ - GetLanguageFlag() โ "๐ซ๐ท" โ โ
โ โ - GetLanguageCode() โ "fr" โ โ
โ โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโดโโโโโโโโโโโ โ
โ โ โ โ
โ โผ โผ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Main Menu โ โ AR Scene Uses โ โ
โ โ โ โ โ โ
โ โ- Target โ โ- Object Detection โ โ
โ โ Dropdown โ โ- Translation โ โ
โ โ- Source โ โ- Examples Panel โ โ
โ โ Dropdown โ โ- Vocabulary Save โ โ
โ โ- Validation โ โโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Camera Feed
โ
โผ
ARObjectDetectionManager (Lightship)
โ
โโโบ Detects: "chair" (confidence: 0.85)
โ
โผ
ObjectDetectionSample.cs
โ
โโโบ Filters: confidence >= 0.6? โ
โ
โโโบ Fetches Translation (Source):
โ TranslationDatabase.GetTranslation("chair", French)
โ โ "la chaise"
โ
โโโบ Fetches Translation (Target):
โ TranslationDatabase.GetTranslation("chair", Italian)
โ โ "la sedia"
โ
โผ
DrawRect.CreateRect(...)
โ
โโโบ Creates UIRectObject with:
โ - Category: "chair"
โ - SourceTranslation: "la chaise"
โ - Translation: "la sedia"
โ - Confidence: 0.85
โ
โผ
Screen displays: "la chaise" label over detected chair
User taps detection rectangle
โ
โผ
UIRectObject.OnPointerClick()
โ
โผ
ObjectSelectionManager.FocusObject(rect)
โ
โโโบ Creates DetectedObjectData:
โ {
โ category: "chair",
โ translation: "la sedia",
โ sourceTranslation: "la chaise",
โ confidence: 0.85
โ }
โ
โโโบ Fires: OnObjectFocused event
โ
โผ
ActionMenuPanel.ShowMenu(data)
โ
โโโบ Displays: "la chaise โ la sedia"
โ
โโโบ Shows 4 buttons:
โ [๐ Pronunciation] [๐ Examples] [๐พ Save] [โ Close]
โ
โผ
User clicks "Save Word"
โ
โผ
ActionMenuPanel.OnSaveWordClicked()
โ
โผ
VocabularyManager.SaveWord(
"chair",
"la sedia",
Italian,
"la chaise",
French
)
โ
โโโบ Creates/Updates SavedWord:
โ {
โ category: "chair",
โ savedTranslation: "la sedia",
โ savedLanguage: Italian,
โ sourceTranslation: "la chaise",
โ sourceLanguage: French,
โ firstDetectedTime: "2025-01-15T10:30:00",
โ lastSeenTime: "2025-01-15T10:30:00",
โ timesDetected: 1
โ }
โ
โโโบ Writes to: vocabulary.json
โ
โโโบ Fires: OnVocabularyUpdated event
โ
โผ
VocabularyBadge.UpdateBadge()
โ
โโโบ Updates badge count: "1"
User changes language in Main Menu
โ
โผ
LanguageSelectionUI.OnDropdownValueChanged()
โ
โโโบ Validation: Source โ Target? โ
โ
โผ
LanguageSettings.CurrentSourceLanguage = French
โ
โโโบ Saves to PlayerPrefs
โ
โโโบ Fires: OnSourceLanguageChanged event
โ
โผ
All Subscribers React:
โ
โโโบ ObjectDetectionSample:
โ - Fetches new source translations
โ - Updates detection labels
โ
โโโบ ExampleSentencesPanel:
โ - Displays examples in French
โ
โโโบ ActionMenuPanel:
โ - Shows "French โ Italian" format
โ
โโโบ VocabularyManager:
- Saves words with French source
| Component | Responsibility | Key Methods |
|---|---|---|
| ARObjectDetectionManager | Hardware camera access, ML inference | (Niantic Lightship API) |
| ObjectDetectionSample | Detection controller, filtering, translation | OnFrameReceived(), Pause(), Resume() |
| DrawRect | UI visualization, object pooling | CreateRect(), ClearRects() |
| UIRectObject | Clickable detection rectangle | OnPointerClick(), SetDetectionData() |
| Depth_ScreenToWorldPosition | 2Dโ3D coordinate conversion | GetWorldPosition() |
| Component | Responsibility | Key Methods |
|---|---|---|
| ObjectSelectionManager | Focus management, event emission | FocusObject(), UnfocusObject() |
| ActionMenuPanel | Action menu UI, button handlers | ShowMenu(), Hide(), OnSaveWordClicked() |
| ExampleSentencesPanel | Example sentences display | ShowExamples(), CreateSentenceItem() |
| TTSManager | Text-to-speech (platform-specific) | Speak(), Stop() |
| Component | Responsibility | Key Methods |
|---|---|---|
| VocabularyManager | CRUD operations, event emission | SaveWord(), DeleteWord(), GetAllWords() |
| VocabularyListPanel | List UI, object pooling, search | RefreshList(), Show(), Hide() |
| VocabularyWordItem | List item UI component | Setup(), OnDeleteClicked() |
| VocabularyBadge | Word count indicator | UpdateBadge() |
| Component | Responsibility | Key Methods |
|---|---|---|
| LanguageSettings | Global language state, persistence | Properties: CurrentLanguage, CurrentSourceLanguage |
| TranslationDatabaseSO | Offline translation lookup | GetTranslation(), GetAllWords() |
| ExampleSentencesDatabaseSO | Example sentences storage | GetExamples(), GetTranslation() |
| LanguageSelectionUI | Language selection UI, validation | SetLanguage(), SetSourceLanguage() |
Used for global access to managers:
public class VocabularyManager : MonoBehaviour
{
public static VocabularyManager Instance { get; private set; }
}Components: VocabularyManager, ExampleSentencesPanel, ObjectSelectionManager, SpawnObjectsAroundObjectDetected
Decouples components via events:
public static event Action OnVocabularyUpdated;
public static event Action<TargetLanguage> OnLanguageChanged;Events:
OnVocabularyUpdatedโ VocabularyBadge, VocabularyListPanelOnLanguageChangedโ ObjectDetectionSample, UI componentsOnObjectFocusedโ ActionMenuPanel
Reduces GC pressure for frequently created/destroyed objects:
// DrawRect maintains pool of UIRectObject instances
private List<GameObject> rects = new List<GameObject>();Components: DrawRect, VocabularyListPanel
Data-driven design for game data:
[CreateAssetMenu(fileName = "TranslationDB", menuName = "...")]
public class TranslationDatabaseSO : ScriptableObjectAssets: LanguageSettings, TranslationDatabaseSO, ExampleSentencesDatabaseSO, SpawnObjectToObjectClassSO
Platform-specific implementations:
#if UNITY_IOS
private IOSTTSManager _tts;
#elif UNITY_ANDROID
private AndroidTTSManager _tts;
#endifComponents: TTSManager with iOS/Android variants
- Unity: 6000.2.10f1 (Unity 6)
- Render Pipeline: Universal Render Pipeline (URP)
- AR Foundation: Cross-platform AR abstraction
- Niantic Lightship ARDK: Advanced AR features
- Object detection (80+ categories)
- Semantic segmentation
- Depth estimation
- Persistent anchors
- iOS: ARKit + Lightship ARKit Loader
- Android: ARCore + Lightship ARCore Loader
- VR: OpenXR Loader
- Editor: Lightship Simulation + XR Environment Simulation
- Translation: Offline TranslationDatabaseSO
- TTS: Native iOS/Android speech synthesis
- Persistence: JSON (JsonUtility) + PlayerPrefs
- TextMeshPro (UI text rendering)
- Newtonsoft.Json (JSON serialization)
- Input System (new input handling)
- Unity 6000.2.10f1 (exact version required)
- Unity Hub recommended
- Platform modules:
- iOS Build Support (for iOS builds)
- Android Build Support (for Android builds)
- OpenXR Plugin (for VR)
-
Clone Repository
git clone <repository-url> cd "Lingua AR"
-
Open in Unity Hub
- Open Unity Hub
- Click "Add" โ Select project folder
- Unity version: 6000.2.10f1
- Click "Open"
-
Package Resolution
- Packages auto-resolve from
Packages/manifest.json - Wait for compilation to complete
- Packages auto-resolve from
-
Niantic Lightship Setup
- Obtain API key from Niantic Lightship
- Open
Assets/Settings/LightshipSettings.asset - Paste API key
-
Test in Editor
- Open
Assets/Scenes/AR Scene.unity - Enter Play mode
- XR Simulation activates automatically
- Open
-
Load AR Scene
- Open
Assets/Scenes/AR Scene.unity
- Open
-
Select Simulation Environment
- Window โ XR โ AR Foundation โ XR Environment
- Choose: Kitchen, Living Room, Office, etc.
-
Controls
- Mouse: Look around
- WASD: Move camera
- Right-click + drag: Rotate view
-
Interact
- Detection rectangles appear on objects
- Click rectangle to open action menu
- Test pronunciation, examples, vocabulary save