Skip to content

Commit f2769a4

Browse files
committed
ACP2E-1999: remove hard dependency of theme module from config module; fix unit tests errors; updated module config translations
1 parent 56a388b commit f2769a4

File tree

4 files changed

+150
-14
lines changed

4 files changed

+150
-14
lines changed

app/code/Magento/Config/Console/Command/LocaleEmulator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\Phrase;
1212
use Magento\Framework\Phrase\RendererInterface;
1313
use Magento\Framework\TranslateInterface;
14-
use Magento\Theme\Model\View\Design;
1514

1615
class LocaleEmulator implements LocaleEmulatorInterface
1716
{

app/code/Magento/Config/Test/Unit/Console/Command/ConfigShowCommandTest.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
use Magento\Config\Console\Command\ConfigShow\ValueProcessor;
1212
use Magento\Config\Console\Command\ConfigShowCommand;
1313
use Magento\Config\Console\Command\EmulatedAdminhtmlAreaProcessor;
14+
use Magento\Config\Console\Command\LocaleEmulatorInterface;
15+
use Magento\Config\Model\Config\PathValidator;
16+
use Magento\Config\Model\Config\PathValidatorFactory;
1417
use Magento\Framework\App\Config\ConfigPathResolver;
1518
use Magento\Framework\App\Config\ConfigSourceInterface;
1619
use Magento\Framework\App\Scope\ValidatorInterface;
1720
use Magento\Framework\Console\Cli;
1821
use Magento\Framework\Exception\LocalizedException;
19-
use Magento\Config\Model\Config\PathValidatorFactory;
20-
use Magento\Config\Model\Config\PathValidator;
2122
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
2223
use PHPUnit\Framework\MockObject\MockObject;
2324
use PHPUnit\Framework\TestCase;
@@ -68,6 +69,11 @@ class ConfigShowCommandTest extends TestCase
6869
*/
6970
private $pathValidatorMock;
7071

72+
/**
73+
* @var LocaleEmulatorInterface|MockObject
74+
*/
75+
private $localeEmulatorMock;
76+
7177
/**
7278
* @inheritdoc
7379
*/
@@ -99,6 +105,9 @@ protected function setUp(): void
99105
->disableOriginalConstructor()
100106
->getMock();
101107

108+
$this->localeEmulatorMock = $this->getMockBuilder(LocaleEmulatorInterface::class)
109+
->getMockForAbstractClass();
110+
102111
$this->model = $objectManager->getObject(
103112
ConfigShowCommand::class,
104113
[
@@ -108,6 +117,7 @@ protected function setUp(): void
108117
'valueProcessor' => $this->valueProcessorMock,
109118
'pathValidatorFactory' => $pathValidatorFactoryMock,
110119
'emulatedAreaProcessor' => $this->emulatedAreProcessorMock,
120+
'localeEmulator' => $this->localeEmulatorMock
111121
]
112122
);
113123
}
@@ -175,6 +185,11 @@ public function testNotValidScopeOrScopeCode(): void
175185
->willReturnCallback(function ($function) {
176186
return $function();
177187
});
188+
$this->localeEmulatorMock->expects($this->once())
189+
->method('emulate')
190+
->willReturnCallback(function ($function) {
191+
return $function();
192+
});
178193

179194
$tester = $this->getConfigShowCommandTester(
180195
self::CONFIG_PATH,
@@ -213,6 +228,12 @@ public function testConfigPathNotExist(): void
213228
return $function();
214229
});
215230

231+
$this->localeEmulatorMock->expects($this->once())
232+
->method('emulate')
233+
->willReturnCallback(function ($function) {
234+
return $function();
235+
});
236+
216237
$tester = $this->getConfigShowCommandTester(self::CONFIG_PATH);
217238

