therichcourt/translations-testing-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

therichcourt/translations-testing-bundle

Composer 安装命令:

composer require therichcourt/translations-testing-bundle

包简介

A simple way to test translations in your Symfony application

README 文档

README

A simple way to test translations in your Symfony application.

A Symfony bundle, which provides a page in your application to input translation keys and arguments and instantly see the translation results. Useful for testing / debugging ICU based translations with multiple arguments, without having to change the state of your application for each variant, or hunt down the page which uses the translation.

alt text

Installation

composer require --dev therichcourt/translations-testing-bundle

Configuration

1. Register the bundle in config/bundles.php

TheRichCourt\TranslationsTestingBundle\TranslationsTestingBundle::class => ['dev' => true],

2. Create a configuration for the bundle in config/packages/dev/translations_testing.yaml

translations_testing:
    locales:
        - 'en'
        - 'es'
        - 'fr'
        # ...

3. Set up the routes in config/routes/dev/routes.yaml

_translations_testing:
    resource: '@TranslationsTestingBundle/Resources/config/routes.yaml'
    # Change the prefix to wherever you'd like the translations testing page to be.
    # Keep in mind any path prefixes you have on your site, for example the page may
    # end up at `/en_GB/tests/translations`
    prefix: /tests/translations

That's all the set-up done. You can now go to the page on your site, and start testing translations.

Features

  • Translate your keys into all locales
  • Test ICU translations, by passing arguments
  • Highlights potential issues, e.g. if the translated message matches the key (which could mean you're missing a translation definiton)

N.B. this is not an automated testing solution - it just makes it much easier for you to manually test the results of your translations.

Contributing

Any PRs with fixes or improvements gratefully received.

Setting the project up

Simply fork, clone and then run:

docker build -t translations-testing-bundle .
docker run -it --name translations-testing-bundle --volume .:/usr/src/app translations-testing-bundle

Connect to the container, then in there, run:

composer install

Testing

Run composer test to run all tests and lints.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-29