Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Suggestion on the translation system #40418

Copy link
Copy link
Closed
@ghost

Description

Description
Symfony allows you to do a lot of things, but I'm having a hard time managing languages. We do not exploit the potential of language files.
The Xliff, for example, you cannot put comments in the code, it is ignored, and if you put the comments in an xlif file, during the next update run, they are all deleted. Identical for po files. I read your files and watch to keep it simple, because there is no point in making gas plants either. I therefore took over the basis of the management of po files to directly manufacture templates, .pot.

We make the best use of the generated files and the use of PoEdit or others to translate the files with the keys and the source text. Then we take the translation program we open the .pot file, we translate, we save it in .po, the little tinkering I change the extension to .to so as not to modify the existing po system. Which gives as in the examples.

Example

By default

msgid "validator.empty.value"
msgstr "__validator.empty.value"

Capture d’écran du 2021-03-08 19-12-06

With feature

#. S "validator.selection.choice"
msgctxt "Conseille"
msgid "Cette valeur doit être l'un des choix proposés."
msgstr "Cette valeur doit être l'un des choix proposés."

#. S "validator.select.choice"
#. P "validator.select.choices"
msgctxt "Conseille 2"
msgid "You must select at least {{ limit }} choice."
msgid_plural "You must select at least {{ limit }} choices."
msgstr[0] "Vous devez sélectionner au moins {{ limit }} choix."
msgstr[1] "Vous devez sélectionner au moins {{ limit }} choix."

#. S or P using comment developper for key
msgctxt for context eg : Rage, Important, Happy etc..
and msgid they are really used for text

Look bottom right
For single
Capture d’écran du 2021-03-08 19-12-22

For plurial
Capture d’écran du 2021-03-08 19-12-30

I will not hide from you that this is the first time that I use a framework and I chose Symfony to create a project (self-taught) and to do well this project is a game that integrates forum, blog, chat, discord link etc. If I cut it represents 47 bundles. Given its size and complexity, I find myself faced with things that are missing. May I also suggest, would it be possible to add a setDefaultdomain to TranslatorInterface to avoid putting each time the domain for which the translation is intended in the controllers?

Here are the files necessarily you have to do the service in the configurations.
Translator.tar.gz

Thank you :)
Regards,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.