Skip to content

Missing translation example #10399

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

Closed
Seb33300 opened this issue Sep 25, 2018 · 5 comments
Closed

Missing translation example #10399

Seb33300 opened this issue Sep 25, 2018 · 5 comments

Comments

@Seb33300
Copy link
Contributor

Seb33300 commented Sep 25, 2018

On this page: https://symfony.com/doc/current/translation/debug.html

Just after

If you delete the message Symfony is great from your translation file for the fr locale and run the command, you will get:

The result is a missing translation line because the related key was deleted from the fr locale file.
But if the translation was deleted from the fr locale file, how can the french translation J'aime Symfony could still be displayed in the result?
If it was deleted, Symfony can't know it.

Same for the next example.

Or maybe I am not understanding something :/

@xabbuh
Copy link
Member

xabbuh commented Sep 26, 2018

Good catch @Seb33300. That's indeed wrong. It should be "Symfony is great" instead as the following sentences also indicate:

Moreover, the message in the fr locale equals to the message in the en locale. This is a special case because the untranslated message id equals its translation in the en locale.

Would you like to submit a PR to fix the documentation?

@Seb33300
Copy link
Contributor Author

Maybe examples will be more clear if we use translation keys instead of english text?

@xabbuh
Copy link
Member

xabbuh commented Sep 26, 2018

That could make sense, but I think we should discuss that separately.

@Seb33300
Copy link
Contributor Author

I just created the pull request to fix examples.

But it was hard for me to understand the difference between 2 last examples.
I had to test by myself with translation keys to understand.

javiereguiluz added a commit that referenced this issue Sep 26, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

Fix translation debug examples

Fixes #10399

Commits
-------

815d5e5 Fix translation debug examples
@javiereguiluz
Copy link
Member

Fixed by #10406.

I also think that using translation keys may be a good idea here. Thanks!

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

4 participants