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

Improve translation test module #15017

Merged

Conversation

@eternoendless
Copy link
Member

commented Aug 7, 2019

Questions Answers
Branch? 1.7.6.x
Description? Read below
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? n/a
How to test? Read below

What's this about

This PR replaces #13845 and solves the two first problems noted previously:

  1. The test module translation_test has been renamed to translationtest, since translations cannot work on modules with underscores in their name. Indeed, the domain name for translation_test would be Modules.Translationtest, which can never be reversed back to translation_test to find the original module. This required updating TranslationToolsBundle.
  2. The third component of a translation domain, in the case of modules, is the original file name. Many file names contain underscore, but it wasn't supported because the translation interface in BO used Inflector::tableize to separate the domain parts (yes domains are stored without dots in the translator dictionary, but that's another story). This has been fixed in this commit

In addition, this change also allows Module AdminControllers to reference admin templates (ie. templates located in mymodule/views/templates/admin/) without using the full route to the template (see change).

How to test

  1. Copy the translationtest module located in tests/Resources/modules over to the /modules folder.
  2. Go to modules catalog, search "translation" and install it.
  3. Configure the module, you should see a simple page containing the wording "This wording belongs to the module file".
  4. Go to /admin-dev/index.php/modules/translations. If your shop is in French you should get a screen with two wordings "Contrôleur moderne" and "Bonjour le monde"
  5. Go to /admin-dev/index.php?controller=AdminTranslationtestFoo. If your shop is in French you should get a page containing the wording "Le template Smarty"
  6. Go to index.php?fc=module&module=translationtest&controller=bar. If your shop is in French you should get a blank page containing only the wording "Ceci est un contrôleur frontal"

This change is Reviewable

@eternoendless eternoendless added this to the 1.7.6.1 milestone Aug 7, 2019
@eternoendless eternoendless requested a review from PrestaShop/prestashop-core-developers as a code owner Aug 7, 2019
@eternoendless eternoendless changed the title Allow ub Improve translation test module Aug 7, 2019
Copy link
Contributor

left a comment

LGTM

@marionf marionf added this to In progress in PrestaShop 1.7.6 via automation Aug 9, 2019
@marionf marionf moved this from In progress to To be merged in PrestaShop 1.7.6 Aug 9, 2019
@jolelievre

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

@jolelievre jolelievre merged commit 5e2d469 into PrestaShop:1.7.6.x Aug 9, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
PrestaShop 1.7.6 automation moved this from To be merged to Done Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5 participants
You can’t perform that action at this time.