Change default locale in Magento 2 not working - magento2

I installed Magento 2, and then installed a theme but the CSS and JS does not work.
I ran the command: php bin/magento setup:static-content:deploy
But when I visit the frontend it can not find the CSS or JS. I think it is a problem because I do not have en_US locale as default and the theme only comes with this.
So I go back to admin in: Stores > Configuration > General to try and change the default locale, but the dropdown is grayed out.
I tried every possible store view but I can't change it back to en_US.
How do I fix this?

Try this:
php bin/magento setup:static-content:deploy en_US -f

Related

Magento 2.3 debug Path Hints dont show

I enabled Magento's frontend debug path hints but they are not showing.
Infos:
- Magento 2.3.0 with Porto Theme
- Php 7.2
- Already tested to change Magento Single Store MOde and Multistore Mode
- Already made di:compile
- Already tested blank Dev IP and my own IP
- Already changed Magento Modes default and developer
- Already cleaned and flushed the cache
- Already removed generated and pub static folders
But still, the red Hintlines in Frontend don't show up.
Please follow the following steps-
Stores->Configuration->Advanced->Developer->Store View: Default Store View->
Enabled Template Path Hints for Storefront --> Yes
Enable Hints for Storefront with URL Parameter --> Yes
Parameter Value --> magento
After setting this, check on frontend by putting param (?templatehints=magento) in url like this -
http://localhost/test/index.php?templatehints=magento
You should use below steps:-
On the Admin sidebar, go to Stores > Settings > Configuration.
In the left panel, expand Advanced and choose Developer.
Expand enter image description here the Debug section and do the following:
enter image description here
After that you should clean cache.
OR
You can use below commands
For eable
php bin/magento dev:template-hints:enable
For disable
php bin/magento dev:template-hints:disable
Then clean cache
php bin/magento clean:cache

Magento 2.1.9 static files not generating on production - leaves admin blank (no styles, no scripts loading)

Upgraded to Magento 2.1.9 from 2.1.8.
Steps to replicate:
Deploy in production mode
deploy:mode:set production
Set the following paths to 0 within db:
dev/template/allow_symlink
dev/js/merge_files
dev/js/enable_js_bundling
dev/js/minify_files
dev/css/merge_css_files
dev/css/minify_files
Set the following paths value to 1:
dev/static/sign
Deploy static assets:
php bin/magento setup:static-content:deploy en_AU en_US && php bin/magento c:f
Results
Go to mydomain.com/admin and see:
Inspect this, what do we find:
A bunch of 404s to static minified files, visiting these files in from CLI also confirms they actually don't exist.
I thought that it might be a locale issue, saw this article but this didn't work for me.
I have minification turned off in my settings, all caches cleared (including Varnish). Yet this issue still persists. Front-end appears fine on the other hand.
Any help would be much appreciated, otherwise I suppose I could train the client to edit the db directly!
If you have install magento2.x in your local PC then if you can try to change line #607.
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
to
Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
Open your console/terminal, and type these commands
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush
It's working fine.
if you can try it....
I have a dirty fix whilst I continue to look at a more permanent solution. Create a permanent redirect pointing from my custom adminhtml theme - the one that doesn't get deployed to the "Magento" theme which does exist:
rewrite ^/adminhtml/<CUSTOM_THEME>/backend/(.*)$ /adminhtml/Magento/backend/$1 permanent;
In my case I am using nginx. If anyone else is experiencing this issue I hope this will provide a temporary solution for the time being.

TinyMCE-dialogs of Plone site are not translated

