Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Translation] Add a way to retrieve the message catalogue from the translator #2435

Closed
schmittjoh opened this issue Oct 19, 2011 · 8 comments

Comments

@schmittjoh
Copy link
Contributor

Currently, there are no getters for the message catalogues of the translator.

This would be useful for tools that need to access that information.

@fabpot
Copy link
Member

fabpot commented Oct 26, 2011

The TranslatorInterface does not need to know how translation works. Furthermore, catalogues are lazy-loaded. So, there is in fact no way to get all catalogues. What we could do is add a getter for the resources, which are used to create the catalogues. Would that be useful?

@schmittjoh
Copy link
Contributor Author

What I need is the raw translation message (with placeholders):
https://github.com/schmittjoh/JMSTwigJsBundle/blob/master/TwigJs/Compiler/TransFilterCompiler.php

@stof
Copy link
Member

stof commented Apr 4, 2012

any news about it ?

@schmittjoh
Copy link
Contributor Author

I'm using reflection for now, but still think that this would be useful.

@temp
Copy link

temp commented Apr 4, 2013

+1
I also need the raw messages, right now using reflection to get the catalogues. But it's not really nice...

@jakzal
Copy link
Contributor

jakzal commented Dec 23, 2013

re #8597

@stollr
Copy link
Contributor

stollr commented Apr 23, 2014

@fabpot the getter must not be added to the TranslatorInterface. It would be enough if they are added to the framework's translator service. Or another interface, something like TranslationBagInterface, could be added.

And if the getter takes a (optional) parameter for the locale (e.g. getCatalogue($locale)) it would be easy to lazy load it with loadCatalogue().

@wouterj
Copy link
Member

wouterj commented Jul 24, 2014

This issue should get a hasPR label

@jakzal jakzal added the hasPR label Jul 24, 2014
fabpot added a commit that referenced this issue Aug 27, 2014
…(Grygir)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[Translation] added method to expose collected message

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #2435
| License       | MIT
| Doc PR        | symfony/symfony-docs#3386

Commits
-------

ef5d7c5 [Translation] added method to expose collected messages
@fabpot fabpot closed this as completed Aug 27, 2014
fabpot added a commit that referenced this issue Sep 24, 2014
This PR was squashed before being merged into the 2.6-dev branch (closes #10887).

Discussion
----------

[Translation] added LoggingTranslator.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #3015, #2435
| License       | MIT
| Doc PR       | symfony/symfony-docs/pull/4050

Commits
-------

b7770bc [Translation] added LoggingTranslator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants