Skip to main content
Glama

generate_po_template

Create or update PO templates for Webasyst applications to manage translation files and support multilingual functionality.

Instructions

Создать/обновить PO шаблон для приложения

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
localeNo

Implementation Reference

  • The main handler function implementing the 'generate_po_template' tool. It locates the Webasyst root, ensures the locale directory exists, and creates a basic PO template file if absent.
    async function generatePoTemplateTool({ app_id, locale = 'ru_RU' }) { const rootPath = await findWebasystRoot(); const poDir = path.join(rootPath, 'wa-apps', app_id, 'locale', locale, 'LC_MESSAGES'); await ensureDir(poDir); const poPath = path.join(poDir, `${app_id}.po`); if (!(await fileExists(poPath))) { const header = `msgid ""\nmsgstr ""\n"Project-Id-Version: ${app_id}\\n"\n"Content-Type: text/plain; charset=UTF-8\\n"\n"Language: ${locale}\\n"\n\n`; await fs.writeFile(poPath, header); } return { content: [{ type: 'text', text: `PO шаблон подготовлен: ${poPath}` }] }; }
  • Registration of the 'generate_po_template' tool in the ListToolsRequestSchema response, including description and input schema (parameters: app_id required, locale optional).
    { name: 'generate_po_template', description: 'Создать/обновить PO шаблон для приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string' }, locale: { type: 'string' } }, required: ['app_id'] } },
  • Dispatch handler in the CallToolRequestSchema switch statement that executes the generatePoTemplateTool when the tool is called.
    case 'generate_po_template': return await generatePoTemplateTool(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emmy-design/webasyst-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server