Ghost: Custom error message - custom-error-pages

Is there a way to have custom error message. For example, instead of having Page Not Found for 404, we can have Page Non Trouvé (in french!).
Is it possible? Directly from the error.hbs page?
Or maybe is it a french pack?
Thanks!

Yes you can provide your own error.hbs file with your template (see: http://support.ghost.org/ghost-themes-overview/#error.hbs). In your custom error page you can show the error message in french or customize it's appearance with handlebars.
Ghost is going to provide better language support in the future. For now it's still on the wishlist (see: http://ideas.ghost.org/forums/285309-wishlist/suggestions/7191893-localization).

Related

Magento 2, PageBuilder - adding custom content type

I'm trying to add custom content type to existing page builder module in Magento 2 following https://devdocs.magento.com/page-builder/docs/create-custom-content-type/overview.html
Bit of a problem that docs is kind of outdated, but the biggest issue for me right now, is that for some reason, panel with settings of content type is not loading. Console doesn't throw any errors and I'm not even sure how to debug this.
Normal behavior: https://drive.google.com/open?id=1OClPda-WGuc7idNogUnTz0wi4ZSk_Qu_
Behavior of custom content type (settings are not loading at all): https://drive.google.com/open?id=1I-IeTImec-M8DuLfgjiA193mhm0Fwtd8
Maybe someone already stumbled upon issue like this and know possible ways to solve it?
Ok I've found out what problem was, so I'm answering this question in case someone will need this in future.
Check your ui_component xml structure, I was having an issue with naming there (namespace was not correct), and that's why it was not loading.

Laravel custom error message

I am developing a web application using laravel5. I want to remove the default error message and put my custom error message.How do i do that?
Thanks in advance
You have to add appropriate error pages in errors view folder - like 503.blade.php, 500.blade.php and so on. And then add some logic in app/Exceptions/Handler.php file.

OpenCart auto complete broken on featured module

apologies if this has already been covered.
I have an issue where i can't add products to the featured module as the auto-complete doesn't find anything and never drops down. Is this something that's happened for any one else?
Currently using v1.5.6
Error shown in console after any action on the featured module admin page is...
"event.returnValue is deprecated. Please use the standard event.preventDefault() instead. "
OpenCarts error log shows...
'PHP Notice: Undefined variable: filter_category in /home/sites/cardboutique.ie/public_html/admin/controller/catalog/product.php on line 1434'
I've re-upped all the files (as it was working) but no joy.
I also doubt the first error is the main issue but don't have decent enough knowledge to vouch for that.

Automatic text translation at MSDN pages - How to turn off?

Is there a way to turn off the automatic text translation at the MSDN library pages ?
I do prefer English text but due to having a German IP address Microsoft activates the automatic translation on every new page load which gives me a yellow box with a German translation of the text I am currently hovering over with the mouse.
This happens regardless what language is initially set in the right upper corner and regardless of whether I am logged in or not.
I can't tell how annoying this is !!
Any ideas, anyone ?
When you hit the "Original" radio button at the top, you see English, with German in the yellow hover box.
If you visit the original English site, you don't see a translation, not even on hover.
You switch to English by replacing /de-de/ in the URL with /en-us/. As in
German (translation or original with translation on hover):
http://msdn.microsoft.com/de-de/library/system.diagnostics.contracts.contractargumentvalidatorattribute(v=vs.110).aspx
English only (no translation):
http://msdn.microsoft.com/en-us/library/system.diagnostics.contracts.contractargumentvalidatorattribute(v=vs.110).aspx
If you are a firefox user, you can use Redirector addon. Create a new redirect and set it up like this:
It will automatically redirect all msdn requests to english non-translated versions.
Found it! I mean, it's 2016, 3 years late, and maybe they just added it recently, but when you scroll all the way down there's a small button in the left bottom corner where you can choose language you want to use (more specifically a country "you're from").
MSDN uses the prefered language from your web browser settings.
http://social.msdn.microsoft.com/Forums/en-US/6543407d-f743-48fb-965b-b8af9f9a0cb1/howto-disable-automatic-translation-into-german?forum=msdnfeedback
This is due to the Accept-Language header:
http://www.w3.org/International/questions/qa-accept-lang-locales
So setting your browser to prefer English language websites should fix this problem. W3C has an overview how to do that on different browsers here:
http://www.w3.org/International/questions/qa-lang-priorities.en.php
There is a chrome addon aswell
Switcheroo-Redirector
I got tired of replacing manually the url of the MSDN docs to target en-us in the url, so I came up with this little user script for the very handy Tampermonkey extension (available on Chrome, Microsoft Edge, Opera, and Firefox)
// ==UserScript==
// #name MSDN docs [en-us] redirect
// #version 0.1
// #description Redirects to the en-us version of the current MSDN doc page
// #grant none
// #match https://learn.microsoft.com/*
// ==/UserScript==
(function () {
let pathname = window.location.pathname.split('/');
if (pathname[1].toLowerCase() !== 'en-us') {
pathname[1] = 'en-us';
pathname = pathname.join('/');
window.location.href = window.location.origin + pathname + window.location.search;
}
})();
Once you have the extension installed,
Click on its icon
Click on Create a new script...
Paste the previous code
Save it (Ctrl + S or File > Save).
Test the redirection: https://learn.microsoft.com/fr-fr/dotnet/csharp/programming-guide/classes-and-structs/classes
The #match property will ensure that this script is only run against MSDN doc pages.
Recently I came across the same problem. And I solved it with Chrome extension ModHeader.
I configured and it works:
I know it's an old question, by maybe this insight will be useful to someone.
I almost always open msdn through a search in google. It most of the time offered me site translated to my local language (through a part of the address with locale), sometimes accompanied by original (English) version next to it. If I click on the original language link, it does not translate anything, so it is not automatic translation based on my localization.
What solved my problem was to change google search settings to prefer English, rather than my native language. Go to google search settings, set Which language should Google products use? to English, then in Currently showing search results in: click Edit and check other languages you are likely to search in.
It will also change the UI language for google. I know it might be a high price to pay, but I believe it is worth it. If you search for a query typed in given language, results will most likely result in this language pages anyway.
Instead of extensions, which will consume memory and are a bit overkill for that kind of thing, you can use a custom search query.
Chrome
Settings => Manage Search Engines, add this entry:
Engine: MSDN US
Keyword: ms
URL: https://social.msdn.microsoft.com/Search/en-US?query=%s (or whatever the proper url is at the time of your reading, just use %s wherever it needs the actual query string)
Now, in the address bar, just type ms [SPACE]. As soon as you press the space, it will prompt you with Search on MSDN US:. Just type your query now. For instance ms string will redirect you to the MSDN-US version of the search results for string. Of course you can change the title and keyword.
I'm sure the other common browsers expose that kind of functionality too. On Firefox, I used to plug custom search engines on the search bar.
This is a neat trick that I use for all kinds of searches (SO, Amazon, Wikipedia in different languages, etc.). It's very efficient.
Usually there is a language link at the bottom of the page where you can change language (even though a permanent site specific setting would be much nicer).
In IE in Internet Options Panel you have Apperrance part in General Tab. Add preffered language as a first and from now on all pages from MSDN will be presented in choosen language
I'm using NoScript addon with Firefox (actually Waterfox), just forbib "m-msft.com", the translator will be turned off. I think you can use other plugins in other browser to forbid the domain too. NoScript is a must have addon for any serious web user, and UserStyles, of course.

Alternative to Controller.flash in Play! 1.2.4

I currently use Play Framework's Controller.flash to set my errors before rendering.
As a result, the displayed error is often shown during 2 navigation steps. It is the expected behaviour since I don't always redirect.
So my question is : Does Play provides a way to handle simple render errors (like flash is handling redirect errors) ?
Or shall I manage my own error parameter ? Or shall I always ensure that I redirect ?
The flash scope is only for redirecting to another page. If you don't redirect, but call the render() method directly, then simply don't use flash. The error will automatically be available in you view.