218239
$this->assertEquals(

app/code/Magento/Config/i18n/en_US.csv

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ Add,Add
1515
Enable,Enable
1616
Disable,Disable
1717
Configuration,Configuration
18-
"Class for type ""%1"" was not declared","Class for type ""%1"" was not declared"
18+
"The class for ""%1"" type wasn't declared. Enter the class and try again.","The class for ""%1"" type wasn't declared. Enter the class and try again."
1919
"%1 should implement %2","%1 should implement %2"
20-
"We can't save this option because Magento is not installed. To lock this value, enter the command again using the --%1 option.","We can't save this option because Magento is not installed. To lock this value, enter the command again using the --%1 option."
2120
"The value you set has already been locked. To change the value, use the --%1 option.","The value you set has already been locked. To change the value, use the --%1 option."
2221
%1,%1
23-
"Configuration for path: ""%1"" doesn't exist","Configuration for path: ""%1"" doesn't exist"
2422
System,System
2523
"You saved the configuration.","You saved the configuration."
2624
"Something went wrong while saving this configuration:","Something went wrong while saving this configuration:"
25+
"Something went wrong while saving this configuration.","Something went wrong while saving this configuration."
2726
"Page not found.","Page not found."
2827
"Please specify the admin custom URL.","Please specify the admin custom URL."
2928
"Invalid %1. %2","Invalid %1. %2"
@@ -37,7 +36,7 @@ System,System
3736
"We can't save the Cron expression.","We can't save the Cron expression."
3837
"Sorry, we haven't installed the default display currency you selected.","Sorry, we haven't installed the default display currency you selected."
3938
"Sorry, the default display currency you selected is not available in allowed currencies.","Sorry, the default display currency you selected is not available in allowed currencies."
40-
"Please correct the email address: ""%1"".","Please correct the email address: ""%1""."
39+
"The ""%1"" email address is incorrect. Verify the email address and try again.","The ""%1"" email address is incorrect. Verify the email address and try again."
4140
"The sender name ""%1"" is not valid. Please use only visible characters and spaces.","The sender name ""%1"" is not valid. Please use only visible characters and spaces."
4241
"Maximum sender name length is 255. Please correct your settings.","Maximum sender name length is 255. Please correct your settings."
4342
"The file you're uploading exceeds the server size limit of %1 kilobytes.","The file you're uploading exceeds the server size limit of %1 kilobytes."
@@ -49,9 +48,9 @@ System,System
4948
"website(%1) scope","website(%1) scope"
5049
"store(%1) scope","store(%1) scope"
5150
"Currency ""%1"" is used as %2 in %3.","Currency ""%1"" is used as %2 in %3."
52-
"Please correct the timezone.","Please correct the timezone."
53-
"The file ""%1"" does not exist","The file ""%1"" does not exist"
54-
"The ""%1"" path does not exist","The ""%1"" path does not exist"
51+
"The time zone is incorrect. Verify the time zone and try again.","The time zone is incorrect. Verify the time zone and try again."
52+
"The ""%1"" file doesn't exist.","The ""%1"" file doesn't exist."
53+
"The ""%1"" path doesn't exist. Verify and try again.","The ""%1"" path doesn't exist. Verify and try again."
5554
"Always (during development)","Always (during development)"
5655
"Only Once (version upgrade)","Only Once (version upgrade)"
5756
"Never (production)","Never (production)"
@@ -71,18 +70,21 @@ Store,Store
7170
"Yes (301 Moved Permanently)","Yes (301 Moved Permanently)"
7271
Yes,Yes
7372
Specified,Specified
73+
"Visible section not found.","Visible section not found."
7474
"Config form fieldset clone model required to be able to clone fields","Config form fieldset clone model required to be able to clone fields"
7575
"%1: Instance of %2 is expected, got %3 instead","%1: Instance of %2 is expected, got %3 instead"
76-
"Invalid XML in file %1:\n%2","Invalid XML in file %1:\n%2"
76+
"'The XML in file ""%1"" is invalid:' . ""\n%2\nVerify the XML and try again.""","'The XML in file ""%1"" is invalid:' . ""\n%2\nVerify the XML and try again."""
7777
.,.
7878
"'There is no defined type ' .","'There is no defined type ' ."
7979
"'Object is not instance of ' .","'Object is not instance of ' ."
8080
"Filesystem is not writable.","Filesystem is not writable."
8181
"Some error","Some error"
8282
"Some message","Some message"
83+
"You cannot run this command because the Magento application is not installed.","You cannot run this command because the Magento application is not installed."
8384
"This command is unavailable right now.","This command is unavailable right now."
8485
"The ""test/test/test"" path does not exists","The ""test/test/test"" path does not exists"
8586
"error message","error message"
87+
"The ""%1"" path doesn't exist. Verify and try again.","The ""%1"" path doesn't exist. Verify and try again."
8688
some_label,some_label
8789
some_comment,some_comment
8890
"some prefix","some prefix"
@@ -92,6 +94,7 @@ some_comment,some_comment
9294
"element tooltip","element tooltip"
9395
test,test
9496
test2,test2
97+
Action,Action
9598
"Add after","Add after"
9699
Delete,Delete
97100
"Current Configuration Scope:","Current Configuration Scope:"
@@ -118,4 +121,3 @@ Dashboard,Dashboard
118121
"Web Section","Web Section"
119122
"Store Email Addresses Section","Store Email Addresses Section"
120123
"Email to a Friend","Email to a Friend"
121-
"Taiwan","Taiwan, Province of China"

app/design/adminhtml/Magento/backend/i18n/en_US.csv

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ msg,msg
341341
"Could not append time to DateTime","Could not append time to DateTime"
342342
"The transition year isn't included in the system date range. Verify the year date range and try again.","The transition year isn't included in the system date range. Verify the year date range and try again."
343343
"Transition year is out of specified date range.","Transition year is out of specified date range."
344-
test,test
345344
"Invalid attribute for %1","Invalid attribute for %1"
346345
"Invalid tag","Invalid tag"
347346
"The scope object is invalid. Verify the scope object and try again.","The scope object is invalid. Verify the scope object and try again."
@@ -416,7 +415,6 @@ label,label
416415
"Consumer %consumer_id is not authorized to access %resources","Consumer %consumer_id is not authorized to access %resources"
417416
"Exception message.","Exception message."
418417
Message.,Message.
419-
Message,Message
420418
"Maximum items of type ""%type"" is %max","Maximum items of type ""%type"" is %max"
421419
"Maximum SearchCriteria pageSize is %max","Maximum SearchCriteria pageSize is %max"
422420
"String with translate","String with translate"
@@ -433,3 +431,119 @@ CSV,CSV
433431
One,One
434432
Two,Two
435433
"Home Page","Home Page"
434+
"Default Config","Default Config"
435+
"Save Config","Save Config"
436+
[GLOBAL],[GLOBAL]
437+
[WEBSITE],[WEBSITE]
438+
"[STORE VIEW]","[STORE VIEW]"
439+
"Use system value","Use system value"
440+
"Use Default","Use Default"
441+
"Use Website","Use Website"
442+
Add,Add
443+
"Delete File","Delete File"
444+
"Search String","Search String"
445+
"Design Theme","Design Theme"
446+
"Add \Exception","Add \Exception"
447+
Enable,Enable
448+
Disable,Disable
449+
Configuration,Configuration
450+
"The class for ""%1"" type wasn't declared. Enter the class and try again.","The class for ""%1"" type wasn't declared. Enter the class and try again."
451+
"%1 should implement %2","%1 should implement %2"
452+
"The value you set has already been locked. To change the value, use the --%1 option.","The value you set has already been locked. To change the value, use the --%1 option."
453+
%1,%1
454+
System,System
455+
"You saved the configuration.","You saved the configuration."
456+
"Something went wrong while saving this configuration:","Something went wrong while saving this configuration:"
457+
"Something went wrong while saving this configuration.","Something went wrong while saving this configuration."
458+
"Please specify the admin custom URL.","Please specify the admin custom URL."
459+
"Invalid %1. %2","Invalid %1. %2"
460+
"Value must be a URL or one of placeholders: %1","Value must be a URL or one of placeholders: %1"
461+
"Specify a URL or path that starts with placeholder(s): %1, and ends with ""/"".","Specify a URL or path that starts with placeholder(s): %1, and ends with ""/""."
462+
"%1 An empty value is allowed as well.","%1 An empty value is allowed as well."
463+
"Specify a fully qualified URL.","Specify a fully qualified URL."
464+
"Selected allowed currency ""%1"" is not available in installed currencies.","Selected allowed currency ""%1"" is not available in installed currencies."
465+
"Default display currency ""%1"" is not available in allowed currencies.","Default display currency ""%1"" is not available in allowed currencies."
466+
"Sorry, we haven't installed the base currency you selected.","Sorry, we haven't installed the base currency you selected."
467+
"We can't save the Cron expression.","We can't save the Cron expression."
468+
"Sorry, we haven't installed the default display currency you selected.","Sorry, we haven't installed the default display currency you selected."
469+
"Sorry, the default display currency you selected is not available in allowed currencies.","Sorry, the default display currency you selected is not available in allowed currencies."
470+
"The ""%1"" email address is incorrect. Verify the email address and try again.","The ""%1"" email address is incorrect. Verify the email address and try again."
471+
"The sender name ""%1"" is not valid. Please use only visible characters and spaces.","The sender name ""%1"" is not valid. Please use only visible characters and spaces."
472+
"Maximum sender name length is 255. Please correct your settings.","Maximum sender name length is 255. Please correct your settings."
473+
"The file you're uploading exceeds the server size limit of %1 kilobytes.","The file you're uploading exceeds the server size limit of %1 kilobytes."
474+
"The base directory to upload file is not specified.","The base directory to upload file is not specified."
475+
"The specified image adapter cannot be used because of: %1","The specified image adapter cannot be used because of: %1"
476+
"Default scope","Default scope"
477+
"Base currency","Base currency"
478+
"Display default currency","Display default currency"
479+
"website(%1) scope","website(%1) scope"
480+
"store(%1) scope","store(%1) scope"
481+
"Currency ""%1"" is used as %2 in %3.","Currency ""%1"" is used as %2 in %3."
482+
"The time zone is incorrect. Verify the time zone and try again.","The time zone is incorrect. Verify the time zone and try again."
483+
"The ""%1"" path doesn't exist. Verify and try again.","The ""%1"" path doesn't exist. Verify and try again."
484+
"Always (during development)","Always (during development)"
485+
"Only Once (version upgrade)","Only Once (version upgrade)"
486+
"Never (production)","Never (production)"
487+
Bcc,Bcc
488+
"Separate Email","Separate Email"
489+
"%1 (Default)","%1 (Default)"
490+
title,title
491+
No,No
492+
Optional,Optional
493+
Required,Required
494+
Website,Website
495+
Store,Store
496+
"Store View","Store View"
497+
"HTTP (unsecure)","HTTP (unsecure)"
498+
"HTTPS (SSL)","HTTPS (SSL)"
499+
"Yes (302 Found)","Yes (302 Found)"
500+
"Yes (301 Moved Permanently)","Yes (301 Moved Permanently)"
501+
Yes,Yes
502+
Specified,Specified
503+
"Visible section not found.","Visible section not found."
504+
"Config form fieldset clone model required to be able to clone fields","Config form fieldset clone model required to be able to clone fields"
505+
"%1: Instance of %2 is expected, got %3 instead","%1: Instance of %2 is expected, got %3 instead"
506+
"'There is no defined type ' .","'There is no defined type ' ."
507+
"'Object is not instance of ' .","'Object is not instance of ' ."
508+
"Filesystem is not writable.","Filesystem is not writable."
509+
"Some message","Some message"
510+
"You cannot run this command because the Magento application is not installed.","You cannot run this command because the Magento application is not installed."
511+
"This command is unavailable right now.","This command is unavailable right now."
512+
"The ""test/test/test"" path does not exists","The ""test/test/test"" path does not exists"
513+
"error message","error message"
514+
"The ""%1"" path doesn't exist. Verify and try again.","The ""%1"" path doesn't exist. Verify and try again."
515+
some_label,some_label
516+
some_comment,some_comment
517+
"some prefix","some prefix"
518+
"element label","element label"
519+
"element hint","element hint"
520+
"element comment","element comment"
521+
"element tooltip","element tooltip"
522+
test2,test2
523+
Action,Action
524+
"Add after","Add after"
525+
Delete,Delete
526+
"Current Configuration Scope:","Current Configuration Scope:"
527+
Stores,Stores
528+
"Group Label","Group Label"
529+
"Some Label","Some Label"
530+
"Tab Label","Tab Label"
531+
"Allow everything","Allow everything"
532+
"Magento Admin","Magento Admin"
533+
Dashboard,Dashboard
534+
"Manage Stores","Manage Stores"
535+
"Field 2","Field 2"
536+
"Field 3","Field 3"
537+
"Field 3.1","Field 3.1"
538+
"Field 3.1.1","Field 3.1.1"
539+
"Field 4","Field 4"
540+
"Advanced Section","Advanced Section"
541+
"Advanced Admin Section","Advanced Admin Section"
542+
"Design Section","Design Section"
543+
"General Section","General Section"
544+
"System Section","System Section"
545+
"Currency Setup Section","Currency Setup Section"
546+
"Developer Section","Developer Section"
547+
"Web Section","Web Section"
548+
"Store Email Addresses Section","Store Email Addresses Section"
549+
"Email to a Friend","Email to a Friend"

0 commit comments

Comments
 (0)