Skip to content
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

Transifex implementation #7680

Merged
merged 6 commits into from Apr 21, 2015
Merged

Transifex implementation #7680

merged 6 commits into from Apr 21, 2015

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Apr 14, 2015

As part of #7567 we need to switch our console commands to use Transifex.com API instead of oTrance.
The new implementation is a lot slower than before as we currently have a resource per language file (plugin). So we have 57 resources and 66 languages. The current implementation sends around 3700 api requests to transifex to update each resource and language as I didn't find a way to load "bulk data" eg. all translations over all resources and/or languages.
I've asked the tech support from transifex if there is any possibility to do that.
Let's see what they answer, otherwise the update will have a duration of about 10 minutes. (Which would be ok, I guess, as we are not doing it that often)

@sgiehl sgiehl added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Apr 14, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Apr 14, 2015

Is it possible to do the "first translation update" in a separate pull request or would it be too much of a hassle? That would allow to review the diff (when the PR is ready for review), right now there are 600 files changed and the diff is too huge to load.

@sgiehl
Copy link
Member Author

sgiehl commented Apr 15, 2015

Good point. I've removed the commit.

@sgiehl sgiehl added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Apr 20, 2015
@sgiehl
Copy link
Member Author

sgiehl commented Apr 20, 2015

Good for review. As soon as it was merged, I'll create a first automatic translation update pull request using the new transifex api

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to use the Http class?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I'll change that.

@mnapoli
Copy link
Contributor

mnapoli commented Apr 20, 2015

Looks good to me, I've commented minor details. Just out of curiosity why are "fetch translations" and "update translations" separate operations?

Could you also rebase on master (or merge master), so that the unit tests are fixed?

@mattab
Copy link
Member

mattab commented Apr 21, 2015

Nice progress @sgiehl

I'm curious: did you hear from Transifex support about possible speed improvements to API imports?

@sgiehl
Copy link
Member Author

sgiehl commented Apr 21, 2015

@mnapoli I don't know the reason why I have splitted that in the first place. Maybe as it was easier to build that part by part.
I've changed some of the stuff you commented and rebased on master. I'll merge it now and create a new pull request for translation updates using the new stuff :)

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Needs Review PRs that need a code review labels Apr 21, 2015
sgiehl pushed a commit that referenced this pull request Apr 21, 2015
Transifex implementation
@sgiehl sgiehl merged commit cd82516 into master Apr 21, 2015
@mnapoli mnapoli deleted the transifex branch April 21, 2015 22:44
@mattab mattab added the c: i18n For issues around internationalisation and localisation. label Oct 13, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: i18n For issues around internationalisation and localisation. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants