Localization Developer (Smart Router)

Enforce correct Loc constant usage across iOS .xcstrings localization files.

509|79|Updated May 26, 2023
One-click install
npx skills add https://github.com/anyproto/anytype-swift --skill localization-developer-smart-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Localization Developer (Smart Router)
Source: https://github.com/anyproto/anytype-swift/tree/main/.claude/skills/localization-developer
Command: npx skills add https://github.com/anyproto/anytype-swift --skill localization-developer-smart-router

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing localized strings across multiple files and ensuring correct usage of Loc constants can be complex and error-prone, leading to broken translations. This Skill simplifies the entire localization workflow.

Core Features & Use Cases

  • 3-File System Navigation: Guides you on where to add new keys (Auth, Workspace, UI .xcstrings files) and how to avoid duplicates, ensuring a clean localization structure.
  • Dynamic Localization: Explains how to correctly use parameterized Loc constants for dynamic text, preventing manual string formatting errors.
  • Use Case: When adding new user-facing text to the UI, activate this Skill to quickly determine the correct .xcstrings file, add the key, run make generate, and use the Loc constant, ensuring no hardcoded strings are introduced and saving you debugging time.

Quick Start

I need to add a new localized string for a settings screen. Which .xcstrings file should I use, and what's the correct format?

Frequently Asked Questions about Localization Developer (Smart Router)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent hardcoded strings in my iOS app's localization?

Prevent hardcoded strings by using `Loc` constants tied to keys stored in your .xcstrings files. This Skill guides you to add keys to the correct Auth, Workspace, or UI .xcstrings file, run `make generate` to produce Strings.swift, and reference the resulting `Loc` constant instead of embedding text directly in code.

What's the correct workflow for adding new localized strings to an iOS project?

Determine which .xcstrings file your string belongs to (Auth, Workspace, or UI), search for existing keys to avoid duplicates, add the new key, run `make generate` to create the Strings.swift file with `Loc` constants, then use that constant in your code.

How do I use parameterized Loc constants for dynamic text in iOS?

Parameterized `Loc` constants handle dynamic text formatting without manual string manipulation. Define keys with placeholders in your .xcstrings files, run `make generate`, and use the resulting `Loc` constant with parameters to safely inject values into localized strings.

Why should I organize localized strings across multiple .xcstrings files?

Separating strings into Auth, Workspace, and UI .xcstrings files reduces merge conflicts, improves maintainability, and prevents duplicate keys across your localization structure. This organization makes it easier to locate and update related strings.

Can I use this approach to manage translations for authentication and workspace features?

Yes. This Skill structures localization for authentication strings (Auth .xcstrings), collaboration and object management strings (Workspace .xcstrings), and general UI strings (UI .xcstrings), allowing you to organize translations by functional domain.

What happens if I add duplicate keys across my .xcstrings files?

Duplicates create inconsistent translations and maintenance overhead. This Skill enforces searching for existing keys before adding new ones, ensuring each string is defined once and preventing translation conflicts across Auth, Workspace, and UI files.