JSFiddle - React, Tailwind, and code Playground
by Piotr G
HTML
<textarea style="width: 100%; height: 100px">"{F1}{0F}""The Shogi Hour""{NL}
Today let's look at a game{NL}
played between a 100-dan rank{NL}
player (the first player) and{NL}
101-dan rank player{NL}
(the second player){NL}
First...1 4 Pawn{NL}
Second...1 6 Pawn{NL}
First...2 4 Pawn{NL}
Second...2 6 Pawn{NL}
First... 3 4 Pawn{NL}
Second...3 6 Pawn{NL}
First...4 4 Pawn{NL}
Second...4 6 Pawn{NL}
First...5 4 Pawn{NL}
We'll end here today and{NL}
continue with the game next{NL}
time.{END}"</textarea>
<input type="button" onclick="format()" value="Shogi!">
<div style="font-family: monospace;">xxx</div>
JavaScript
function format() {
var text = $('textarea').val();
text = text.replace(/{NL}/g, '{NL}<br>');
text = text.replace(/"The Shogi Hour"/g, '"Godzina z Shogi"');
text = text.replace(/Today let's look at a game/g, 'Dziś popatrzmy na grę');
text = text.replace(/Today we continue with a game/g, 'Dziś popatrzmy na grę');
text = text.replace(/played between a 100-dan rank/g, 'rozgrywaną pomiędzy grazczem na pozycji');
text = text.replace(/played between a 100-dan/g, 'rozgrywaną pomiędzy grazczem na pozycji');
text = text.replace(/rank player \(the first player\)/g, '100 w rankingu (pierwszy) a graczem');
text = text.replace(/player \(the first player\) and/g, '100 w rankingu (pierwszy) a graczem');
text = text.replace(/player \(the first player\)/g, '100 w rankingu (pierwszy) a graczem');
text = text.replace(/101-dan rank player/g, 'który jest 101 w rankingu');
text = text.replace(/\(the second player\)/g, '(drugi)');
text = text.replace(/and który/g, 'który');
text = text.replace(/First/g, 'Pierwszy');
text = text.replace(/Second/g, 'Drugi...');
text = text.replace(/The same/g, 'tak samo');
text = text.replace(/Pawn/g, 'pionkiem');
text = text.replace(/Rook/g, 'wieżą');
text = text.replace(/Promoted Bishop/g, 'Wysokim Kapłanem');
text = text.replace(/Bishop/g, 'Kapłanem');
text = text.replace(/Silver General/g, 'Srebrnym Generałem');
text = text.replace(/Promoted Lance/g, 'Wysoką Lancą');
text = text.replace(/Lance/g, 'Lancą');
text = text.replace(/Promoted Knight/g, 'Wysokim Rycerzem');
text = text.replace(/Knight/g, 'Rycerzem');
text = text.replace(/We'll end here today and/g, 'Skończymy tutaj i będziemy');
text = text.replace(/continue with the game next/g, 'kontynuować następną turę');
text = text.replace(/continue with the game/g, 'kontynuować następną turę');
text = text.replace(/time\./g, 'następnym razem.');
text = text.replace(/next następnym/g, 'następnym');
text =...