
The curious case of disappearing Polish S - radley
https://medium.com/medium-eng/the-curious-case-of-disappearing-polish-s-fa398313d4df
======
blahedo
I do not have sufficient profanity in my verbal arsenal for websites that
override basic, fundamental browser behaviour because they think they know
better than I do what I actually meant to do. I have noticed Medium being a
regular perpetrator of this sort of broken behaviour before.

That one of the developers at Medium could run into such a glowing example of
one of the many reasons it's nasty to override browser behaviour, and take the
lesson from it that oh hey, we just need to make our override logic _more
complicated_... the blindness and idiocy and sheer bloodymindedness of this
response I just can't even.

Medium: YOU'RE DOING IT WRONG.

~~~
cezarywojcik
While for the most part I agree with you, there are sometimes when it seems...
appropriate. Take, for example, Google Docs. I'm used to hitting CTRL-S when
working on just about any paper. If I had the save website dialog pop up every
time I hit CTRL-S, I would start to get annoyed. I'm glad that Google Docs
doesn't do that. A similar case can be made here.

~~~
yen223
I can count with an amputated hand the number of times I had to save a
website. Overriding the ctrl+S shortcut is the appropriate move here.

~~~
coldpie
I wonder if the shortcut should be removed. Certainly some people use the
feature, but it seems obscure enough that maybe we should pass that
combination on to the website, instead.

~~~
krzysz00
The feature is rather useful for record-keeping purposes (also known as CYA).

~~~
wlesieutre
Though you get an html file and a folder with all the external assets, which I
find to be pretty annoying. Safari did a single .webarchive file, but I don't
think anyone else ever standardized on something like that.

It often wrecks the layout, but I tend to print to PDF rather than deal with
saved html files.

~~~
cnvogel
Save-As writing bunch of resources, that when loaded back into the browser
might even be broken by lack of external resources are also, in my oppinion, a
bad way to keep evidence (e.g. CYA). If you need it to persuade a non-
computer-savvy person of something stated on a website, I'd say a bunch of
random files in a directory is also much less convincing than a "printed-to"
pdf, or screenshots you can easily mail around.

Regarding the .webarchive, I think IE supports another type of "web archive",
with a .mht ending.

------
kosma
I initially planned to put a TL;DR here, but it's the best bug analysis I've
seen in months - a pleasure to read! - so I'm leaving it for others to savour.

The very same bug used to be present in early Windows mobile GPU drivers -
with global hotkeys making it impossible to enter Ł (with Intel GMA 950) and Ć
(with ATI Catalyst). Being a Polish geek, I used to earn lots of free dinners
from frustrated friends who were forced to copy-paste those letters on their
brand new laptops. Funny how the same bug recurs in different types of
software due to an obscure locale-dependent edge case - and it's much less
known than, for example, the Turkish dotted/dotless I.

~~~
voltagex_
Did the drivers (or tray apps) bind those keys? What for?

~~~
M4v3R
Tray apps were binding those keys to open settings panels or tweaking driver
configuration on the fly.

------
seppo0010
I think the article is too verbose when knowing the context the bug is
trivial: you intercepted meta+s and ctrl+s and in the way you broke alt+s.

I find the save dialog useless for web browsers as well, but I think
preventing its use is a bad idea in general. Overriding the browser's shortcut
is uncomfortable. For example, wordpress likes to capture cmd+<number> to
change the font style, but that's how I usually change the active tab. It also
disables ctrl+tab, the other way I use to escape while the text area is
active.

