Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Form] Allow to translate each language into its language in LanguageType#32388
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice ! I'd like to make it the default behavior ifchoice_translation_locale
is not provided, WDYT?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
}); | ||
}, | ||
'choice_self_translation' => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what about make it defaulttrue
ifchoice_translation_locale
isnull
else set it tofalse
? that can be achieved with a lazy default function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You obtainroot
from the language codes due
"root", |
It should be excluded.
However, strictly there's no co-relation betweengetNames
andgetLanguageCodes
. The latter can have more codes. ConsidergetNames
the canonicalized list.
For the locales this is more obvious, see
symfony/src/Symfony/Component/Intl/Resources/data/locales/meta.json
Lines 569 to 570 in09e3cef
"th_TH", | |
"th_TH_TRADITIONAL", |
Those are codes, but not available in the "canonicalized list of names".
Raises the question, shouldLocaleType
have this same option?
The option should be calledchoice_self_translate
IMHO, as it's an instruction.
👍 for the option, no real opinion if it should be default. Thoughhttp://www.flagsarenotlanguages.com/blog/best-practice-for-presenting-languages/ considers it a best practice 👍
🤔 that's confusing :) if you iterate getNames for codes it should be fine by default. |
Uh oh!
There was an error while loading.Please reload this page.
This PR was squashed before being merged into the 4.4 branch (closes#32402).Discussion---------- [Intl] Exclude root language| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->Spotted in#32388Commits-------089cc06 [Intl] Exclude root language
The PR related to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@javiereguiluz Can you rebase on current master so that we can merge?
Rebased. Thanks. |
Thank you@javiereguiluz. |
Uh oh!
There was an error while loading.Please reload this page.
This would allow to set this option:
To display each language translated into its own language:
@ro0NL if this proposal is approved, could you please tell me why I must
try ... catch
with\Exception
?Symfony\Component\Intl\Exception\ResourceBundleNotFoundException
) the exception is not caught. Why?