This question is NOT about translating the content of a web page. It is about the Exceptions thrown in the JavaScript engine.
I am wondering if all international installations of browsers, installed on international OSs, produce the exception STACK in english or in the native language.
I am NOT asking about any of the following:
- Translating a web page.
- The runtime language choice of a web page.
I am asking about a different language install of the browser where all of the UI in the browser is in the installed language including the menus, etc.
For example in the English Chrome browser I get an exception stack like this:
myState.js:10 Uncaught TypeError: Cannot read properties of undefined (reading 'stack')
at new MyStateError (myState.js:10:17)
at createState (myState.js:22:11)
at statetest.html:16:23
Will it be the same for a French or Spanish installed browser? Or will the French installed version look like this:
myState.js:10 Non capturé TypeError : Impossible de lire les propriétés d'une valeur indéfinie (lecture de 'stack')
à new MyStateError (myState.js:10:17)
à créerÉtat (myState.js:22:11)
à statetest.html:16:23
I don’t have a second machine on which I can install a different language OS and browser. Can someone that has a non-English install of a browser let me know what they get. (Again I am not concerned with page translations, I am looking for someone that has a full Non-English language version installed on a non-English OS)
You can run these lines of code in Dev Tools to find out:
let a = new Error('Testing');
console.log(a.stack)
UPDATE (2024-12-19)
I do not understand why people downvote and request to close a VALID QUESTION!! I am working on some code and I need to understand how the Exception Stack will be generated for browsers that are not running in English. I did figure it out thanks to a suggestion by @traktor and I will post it below.
2
Answers
First, than you @Traktor. Your suggestion lead me to accidentaly tell my Mac that I wanted to switch the default OS language to French and that allowed me to test this easily.
I hope that someone else also finds this information useful.
Here is my test code:
And my results from Chrome, Firefox and Safari are below. I will text on Edge, Android and IOS later, but I hope those are similar.
International Exception Stack Text:
Below is the value of
ex.stack
:Chrome:
English:
French:
Firefox:
English:
French:
Safari:
This answer describes Firefox behavior. It may or may not apply to browsers in general.
Errors in English, with help
Syntax errors were still reported on the console in English. However, a help link was added to console output:
[en savoir plus]
linking to a page on the French version of MDN explaining the error reported in English. Examplegenerated console output of
Note
The
en savoir plus
link contains URL parameters of unknown usage:While I suspect other major browsers probably do something similar, without testing additional browsers I can’t say for certain. If you already know they don’t, you could always suggest Firefox to your friend.