Skip to content
Prompt

social-media-translator — Cursor Rules

by brianluft

AI Summary

A Cursor rules booster that enables developers to build iOS apps for translating burned-in video subtitles using Vision OCR and Apple's translation API. Useful for developers working with multilingual video content and social media platforms like RedNote.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "social-media-translator — Cursor Rules" prompt rules to my project.
Repository: https://github.com/brianluft/social-media-translator

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Social Media Translator — Translate foreign language videos and screenshots from social media to your language

Features

• Import videos from photo library • Vision-powered OCR subtitle detection • Translation using Apple's API • Overlay translated subtitles during playback

Social Media Translator

iOS app to translate burned-in video subtitles to user's preferred language.

Core Components

• SubtitleDetector • Vision framework for OCR with rectangle detection • Text segment detection and tracking • Outputs FrameSegments list with position data • Progress reporting during detection • TranslationService • Apple Translation framework • Batch processing of text segments • Maintains segment positions • Progress reporting • VideoPlayerController • AVKit player with multi-segment overlay support • Basic playback controls • SubtitleOverlayRenderer • SwiftUI-based subtitle display • Position-aware rendering with overlap avoidance • Style management with customizable appearance • TextSegment • Text content and position • Rectangle in normalized coordinates • Unique identifier for tracking

Tips

• A TranslationSession can ONLY be created through a translationTask on a SwiftUI view. The lifetime of the session will be tied to the lifetime of the view. There is absolutely no other way to do it. You cannot create a TranslationSession yourself. • Don't use os.Logger. Use print() instead. • Never use AVAsset(url:) - it's deprecated in iOS 18.0. Always use AVURLAsset(url:) instead. • Never use @preconcurrency. Write all code to be compliant with Swift 6 changes. • When fixing compiler and linter warnings, do it properly. Don't take shortcuts or try to ignore the warning. If you have to redesign your code to fix the warning, so be it. Warnings are there for a reason.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1y ago
Dead
AdoptionUnder 100 stars
5 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars5
Issues0
Updated1y ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more