承接 transi-store/symfony-translation-provider 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

transi-store/symfony-translation-provider

Composer 安装命令:

composer require transi-store/symfony-translation-provider

包简介

Transi-Store Translation Provider Bridge for Symfony

README 文档

README

Provides Transi-Store integration for Symfony Translation.

Installation

composer require transi-store/translation-provider

DSN example

# .env
TRANSI_STORE_DSN=transi-store://API_KEY@default/ORG_SLUG/PROJECT_SLUG

where:

  • API_KEY is the API key generated from your Transi-Store organization settings
  • ORG_SLUG is your Transi-Store organization slug
  • PROJECT_SLUG is your Transi-Store project slug

The default host resolves to transi-store.com. You may replace it with a custom host if you run Transi-Store behind your own domain.

How it works

Each Transi-Store file maps to a Symfony translation domain. The provider fetches the project metadata (GET /api/orgs/{org}/projects/{project}) to build this mapping from the filePath declared for each file (e.g. translations/messages.<lang>.yaml ↔ domain messages).

Translations are exchanged using the XLIFF format.

Supported operations

  • read: downloads XLIFF translations per locale and domain.
  • write: uploads the catalogue as XLIFF per locale and domain.
  • delete: not supported — calling it raises a RuntimeException.

Configuration (Symfony)

1. Enable the bundle

If you use Symfony Flex, the bundle is enabled automatically. Otherwise, register it manually in config/bundles.php:

// config/bundles.php
return [
    // ...
    TransiStore\TranslationProvider\TransiStoreTranslationProviderBundle::class => ['all' => true],
];

The bundle registers TransiStoreProviderFactory as a service tagged with translation.provider_factory, so nothing else is needed in services.yaml.

2. Declare the provider

# config/packages/translation.yaml
framework:
  translator:
    providers:
      transi_store:
        dsn: "%env(TRANSI_STORE_DSN)%"
        locales: ["en", "fr"]
        domains: ["messages"]

ICU Support

To use ICU message format, make sure your file paths include the +intl-icu, but before the <lang> placeholder, e.g. translations/messages+intl-icu.<lang>.yaml. But in your domain, you should omit the +intl-icu part, e.g. messages AND you should add the --intl-icu --force option to the command. If you don't, then Symfony will not suffix the file with +intl-icu.

Resources

统计信息

  • 总下载量: 665
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固