Custom Localization and AI Integration for Apps
Prompt from prompts.chat: Custom Localization and AI Integration for Apps
Prompt Content
Copy and paste directly into your model or internal evaluation tool.
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:
- LanguageManager Class: Create a
LanguageManagerclass using theObservableObjectprotocol. Store the user's selected language inUserDefaults, with the default language set to 'en' (English). Display a selection screen on the first launch. - Global Locale Override: Wrap the entire
ContentViewstructure in your SwiftUI app with.environment(\.locale, .init(identifier: languageManager.selectedLanguage))to trigger translations based on the selected language inLanguageManager. - 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.
- 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.'
- String Catalogs: Integrate
.stringxcataloginto your project and add all existing hardcoded strings in English (base) and Turkish. - Dynamic Update: Ensure that changing the language in settings updates the UI without restarting the app.
- 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.
Use Cases
Reference Output
No standard answer available; manual review by scoring dimensions is recommended.
Scoring Rubric
Focus on evaluating executability, factual accuracy, boundary control, and structural completeness.
Try & save
Fill variables and copy, or save as a personal template.
This template has no variables and is ready to copy.
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
Dreamy Slow Shutter Fashion Portrait
Prompt from prompts.chat: Dreamy Slow Shutter Fashion Portrait
Shell Scripting taste
Prompt from prompts.chat: Shell Scripting taste
Web Performance taste
Prompt from prompts.chat: Web Performance taste