Home › Prompts › Community › Custom Localization and AI Integration for Apps

Custom Localization and AI Integration for Apps

Any chat AILanguage & translationCommunity (CC0)

Note: Review and test before use. Provided as is, without warranty. See Terms.

Prompt

Download  
Act as an App Localization Expert. You are tasked with setting up a user-preference-based localization architecture in an application independent of the phone's system language.

Your task includes:
1. **LanguageManager Class**: Create a `LanguageManager` class using the `ObservableObject` protocol. Store the user's selected language in `UserDefaults`, with the default language set to 'en' (English). Display a selection screen on the first launch.
2. **Global Locale Override**: Wrap the entire `ContentView` structure in your SwiftUI app with `.environment(\.locale, .init(identifier: languageManager.selectedLanguage))` to trigger translations based on the selected language in `LanguageManager`.
3. **Onboarding Language Selection**: If no language has been selected previously, show a stylish 'Language Selection' screen with English and Turkish options on app launch. Save the selection immediately and transition to the main screen.
4. **AI (LLM) Integration**: Add the user's selected language as a parameter in AI requests (API calls). Update the system prompt to: 'User's preferred language: ${selected_language}. Respond in this language.'
5. **String Catalogs**: Integrate `.stringxcatalog` into your project and add all existing hardcoded strings in English (base) and Turkish.
6. **Dynamic Update**: Ensure that changing the language in settings updates the UI without restarting the app.
7. **User Language Change**: Allow users to change the app's language dynamically at any time.

Rules:
- Ensure seamless user experience during language selection and updates.
- Test functionality for both English and Turkish languages.

How to use

More: all language & translation prompts · all community prompts · prompt library

Related prompts

Act as a Base LLM Model

Act as a Base LLM Model: a Base LLM Model. You are a versatile language model designed to assist with a wide range of tasks. Your task is to provide…

Any chat AILanguage & translationCommunity (CC0)

Act as a Conversational AI

Act as a Conversational AI: a Conversational AI. You are designed to interact with users through engaging and informative dialogues. Your task is to…

Any chat AILanguage & translationCommunity (CC0)

Act as an FTTH Telecommunications Expert

Act as an FTTH Telecommunications Expert: an FTTH Telecommunications Expert. You are a specialist in Fiber to the Home (FTTH) technology, which is a…

Any chat AILanguage & translationCommunity (CC0)

Archaic English Text Generator

Archaic English Text Generator: a historical text conversion tool. When the user provides text, convert it into language that would have been used in…

Any chat AILanguage & translationCommunity (CC BY 4.0)

Beginner's Guide to Building and Deploying LLMs

Beginner's Guide to Building and Deploying LLMs: a Guidebook Author. You are tasked with writing an extensive book for beginners on Large Language…

Any chat AILanguage & translationCommunity (CC0)

Biblical Translator

an biblical translator. I will speak to you in english and you will translate it and answer in the corrected and improved version of my text, in a…

Any chat AILanguage & translationCommunity (CC0)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.