People use their browsers and have their workflow in them. Breaking them needs
to have a really good excuse. [http://xkcd.com/1172/](http://xkcd.com/1172/)

~~~
derekp7
But the article explains why they override ctrl-s. It is because the users had
muscle memory to keep hitting ctrl-s to save, since they were used to not
having an auto-save function built in. But more than that, is the idea of a
web browser as an app delivery platform. If a web browser is running an app
(such as a word processor, or spreadsheet, or anything but browsing the web)
it is sometimes necessary and beneficial to turn over browser-reserved
keystrokes to the app in question. The only time to expect browser shortcut
keys to work normally is when browsing a web page (vs. using the browser to
run an application).

~~~
qewrffewqwfqew
.. another relevant xkcd: [https://xkcd.com/1479/](https://xkcd.com/1479/)

~~~
chinpokomon
Pfft. Or you could just press Alt-Space, M, and then the arrow keys to "bind"
the move to the mouse movement. This will let you bring the dialog back
onscreen.

On second thought, I'll be glad when I don't have to know that.

------
nathell
> _Our extra characters might look very much like Latin equivalents, and
> amount to only about 8% of letter distribution (you will hate them playing
> Scrabble)_

Polish competitive Scrabble player here. It's not so much hate as a love-hate
relationship. While it can be frustrating to be left with a vowelless rack
containing a Ź in the endgame, for the most part these letters are quite
desirable. Indeed, three of them (Ą, Ę, Ó) are vowels worth 5 points each, and
only two of them (Ć and Ź) don't appear in any two-letter word. Even the Ź is
fairly easy to get rid of, given an open enough (read: not completely blocked)
board. They're nowhere near as irritating as the Q (and to a lesser extent Z)
in English Scrabble.

------
Sami_Lehtinen
Noticed similar issues with official Australian VISA / immigration pages. You
can't simply fill some forms with your email address using Finnish keyboard.
Why? Because they block usage of AltGr button on their page. They also prevent
using clipboard blocking copy paste option for that sign. User has to be smart
enough to switch to US keyboard and then enter @ sign and then switch back. So
this is nothing new, but it's absolutely rude from part of the site designers
to vandalize basic functionality like that. Normally @ is produced by AltGr +
2. I guess they got BOFH department, let's make this really annoying and
prevent people from getting their business done, laugh.

------
V-2
"While France, Germany, and other countries got their early PC with customized
keyboards whose layouts mirrored closely the typewriters that came before…
[...] …in Poland, we had to find another way of inputting the extra 9
diacritics unique to our language."

Did we? I dare to say that your historical account is inaccurate. We stuck to
our traditional layout for a while. What does it matter if the keyboard wasn't
customized in physical sense anyway? You should be looking at the screen, not
at the keys. If I recall well, Polish typewriter layout (PN-87) was still
available on Windows 95/98\. The now prevalent >Alt + something< one was
called "programmer's layout", and the name itself indicates that it wasn't
originally thought of as everyman's layout.

Domestic software certainly used the typewriter layout - for instance
[http://pl.wikipedia.org/wiki/TAG_%28edytor_tekstu%29](http://pl.wikipedia.org/wiki/TAG_%28edytor_tekstu%29),
once a very popular word processor for PC, last version released in 1996.

The typewriter layout finally got extinct, but what spelled its ultimate
demise was the internet, I believe.

Early netiquette actually forbid using Polish diacritics, because of encoding
issues - in that era you could never be sure whether the other person would
read "gwóźdź" or "gw░¶d¶", so it was considered good practice to stick to
Latin characters only.

Meaning that users didn't get to feel the pain of having to press Alt +
whatever all the time, and so they got hooked on default QWERTY.

As the last of Mohicans, I use the typewriter layout to this very day (for
typing in Polish; I alternate), only I had to recreate it myself (using
Microsoft Keyboard Layout Editor)*

It allows for much faster typing in compare to these inconvenient right-Alt
shortcuts. Swapping Y with Z by itself is a win for a Polish speaker (writer),
given that Z is much more common in Polish. While its frequency is at mere
0.07% in English, it reaches 4.9% in Polish, placing it in the top 10. Thus
putting it under the weakest finger of all - your left pinky - isn't very
considerate.

\-------

* Funnily enough - I'm not flame baiting - when I decided to try Linux, hailed for its customizability, I found out that recreating my favorite layout wasn't as easy. I got lots of advice on various forums, but noone had a simple receipt for me. Admittedly this was few years back.

~~~
mootothemax
_It allows for much faster typing in compare to these inconvenient right-Alt
shortcuts._

This is really interesting.

As a late-comer to Polish (native British), I've only learned on the right-Alt
layout, and the typewriter layout initially gave me The Fear just looking at
it.

Then I tried to see how quickly I could type Łódź, and yeah, I think you might
be right about the pain - the typewriter layout looks like it should work much
better.

For what it's worth, I'm an unconventional - yet effective - touch-typer, and
use my left ring-finger for both the Z and X keys. Typing my ZŻŹs isn't too
painful.

~~~
V-2
I rarely get to come across non-native speakers, good luck : ) Well, note that
repositioning "Z" is not just about the pinky. "Z" is present in common Polish
digraphs: "cz", "sz", "rz", all of which are easier to type if "Z" is moved to
where "Y" normally is.

Type "Szczecin" (my home city) 10 times, and then "Sycyecin" \- that's the
feeling you'd get on PN-87 :)

Obviously QWERTY isn't a very good keyboard layout to start with. Putting all
the letters of the word TYPEWRITER in the top row (to make it easier for the
first salesmen to demonstrate the product) wasn't done with everyday user's
convenience in mind, English or otherwise.

Hence all these alternatives, such as the most popular Dvorak layout (but also
Colemak and plenty others). Which are, however, optimized for English, so a
Polish typist wouldn't probably benefit from switching all that much.

------
hawat
1) There is something called "polish typewriter keyboard", now is more like a
unicorn than computer part but... I really had one in 1995. 2) in `80 Poland
produce some computers "on it`s own", like elwro:
[http://upload.wikimedia.org/wikipedia/commons/6/65/Elwro_800...](http://upload.wikimedia.org/wikipedia/commons/6/65/Elwro_800_Junior_jednostka_centralna.jpg)
And they had polish typewriter keyboard... 3) And, there was a polish made
clone of IBM PC:
[http://pl.wikipedia.org/wiki/Mazovia_%28komputer%29#mediavie...](http://pl.wikipedia.org/wiki/Mazovia_%28komputer%29#mediaviewer/File:Mazovia_1016_PC.jpg)
and, yes - it has a polish typewriter keyboard...

~~~
haddr
With one exception: "polish typewriter keyboard" is QWERTZ.

------
qewrffewqwfqew
Yet another example of why websites shouldn't be able to hijack keys that have
meaning outside them (in the browser itself, or in the desktop environment).
It still blows my mind that browsers permit this and don't provide an easy
option to stop such abusive (and dangerous!) behaviour.

The workaround is typical of web stuff as well: deal with the symptoms one by
one while leaving the underlying problem unquestioned.

~~~
chinpokomon
I feel like that's an old way of thinking. If websites are too grow up and
become first class applications, and advancements in Chrome and Firefox are
paving that way, we want the browser to become a very thin runtime that
doesn't impose any behaviors of its own. It should be mostly transparent to
the user that they are in a browser. The fact that different browsers use
different shortcuts makes that all the more important, that browser shortcuts
need to be invoked in other ways that won't conflict.

~~~
dredmorbius
Split the web. If you want an applications platform with HTTP transport, build
one. If you want a documents platform, build that as well.

Split out commerce and media while you're at it.

The present model's working _increasingly poorly_ for me.

------
dredmorbius
Or, as I found on a BBC news page earlier today (and reported via feedback),
my middle mouse button on link to open in new tab wasn't -- the page was
opening in the _present_ tab.

 _Don 't break user controls._

Seriously. Fucking. Annoying.

The tendency of sites to also force _all links_ to open in a _new_ tab is
similarly annoying. I've got the means to choose. Leave it to me.

Another argument for disabling JS pretty much everywhere.

~~~
qball12
yeees.... now-a-days very often without JS you pretty much get an empty HTML.
I mean empty as in - <body></body> empty.

~~~
mootothemax
_very often without JS you pretty much get an empty HTML_

The annoying thing is: if there were a header the browser could send to the
server - "JS is turned off" \- it'd be trivial to serve a pre-rendered full
HTML response.

It's what plenty of e.g. Angular sites do to support the various search
engines. Adding one more item to the list of "serve a prenderefndered view if
X is true" checks wouldn't do any harm.

------
Spoom
What an interesting article. I don't think many people outside of our field
realize how obscure some bugs can be, and the lengths needed to diagnose them.
Not every bug, of course; not even 95% of bugs. But every now and again, you
get something that really tries your problem solving skills... and inevitably
it ends up being something small like not checking the state of every meta
key.

------
ojanik
This is how you type euro sign € on a lot of keyboard layouts, no communism
needed.

Looking at your code, you're also blocking Win+S on Windows and Ctrl+S on Mac
for no good reason.

Extrapolating from your experience: What about shift key?

When you decide to block default behaviour, do your research, not everyone is
on a Mac with American layout.

------
59nadir
The much bigger problem is that browsers out there are crap and won't let you
re-map your keys as you want them.

How is it that we're well into the 2010's and I still can't get (my own) emacs
keybindings in Firefox/Chrome without some silly extension that doesn't work
100%?

I can download uzbl, dwb or any other browser like it and edit my keys as I
see fit, for emacs/vim keybinding behavior, without limits.

I don't know about Medium, but I also find that most websites have these
hidden shortcuts and you can't even re-map those. Why is there no choice in
all this? Browser developers and websites can spend hundreds of thousands of
dollars on UX/UI research, but can't figure out that I might want to re-map
some keybindings.

------
viraptor
> To find room for the extra letters, typewriters needed to dispense with some
> punctuation, most notably semicolons (comma + backspace + colon), and
> parentheses (replaced in common use by slashes).

I've seen the slashes-as-parentheses on many (mostly older) documents before,
but never knew why. Suddenly this makes so much sense. Unfortunately what
makes less sense is official translators still using // for () these days.

------
odiroot
Oh nice, an article about my native language on HN's front page.

Currently living in Germany I actually find our approach to special characters
really elegant. I was surprised how much different are German (and French)
keyboards.

I wonder whether these different layouts can affect for example your
programming prowess.

~~~
kosma
It definitely affects the learning curve. Have a look at the Czech keyboard
layout; when I first started learning that language I ended up using the
Compose key. Why on Earth would you put diacritics on _numerical_ keys without
any kind of logical mapping? At least Polish is 100% logical in this regard
(except AltGr-X, but that was unavoidable).

The Russian keyboard layout is similarly annoying as the keys are simply _not
where you expect them_. On most systems you can install a phonetic keyboard
driver and kinda roll with it - that is, until you have to use a _real_
Russian keyboard, at which point you have to re-learn from scratch.

Oh, and don't get me started on AZERTY and QWERTZ. What were they thinking?!

The point is that on some layouts you can start typing right away; on other,
you have to jump through hoops and get frustrated. Not that we can do anything
about it now. Historical reasons.

------
zokier
While most commentary is (fairly) focused on browser behavior and keyboard
hijacking, I'd point out another viewpoint: why the frak does every latin
alphabet using nation need its own keyboard layout? Couple of diacritics is
hardly a good reason to reshuffle the whole keyboard.

~~~
jdmichal
Because typewriters, and therefore keyboard layouts, predate computers.
There's no technical reason to not just have composable meta-keys, excepting
maybe the pure number of existent diacritics [0].

In fact, on the German keyboard, the circumflex (ˆ), acute accent (´), and
grave accent (`) keys all compose with the next entered character. (That is, á
is entered by pressing ´, then pressing a.)

Windows also offers an "international" keyboard mode which allows composition
in a way similar to the German keyboard. [1]

[0]
[http://en.wikipedia.org/wiki/Diacritic](http://en.wikipedia.org/wiki/Diacritic)

[1]
[http://support.microsoft.com/kb/306560](http://support.microsoft.com/kb/306560)

~~~
zokier
> Because typewriters, and therefore keyboard layouts, predate computers

Even early US computers (and typewriters before them) had relatively varied
keyboard layouts, but somehow[1] they still managed to converge into the
standard 104 key layout that we have today in the early 90s (and that is a
quarter of century ago). What we have missed is the extension of that
convergence into international community.

> There's no technical reason to not just have composable meta-keys, excepting
> maybe the pure number of existent diacritics [0].

> In fact, on the German keyboard, the circumflex (ˆ), acute accent (´), and
> grave accent (`) keys all compose with the next entered character. (That is,
> á is entered by pressing ´, then pressing a.)

Dead keys are fairly good solution. Indeed I counted 19 dead-key diacritics on
my countrys official standard keyboard (which almost nobody uses).

[1] IBM PC/Wintel monopoly probably helped

------
cysun
I use regularly English, German and Romanian. I find it easier to learn using
the two extra standard layouts (not the programmer version) and change between
them by ALT-SHIFT than pressing ALT-X for every diacritic. The WPM count falls
drastically using the ALT key all the time.

~~~
jarek
This is true for English and German but in the Polish layout the characters
are only accessible with right Alt

------
CalRobert
Reading this reminded me of how incredibly annoying it is that new OS'es don't
always underline the shortcut key. It's maddening! I can't seem to get it to
work in Unity; auto-mnemonic true or false makes no difference.

------
frik
German keyboard has the AltGr key too, it like pressing Ctrl + Alt, though
there is no special character mapped on the "s" key.

------
DogeDogeDoge
We Polish people have a hard language :(

~~~
jccalhoun
I've been friends with a couple from Poland for over a decade and I still
can't say their names the "real" way.

~~~
mootothemax
_I 've been friends with a couple from Poland for over a decade and I still
can't say their names the "real" way._

Honestly, Polish pronunciation isn't that tricky, trilled Rs aside.

What're their names? Wikipedia has a great guide:

[http://en.wikibooks.org/wiki/Polish/Polish_pronunciation](http://en.wikibooks.org/wiki/Polish/Polish_pronunciation)

------
w__m
still, how about choosing font that does support latin-ext characters properly
for medium.com/polish ?

just saying.

------
rvennar
Ok, but Polish is a dying language, so I don't think it matters that much.

------
moron4hire
I first learned about this issue while working on Primrose.

Things get really hairy in the browser when you start talking about
JavaScript, the keyboard, and international support.

For example, there is no way to know what keyboard layout a user is using.
With Primrose, I guess based on the user's default language, but even that
isn't perfect as a lot of not-US English speakers just show up as "en", with
no further locale description, so I also provide a select list with all of the
available choices.

It's very difficult to know with certainty what _character_ a user is
intending to type. KeyCode 51 with no modifier keys is "3" on most keyboards,
except French, where it is "#" (they essentially swap the casing of the number
row).

The number pad numbers send different keycodes than the number row numbers,
but the number pad arrows (if you turn off the numlock) send the same keycodes
as the arrow keys.

In languages with deadkey support for diacritics (such as French and German),
the deadkey keyCode isn't sent until the second key is typed. Then, they are
sent in rapid succession.

There is absolutely no way to know what is going on with IMEs.

And there is no reliable way to interact with the soft keyboard on mobile
devices. Some versions of soft keyboards don't send the arrow key keyCodes.
There is no standardization of what keys should be available, so you can't
guarantee that your user will easily be able to type your shortcuts (I know of
only one keyboard on Android that even has CTRL or ALT). And it's nearly
impossible to know how much space the soft keyboard is going to take up on the
screen (you can figure it out on Android, eventually. It's impossible on
iOS.).

So, you have one of two choices, if you're trying to implement any sort of
browser-based application that involves heavy use of the keyboard.

Option 1: You can either create a hidden, surrogate text area in which the
user actually types, unbeknownst to them, and run a sync process between the
content they type and the content you display. This has several problems: you
have to wait for keyUp to activate shortcut commands. The sync process can be
costly (especially in the context for which Primrose exists: WebVR) and it is
difficult to keep the cursor view in sync when dealing with mouse/touch
interactions. Oh, speaking of pointer actions, you have to make sure your
surrogate text area is positioned exactly under the displayed text field, with
the text appearing the same apparent size as the displayed text, because when
it gains focus the browser will scroll the view to it.

But it will work, except for certain use cases. It won't work well on mobile,
and it won't play nicely with WebVR (which is the entire point of Primrose,
anyway), especially for Asian users using an IME.

So Option 1 isn't a good option.

Option 2: completely reimplement the key input stack, i.e. create all the
keyboards and soft keyboards and IMEs your users will ever need. Completely
ignore what the OS and the browser tell you, take only the raw keyCodes, and
reconstruct what is happening. It's a lot of work, a lot to debug, but at
least there is a path to actually solve every problem.

------
guard-of-terra
I would theorize that second used slavic language is not Ukrainian but Serbo-
Croatian, at risk of getting hated by everybody mentioned.

It also has a rare property of coming with two alphabets - cyrillic and latin.

~~~
perokreco
Poland has more than double the number of people than Serbia + Croatia +
Bosnia + Montenegro.

~~~
guard-of-terra
You're certainly right, third then.

~~~
dimitar
Fourth. While Ukraine is a bilingual country, it still much bigger than former
Yugoslavia. Most people there consider it their native language and a majority
know it. So if you are strongly biased for a small number you'll get 30
million speakers, if you are biased for a big number it might be 50 million.

And on top of that you must use the same criterion for the S-C language, not
counting Slovenians, Albanians, Macedonians, etc who know the language but
don't use it much anymore.

