Skip to content

Features & workflows

Module Organization

Modules help organize related translation keys, making large projects manageable and enabling selective pulls and exports.

What Are Modules?

Modules group related translation keys:

output
auth/
├─ login.title
├─ login.subtitle
├─ signup.button
└─ forgot_password.text

dashboard/
├─ welcome.message
├─ stats.title
└─ nav.settings
terminal
langctl keys create my-app auth.login.title \
--module auth \
--value en="Sign In"
terminal
langctl keys list my-app --module auth

langctl export my-app -l en --module auth -o auth-en.json

# pull or push only one module's keys
langctl pull --module auth -o "src/locales/auth/{lang}.json"
langctl push --module auth    # new keys are assigned to the auth module

# publish every draft key in a module
langctl keys publish my-app --module auth

To make a repository work with a single module, add "module": "auth" to its langctl.json; pull and push then only touch that module’s keys.

Module-Based Organization

✅ Good module structure:
  - auth (login, signup, password)
  - dashboard (main UI, navigation)
  - settings (user preferences)
  - profile (user info)
  - common (shared strings)

❌ Too many modules:
  - login, signup, forgot-password (combine into "auth")
  - dashboard-main, dashboard-sidebar (combine into "dashboard")

Benefits

  1. Better Organization - Group related keys
  2. Selective Export - Pull or export only the modules you need (-m/--module)
  3. Team Collaboration - Assign modules to team members
  4. Code Splitting - Load translations on-demand

Tip

Keep modules focused and consistent. Use 5-10 modules for most projects.

Next Steps