0

現在のTranslation Documentationによると、Symfony2 は次の場所でメッセージ ファイル (つまり、翻訳) を探します。

the <kernel root directory>/Resources/translations directory;
the <kernel root directory>/Resources/<bundle name>/translations directory;
the Resources/translations/ directory of the bundle.

Symfony2 に調査を強制する方法はありますか

the <kernel root directory>/Resources/translations/mydirectory directory;
4

1 に答える 1

0

独自の翻訳ローダーを作成Symfony\Component\Translation\Loader\LoaderInterfaceし、 でタグ付けする必要がありtranslation.loaderます。

翻訳者はloadMessages($directory, MessageCatalogue $catalogue)メソッドを実装する必要があります。

次のように実装できます $this->symfonyLoader->loadMessages($directory."/subdir", $catalogue);

$this->symfonyLoaderDIコンテナを使用して渡すことができます

于 2013-05-29T11:07:50.903 に答える