The main issue is a dialog for links: for external links the target dialog is empty.
But the issue itself seems to be that this dialog and also other dialogs of TinyMCE and the control panel for TinyMCE is in english, not the language of the website, which is not english.
Any hint where to start debugging?
Plone 4.3.11 , TinyMCE 1.3.23 default for Plone 4.3.11
german
Looks like the translation-files aren't compiled and that you ran into https://github.com/plone/Products.TinyMCE/issues/149, where M. v. Rees makes several suggestions for resolving.
If you have monolingual site, you can also quickly compile the German files manually, like:
$ cd eggs/Products.TinyMCE-1.3.23-py2.7.egg/Products/TinyMCE/locales/de/LC_MESSAGES
$ msgfmt -o tinymce.po tinymce.mo
$ msgfmt -o plone.tinymce.po plone.tinymce.mo

Magento 2 frontend error after installing an extension

Hello when I add an extension to Magento 2 my front-end disappears, but at the back end everything is fine and that extension is working.
I have tried increasing the PHP memory limit in PHP.ini sample and run the command PHP bin/Magento setup: static-content: deployment but the front-end is not working. So please let me know how to solve this issue.
To solve this issue, follow the steps given below:
Step 1- First flush/clean the cache of your magento
For Cache flush using command
magento cache:flush
For Clean flush using command
magento cache:clean
OR
You can also clean and flush cache types in the Magento Admin. Go to System > Tools > Cache Management. Flush Cache Storage is equivalent to magento cache:flush. Flush Magento Cache is equivalent to magento cache:clean.
Step 2- Delete the content of static folder. To delete, follow the given path
MangentoDir > pub > static.
Step 3- Run the static view files deployment tool
/bin/magento setup:static-content:deploy
Step 4- Go to the MangetoDir > pub > error and rename the local.xml.sample file to local.xml.
After going through these 4 steps, refresh the frontend page in browser to get the front-end.
php bin/magento setup:static-content:deploy -f
always works for me when no resources are available
Might be your frontend running in some other language so you need to need to deploy the content on that specific language as well like below example :
bin/magento setup:static-content:deploy en_GB en_US ro_RO
For language code, you can open the console of browser & look for any url which are failing to load, in that url you will be able to find the language code in which your frontend is working.

How to turn on error messages in magento 2

I have installed magento 2 and it working.I just created the Hello world module and it working now.
My issue was I had called non existing method in execute method.
While trying to get it to work I tried to load the page it shows blank white screen, but no error.
How do I get errors to display in magento2?
Add following code in index.php file :-
error_reporting(E_ALL);
ini_set('display_errors', 1);
Enabling Error reporting in magento2 is little tricky , as magento2 now comes with 3 different modes
Default
Developer
Production
Magento2 by default install in “default” mode and thats why you dont get the error log at the front-end of the site , that can a viewed at magento error log . You may check the complete details over here http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html
How to enable developer mode in Magento2
This is must have if you are a developer and building extension and template for magento2 , magento provide a command for this purpose . Login in to your linux terminal and under magento execute
php bin/magento deploy:mode:set developer
and it will enable the developer mode under your magento instance for production mode you can set the mode to production or default .
still if you are experiencing in error reporting
you can give a try by renaming local.xml.sample to local.xml under
pub/errors
There is a place for this. In bootstrap.php, there is:
#ini_set('display_errors', 1);
Just uncomment that.
1) app/bootstrap.php, there is:
#ini_set('display_errors', 1);
Kindly uncomment that.
2) Run below commands
php bin/magento deploy:mode:set developer
php bin/magento cache:clean
php bin/magento cache:flush
To check current mode use:
bin/magento deploy:mode:show
Instead of editing index.php or app/bootstrap.php file, you can also edit the .htaccess file to enable PHP display errors settings.
Write the following lines of code at the end of the .htaccess file present in your Magento2 website's root directory:
## enable PHP's error display settings
php_value display_errors on
## set error display to E_ALL
php_value error_reporting -1
After that,
Open terminal
Go to your Magento's root directory
cd /path/to/your/magento/root/folder
Run the following command to enable developer mode:
php bin/magento deploy:mode:set developer
To check your current developer mode, you can run the command:
php bin/magento deploy:mode:show
Please Put the following code in index.php
ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
$error = error_get_last();
echo("<pre>");
print_r($error);
}