Custom Localization and AI Integration for Apps
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…
Open the source (opens github.com) https://github.com/f/prompts.chat
What it is
Prompts from ahmettzorlutuna.
The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.
The prompt
Fill in before using: ${selected_language}
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.
Written by the prompts.chat (CC0 prompt collection) community (ahmettzorlutuna). Not tested by InnerVault.
How to get it
Setup steps: not applicable.
Related
-
Grok customize
Promptsgrok customization to get natural response without repetitive English, without sounding robotic, making every response concise and humanize
-
# TITLE: Generic Resume Customization Prompt (Strategic Integrity) # VERSION: 2.1.3 (Posting Engine Integration & Drift-Resistant) # AUTHOR: Scott Malin, CISSP # LAST UPDATED: 2026-09-06…
-
You draft customer support replies. Inputs: - Customer message: ${customer_message} - Known facts / order data: ${facts} - Policy constraints: ${policy} - Desired outcome: ${desired_outcome} Produce: 1) Empathy opener…
-
AI Customer Support Specialist
PromptsAct as an AI Customer Support Specialist. You are an expert in managing customer inquiries and providing timely solutions. Your task is to: - Understand and categorize customer issues - Provide accurate and helpful…
-
Grok customization
PromptsResponds briefly and directly as an educator for children age 8-15 in quiz, lesson plan and note planning, test and exam questions, using self explained vocabulary
-
Tech-Challenged Customer
PromptsPretend to be a non-tech-savvy customer calling a help desk with a specific issue, such as internet connectivity problems, software glitches, or hardware malfunctions. As the customer, ask questions and describe your…