Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:masterfromjaviereguiluz:fix_31562
Dec 3, 2019

Conversation

javiereguiluz
Copy link
Member

@javiereguiluzjaviereguiluz commentedJul 5, 2019
edited
Loading

QA
Branch?4.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31562
LicenseMIT
Doc PRI'll do it if this is approved

This would allow to set this option:

->add('language', LanguageType::class, ['choice_self_translation' =>true,])

To display each language translated into its own language:

image

@ro0NL if this proposal is approved, could you please tell me why I musttry ... catch with\Exception?

  • First, I need the try..catch because of a special language with the code "root" which triggers exceptions (The resource bundle "symfony-code/src/Symfony/Component/Intl/Resources/data/languages/root.json" does not exist)
  • Second, I must catch \Exception because when I try to catch the exact exception (Symfony\Component\Intl\Exception\ResourceBundleNotFoundException) the exception is not caught. Why?

noniagriconomie reacted with thumbs up emojifancyweb, yceruto, and OskarStark reacted with heart emoji
Copy link
Member

@ycerutoyceruto left a 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?

});
},
'choice_self_translation' => false,
Copy link
Member

@ycerutoycerutoJul 5, 2019
edited
Loading

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

Copy link
Contributor

@ro0NLro0NL left a 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

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

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 👍

javiereguiluz reacted with thumbs up emoji
@ro0NL
Copy link
Contributor

when I try to catch the exact exception, the exception is not caught.

🤔 that's confusing :) if you iterate getNames for codes it should be fine by default.

@ro0NLro0NL mentioned this pull requestJul 6, 2019
fabpot added a commit that referenced this pull requestJul 8, 2019
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
@fabpot
Copy link
Member

The PR related toroot has been merged now.

javiereguiluz reacted with thumbs up emoji

Copy link
Member

@fabpotfabpot left a 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?

@javiereguiluz
Copy link
MemberAuthor

Rebased. Thanks.

@fabpot
Copy link
Member

Thank you@javiereguiluz.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ro0NLro0NLro0NL left review comments

@ycerutoycerutoyceruto left review comments

@fabpotfabpotfabpot approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@javiereguiluz@ro0NL@fabpot@yceruto@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp