This seems to be a quirk of BibTeX's name formatting routine. Q35 in btxFAQ seems to be extremely related.
When babalpha formats names it inserts the customisable macro \btxfnamespacelong between first name elements. This happens with the following invocation
s nameptr "{ff{\btxfnamespacelong } }{vv~}" format.name$
Apparently, BibTeX not only splits names separated with a space such as Rolph Johan, but also names connected with a hyphen such as Ralph-Johan for the purposes of inserting content between first name elements and even discards the hyphen, so you end up with Ralph\btxfnamespacelong Johan.
A cheap workaround would be something like
\newcommand*{\myhyphen}{-}
and then
author = {Ralph\myhyphen{}Johan Back},
For BibTeX Ralph\myhyphen{}Johan is a unit that won't be split into two first names Ralph and Johan, so you end up with the expected output.
Another work-around that keeps the .bib content sane would be to simply tell the .bst style not to bother with \btxfnamespacelong. Since \btxfnamespacelong is a normal space in all default settings of babelbib anyway you don't stand to lose a lot from removing this bit of the definition.
Search for {ff{\btxfnamespacelong } } in the .bst and replace it with {ff } (there should be two hits).
If you want to keep \btxfnamespacelong, extra work is needed. Essentially we need to manually do for {ff } what {ff{\btxfnamespacelong } } does automatically.
The code to do that is stolen from biblatex.bst. We format with {ff} and later manually replace and ~ with \btxfnamespacelong. In theory that could cause issues with spaces that are not a brace level 0, but I guess one can live with that.
The diff to babalpha-fl-gs-sort.bst is
--- babalpha-fl-gs-sort.bst 2019-03-28 09:19:33.293644400 +0100
+++ babalpha-fl-gs-sort-dash.bst 2019-03-28 09:25:55.925628100 +0100
@@ -1,3 +1,12 @@
+%%%%%%%% `babalpha-fl-gs-sort-dash.bst'
+%%%%%%%% even more tweaks for `babalpha-fl-gs-sort.bst'
+%%%%%%%% for https://tex.stackexchange.com/q/481557/35864
+%%%%%%%% this time we need to emulate {ff{\btxfnamespacelong } }
+%%%%%%%% most code stolen from biblatex.bst
+%%%%%%%% 2019-03-28 MW
+%%%%%%%%
+%%%%%%%% header of older versions follow
+%%%%%%%%
%%%%%% `babalpha-fl-gs-sort.bst'
%%%%%% babalpha-fl-gs with tweaked sorting
%%%%%% for https://tex.stackexchange.com/q/472951/35864
@@ -76,6 +85,7 @@
after.sentence
after.block
before.title
+ resvctra
}
STRINGS
@@ -84,6 +94,7 @@
language.state
change.temp
isbn.command
+ resvstrga resvstrgb resvstrgc
}
FUNCTION {init.state.consts}
@@ -382,6 +393,35 @@
INTEGERS { nameptr namesleft numnames }
+% from biblatex.bst
+FUNCTION {str:length} {
+ #1 'resvctra :=
+ { duplicate$ duplicate$ #1 resvctra substring$ = not }
+ { resvctra #1 + 'resvctra := }
+ while$
+ pop$
+ resvctra
+}
+
+FUNCTION {str:replace} {
+ 'resvstrga :=
+ 'resvstrgb :=
+ 'resvstrgc :=
+ resvstrgb str:length 'resvctra :=
+ ""
+ { resvstrgc empty$ not }
+ { resvstrgc #1 resvctra substring$ resvstrgb =
+ { resvstrga *
+ resvstrgc #1 resvctra + global.max$ substring$ 'resvstrgc :=
+ }
+ { resvstrgc #1 #1 substring$ *
+ resvstrgc #2 global.max$ substring$ 'resvstrgc :=
+ }
+ if$
+ }
+ while$
+}
+
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
@@ -390,7 +430,11 @@
{ namesleft #0 > }
{ nameptr #1 >
{
- s nameptr "{ff{\btxfnamespacelong } }{vv~}" format.name$
+ s nameptr "{ff}" format.name$
+ " " "\btxfnamespacelong " str:replace
+ "~" "\btxfnamespacelong " str:replace
+ duplicate$ empty$ 'skip$ { " " * } if$
+ s nameptr "{vv~}" format.name$ *
s nameptr "{ll}" format.name$ lastnamefont *
s nameptr "{, jj}" format.name$ *
't :=
@@ -408,7 +452,11 @@
if$
}
{
- s nameptr "{ff{\btxfnamespacelong } }{vv~}" format.name$
+ s nameptr "{ff}" format.name$
+ " " "\btxfnamespacelong " str:replace
+ "~" "\btxfnamespacelong " str:replace
+ duplicate$ empty$ 'skip$ { " " * } if$
+ s nameptr "{vv~}" format.name$ *
s nameptr "{ll}" format.name$ lastnamefont *
s nameptr "{,~jj}" format.name$ * namefont
}
The changed file babalpha-fl-gs-sort-dash.bst can be downloaded at https://gist.github.com/moewew/db4ea9fd7a76b74ed3a12ec0802c49c0
\documentclass{article}
\usepackage[british,swedish,ngerman]{babel}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@phdthesis{Back-OnTheCorrectnessOfRefinementStepsInProgramDevelopment,
author = {Ralph-Johan Back and Ralph Johan Bock},
title = {On the correctness of refinement steps in program development},
school = {\foreignlanguage{swedish}{Åbo Akademi}, Department of Computer Science},
year = 1978,
address = {Helsinki, Finland},
note = {Report A--1978--4},
language = {british},
}
\end{filecontents}
\usepackage{babelbib}
\begin{document}
\cite{Back-OnTheCorrectnessOfRefinementStepsInProgramDevelopment}
\bibliographystyle{babalpha-fl-gs-sort-dash}
\bibliography{\jobname}
\end{document}
