🤖 AI Agents & Workflows

Custom Localization and AI Integration for Apps

📁 AI Agents & Workflows 👤 Contributed by @ahmettzorlutuna 🗓️ Updated
The prompt
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 this prompt

Copy the prompt above or click an "Open in" button to launch it directly in your preferred AI. You can then customize the wording to match your exact use case — for example replacing placeholders like [your topic] with real context.

Which AI model works best

Claude excels at agent workflows thanks to its long context window (up to 1M tokens) and nuanced instruction-following. ChatGPT has native Actions (tool-calling) built in. Gemini integrates best with Google Workspace data. For autonomous workflows, Claude Sonnet 4.6 is the current sweet-spot for quality and cost.

How to customize this prompt

Adjust the agent's role and constraints to your environment. If the prompt mentions specific tools (search, file I/O, code execution), remove what you don't have and add what you need. Add guardrails: "Always ask for confirmation before writing files." Define success criteria explicitly.

Common use cases

  • Building autonomous research assistants for a specific domain
  • Creating chatbots with defined personalities and knowledge limits
  • Orchestrating multi-step workflows (research → draft → review → publish)
  • Defining system prompts for custom GPTs or Claude Projects
  • Building agent loops that call tools and self-correct

Variations

Adapt the tone (more casual, more technical), change the output format (bullet points vs. paragraphs), or add constraints (word limits, target audience).

Related prompts