Dev Tools

Developer-oriented utilities for theme creation and translation management.

Check Translations

The pteroca:dev:check-translations command is a developer-oriented tool designed to compare two YAML translation files and identify any missing keys in the target file. It is particularly useful in ensuring consistency between translation files during development.

  • Command: pteroca:dev:check-translations

  • Alias: app:show-missing-translations (deprecated, removed in v1.0.0)

Arguments

  • mainFile (required): Main file to compare with

  • compareFile (required): File to compare with the main file

Examples

# Recommended (v0.6+)
docker exec pteroca_web_dev php bin/console pteroca:dev:check-translations \
  src/Core/Resources/translations/messages.en.yaml \
  src/Core/Resources/translations/messages.pl.yaml

# Deprecated (still works until v1.0.0)
docker exec pteroca_web_dev php bin/console app:show-missing-translations \
  src/Core/Resources/translations/messages.en.yaml \
  src/Core/Resources/translations/messages.pl.yaml

Use Cases

Translation File Validation:

  • Compare English (main) translation file with other language files

  • Identify missing translation keys

  • Ensure all translations are up to date

Example Workflow:

  1. Update English translation file (messages.en.yaml)

  2. Run comparison with other language files

  3. Add missing keys to target language files

Output

The command outputs:

  • Missing keys in the target file

  • Total count of missing translations

  • Suggested keys to add

Make Theme

The pteroca:dev:make-theme command creates a new theme scaffold with interactive configuration.

  • Command: pteroca:dev:make-theme

  • Alias: make:theme (deprecated, removed in v1.0.0)

Examples

Interactive Prompts

The command will interactively ask for:

Theme Configuration:

  • Theme name - Kebab-case identifier (e.g., my-awesome-theme)

  • Display name - Human-readable name (e.g., "My Awesome Theme")

  • Description - Brief theme description

  • Author - Your name or organization

  • Author email - Contact email

  • Version - Semantic version (default: 1.0.0)

  • License - License identifier (default: MIT)

  • PteroCA version compatibility - Minimum PteroCA version (default: 0.6.0)

What the Command Does

  1. Copies default theme to themes/{your-theme-name}/

  2. Creates template.json with your provided metadata

  3. Copies assets to public/assets/theme/{your-theme-name}/

  4. Sets up directory structure with all necessary folders

  5. Makes theme ready for customization

Example Output

Next Steps After Creation

1. Activate Your Theme:

  • Navigate to Settings → Appearance → Current theme

  • Select your new theme

  • Click Save

2. Start Customizing:

  • Edit templates in themes/dark-professional/

  • Modify styles in public/assets/theme/dark-professional/css/

  • Add JavaScript in public/assets/theme/dark-professional/js/

3. Test Your Theme:

  • Clear browser cache (Ctrl+Shift+R)

  • Check all pages

  • Test responsive design

Additional Developer Commands

Symfony Debug Commands

Cache Commands

Database Commands

Best Practices

  1. Always test in development - Use APP_ENV=dev for better error messages

  2. Version control - Track theme and translation changes in git

  3. Backup before changes - Always backup before making significant changes

  4. Follow conventions - Use established naming conventions for themes and translations

  5. Document customizations - Add comments explaining theme modifications

Last updated