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

Be able to extract theme translations in Back Office #6071

Conversation

@mickaelandrieu
Copy link
Member

commented Aug 24, 2016

Questions Answers
Branch? develop
Description? We can now get a zip file containing all translation files from a theme (using the new xliff format, of course).
Note this feature will need to be improved once we can be able to override translations in database.
Type? new feature
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? part of http://forge.prestashop.com/browse/BOOM-1248
How to test? Select a locale and a theme, and click on "Export" action button

Important guidelines

@@ -197,7 +197,7 @@
</div>
</div>
</form>
<form action="{$url_submit|escape:'html':'UTF-8'}" method="post" enctype="multipart/form-data" class="form-horizontal">
<form action="index.php/international/translations/extract" method="post" enctype="multipart/form-data" class="form-horizontal">

This comment has been minimized.

Copy link
@kpodemski

kpodemski Aug 24, 2016

Contributor

hmm, i'm not sure if we should use hardcoded action? do we really cant use some route helper from Twig?

This comment has been minimized.

Copy link
@mickaelandrieu

mickaelandrieu Aug 24, 2016

Author Member

I plan to make the Symfony router totaly available and to remove this ugly hack on Link class.
But because it's huge, risky and totaly unrelated to what I'm doing (allow the translations of themes in back office), for now hardcode this url is "good enough" :)

ps: it's a smarty template, twig templates already have access to the Symfony router :)

This comment has been minimized.

Copy link
@kpodemski

kpodemski Aug 24, 2016

Contributor

👍

@mickaelandrieu mickaelandrieu changed the title Be able to extract theme translations in BO Be able to extract theme translations in Back Office Aug 24, 2016

use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
class ZipManager

This comment has been minimized.

Copy link
@Quetzacoalt91

Quetzacoalt91 Aug 26, 2016

Member

If we also add a function to defate zips, this class will be used as a dependancy for other classes (i.e ModuleZipManger, which has its specific functionnalities but could have shared code)

class ZipManager
{
public function createArchive($filename, $folder)

This comment has been minimized.

Copy link
@Quetzacoalt91

Quetzacoalt91 Aug 26, 2016

Member

It would be great to make this function return something, or handle the exceptions by the caller.

If we do not do that and an error occurs, I wonder if the merchant will get a proper answer from the server in production mode.

This comment has been minimized.

Copy link
@mickaelandrieu

mickaelandrieu Aug 26, 2016

Author Member

Hum... returns the filename make no sense as it is already part of the function argument.
Return true or false won't help too.. the main issue here is that the ZipArchive error handling is a pain.

I agree to improve it, but in a dedicated pull request to make this one focused on translation of themes.

@julienbourdeau julienbourdeau merged commit 5278355 into PrestaShop:develop Aug 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mickaelandrieu mickaelandrieu deleted the mickaelandrieu:be-able-to-extract-theme-translations-in-bo branch Aug 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.