restapi-translations

Synchronize missing and unused REST API translation keys in PHP projects.

569|85|Updated Jun 7, 2019
One-click install
npx skills add https://github.com/mikopbx/Core --skill restapi-translations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: restapi-translations
Source: https://github.com/mikopbx/Core/tree/main/.claude/skills/restapi-translations
Command: npx skills add https://github.com/mikopbx/Core --skill restapi-translations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python3, Bash, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Manually managing 1500+ REST API translation keys across numerous PHP files is error-prone and time-consuming, leading to missing or unused keys in RestApi.php. This Skill automates the entire translation key lifecycle, ensuring your API documentation is always accurate and complete.

Core Features & Use Cases

  • Automated Key Extraction: Scans all PHP source code to find every rest_* translation key, eliminating manual tracking.
  • Comprehensive Validation: Identifies missing keys (present in code, absent in RestApi.php) and unused keys (present in RestApi.php, absent in code), providing a clear overview of translation status.
  • Safe Synchronization: Adds missing keys with context-aware Russian placeholders and safely removes unused keys, complete with automatic backups and PHP syntax validation to prevent errors.
  • Use Case: After adding a new REST API endpoint, simply run this skill. It will automatically extract any new translation keys, add them to RestApi.php with [ТРЕБУЕТ ПЕРЕВОДА] placeholders, and then prompt you to translate them. This ensures your API documentation is always up-to-date and ready for localization.

Quick Start

Enter interactive mode for full sync

./manage_translations.sh

Select option 7: Run all (extract + validate + sync)

Frequently Asked Questions about restapi-translations

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

FAQPage Schema
How do I automatically sync missing translation keys in PHP REST API files?

REST API translation sync automates extraction of rest_* keys from PHP source code and synchronizes them with RestApi.php, adding missing keys with placeholders and removing unused ones. The skill scans your entire codebase, validates against your translation file, and applies changes with automatic backups and PHP syntax validation to prevent errors.

Can I preview changes before syncing translation keys to RestApi.php?

Yes, the skill provides dry-run preview mode so you can review all proposed additions and deletions before applying them. This lets you validate the extraction results and confirm the synchronization matches your expectations without modifying your files.

What happens when I add new REST API endpoints—do I need to manually update translations?

No. After adding new endpoints, run the skill to automatically extract any new rest_* translation keys, add them to RestApi.php with Russian placeholder text, and prompt you for translation. This eliminates manual tracking of 1500+ keys across multiple PHP files.

Does this work with large PHP projects managing many REST API endpoints?

Yes, the skill is designed for projects with numerous REST API endpoints and large translation key volumes. It handles comprehensive key extraction, validation, and safe synchronization across your entire codebase while preserving file structure and providing backups.

What happens if the PHP syntax in RestApi.php becomes invalid during synchronization?

The skill includes built-in PHP syntax validation that runs after any changes. If syntax errors are detected, synchronization is halted and the automatic backup is preserved, preventing corrupted translation files.

Can I run translation sync interactively or do I need to provide all parameters upfront?

The skill supports interactive mode where you select options step-by-step, including option 7 to run full sync (extract, validate, and synchronize). This allows you to run individual extraction or validation steps separately or combine them as needed.