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

[Translation] Added Lokalise Provider#40927

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

Conversation

@welcoMattic
Copy link
Member

@welcoMatticwelcoMattic commentedApr 23, 2021
edited
Loading

QA
Branch?5.x
Bug fix?no
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PRsymfony/symfony-docs#15310

To follow up on#38475, this PR addsLokalise Provider.

The todo list to make it ready is:

  • Apply recent changes that have been made onProviderInterface andTranslatorBagInterface (we removed theall() andgetDomains() method from TranslatorBagInterface)
  • Add LokaliseProvider tosrc/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php file
  • Add Lokalise case toSymfony\Component\Translation\Exception\UnsupportedSchemeException
  • MoveLokaliseProvider andLokaliseProviderFactory fromSymfony\Component\Translation\Bridge\Lokalise\Provider toSymfony\Component\Translation\Bridge\Lokalise namespace
  • Write integration tests by mocking HTTP Responses

The major part of the remaining work concerns tests, I will make it done before the beginning of May.

@carsonbot
Copy link

Please note that you need squash your commits before this PR can be merged. The maintainer can also squash the commits for you, but then you need to “Allow edits from maintainer” (there is a checkbox in the sidebar of the PR).

Cheers!

Carsonbot

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do you need to adjust UnsupoortedSchemeException like we do for the Notifier?

OskarStark added a commit that referenced this pull requestApr 27, 2021
…etter (Nyholm)This PR was merged into the 5.3-dev branch.Discussion----------[CI] Sort packages by length to match modified package better| Q             | A| ------------- | ---| Branch?       | 5.x| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |Given the build error in#40927, I saw that we match "modified packages" wrong. The script things we modified `symfony/translation` rather than the new bridge. This is because we are using a simple [string matchning](https://github.com/symfony/symfony/blob/18658a29a37d6de3e73c95f96fb9e51bf1d5f59d/.github/get-modified-packages.php#L24). If we sort the packages by length, we make sure we match the most detailed (longest) string first.Commits-------f7a0bd1 [CI] Sort packages by length to match modified package better
@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch 2 times, most recently fromc41ea84 to749cca8CompareApril 27, 2021 16:23
@welcoMattic
Copy link
MemberAuthor

Thanks@OskarStark for the quick review, I have not finish the revamp of Lokalise accordingly to the recent changes 😉

OskarStark reacted with thumbs up emoji

@welcoMattic
Copy link
MemberAuthor

welcoMattic commentedMay 5, 2021
edited
Loading

status: needs review

CI failures seems unrelated to this PR.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(with easy to fix comments)

@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch 3 times, most recently from4fef59d to31df459CompareMay 7, 2021 16:35
@fabpot
Copy link
Member

Tests seem broken.

@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch from15b6ba2 to6a5d222CompareMay 9, 2021 16:02
@welcoMattic
Copy link
MemberAuthor

@fabpot I've just pushed a fix (adding symfony/config as dev dependency of the Lokalise Provider Bridge). It fixes tests on Travis. On AppVeyor, failures seems unrelated

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.

LGTM, to be merged after the HOST constant is fixed.

@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch 2 times, most recently fromebd9708 tofe0685aCompareMay 10, 2021 09:58
@welcoMattic
Copy link
MemberAuthor

welcoMattic commentedMay 10, 2021
edited
Loading

@fabpot Last comment has been addressed, branch has been rebased, it looks ready 👍

@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch 2 times, most recently from631b635 to82179a6CompareMay 10, 2021 10:05
@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch 2 times, most recently from3b068e8 to89f9e1dCompareMay 10, 2021 10:07
@welcoMatticwelcoMatticforce-pushed thefeature/lokalise-provider branch from89f9e1d to022d828CompareMay 10, 2021 10:15
@fabpot
Copy link
Member

Thank you@welcoMattic.

welcoMattic reacted with heart emoji

@fabpotfabpot merged commit0b66008 intosymfony:5.xMay 10, 2021
@stof
Copy link
Member

@welcoMattic actually, the symfony/config component is necessary when using the xliff loader (which is why it is only a dev dependency in symfony/translation as you are not forced to use xliff). As the Lokalise provider relies on loading xliff, it should have a non-dev requirement on symfony/config

@stof
Copy link
Member

@welcoMattic does this provider handle properly the fact that Symfony translation keys are only unique inside a domain, not globally ?

@welcoMatticwelcoMattic deleted the feature/lokalise-provider branchMay 10, 2021 11:51
@welcoMattic
Copy link
MemberAuthor

@stof indeed, actually all Translation Providers useXliffFileLoader for loading pulled translations, so I guess I should set symfony/config as hard dependency in Loco, Lokalise, PoEditor and Crowdin Providers?

About handling translation keys by domain and not glabally, I paid attention to handle it in all Providers after your first comment about it.

@stof
Copy link
Member

so I guess I should set symfony/config as hard dependency in Loco, Lokalise, PoEditor and Crowdin Providers?

yes, indeed.

welcoMattic reacted with thumbs up emoji

@welcoMattic
Copy link
MemberAuthor

@stof fixed here#41155

fabpot added a commit that referenced this pull requestMay 10, 2021
This PR was merged into the 5.3-dev branch.Discussion----------[Translation] Improved Translation Providers| Q             | A| ------------- | ---| Branch?       | 5.x| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       || License       | MIT| Doc PR        |Some small improvements on Translation Providers:- move symfony/config from dev dependency to hard dependency for all Bridges as all providers use XliffFileLoader to load pulled translations (cf.#40927 (comment))- replace all instances of```'headers' => [    'Authorization' => 'Bearer API_TOKEN',]```with `'auth_bearer' => 'API_TOKEN',` even in tests files.- Fix Lokalise base_uri concatenationCommits-------84fd13c Improved Translation Providers
@fabpotfabpot mentioned this pull requestMay 12, 2021
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMay 19, 2021
This PR was submitted for the 5.4 branch but it was squashed and merged into the 5.3 branch instead.Discussion----------[Translation] Introduce Translation ProvidersDocs forsymfony/symfony#38475,symfony/symfony#40926,symfony/symfony#40927, andsymfony/symfony#40947Ready for first review, but I'm not sure that I've written documentation in the right and all required places.ATM, Translation Providers Bridges packages doesn't exists, so Flex recipes are not created yet.Commits-------943a63f [Translation] Introduce Translation Providers
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

7 participants

@welcoMattic@carsonbot@nicolas-grekas@fabpot@stof@OskarStark@Nyholm

[8]ページ先頭

©2009-2025 Movatter.jp