Game Release: “Nectar Thief A” Arabic Translation

إقرأ هذه المقالة بالعربية

Nectar Thief is a short text-based game made by Loren Schmidt. It’s intended to be a narrative prototype for her upcoming gardening game, “Nectar Thief.”

I’m very honored that I got to translate it to Arabic because I was genuinely a fan of this game before I was contacted by the author! I knew it would be challenging to localize because the whole game is presented in English text, and I don’t know any other Arabic text-based games for reference.

You can play the Arabic translation here:
https://alexclay.itch.io/nectar-thief-cycle-a-ar

And you can play the original in English here:
https://lorenschmidt.itch.io/nectar-thief-cycle-a

I used Courier as a typeface because it’s monospaced (each character has a fixed width). I believe this makes the typing animation (displaying each character one by one) more comfortable.

Technical Info on the Arabic Localization

Loren had already created a powerful localization script that could grab translated strings from a spreadsheet and switch per-language settings for formatting, making CSS changes, etc. Still, there was some features missing for Arabic so I did some work to get the game presenting perfectly:

1- Displaying the text from right-to-left. Done mostly by setting this tag and fixing anything that breaks:

<html lang="ar" dir="rtl">

2- Transliterating the numbers from Western Arabic numerals (standard in English) to Eastern Arabic numerals (standard in Arabic).
Done by converting the displayed number to a string then replacing the numeral glyphs. You can check out this tiny project that I made Arabic Numberizer which implements the following function:

// Alex Clay. English-to-Arabic number transliterating

// glyphs representing Arabic numerals
var arabicNumbersMap =
[
"&\#1632;","&\#1633;","&\#1634;","&\#1635;","&\#1636;",
"&\#1637;","&\#1638;","&\#1639;","&\#1640;","&\#1641;"
];
function getArabicNumbers(enNum)
{
	var newStr = "";
	
	enNum = String(enNum);
	
        // concat plus/minus sign
	if (enNum[0] == "-" || enNum[0] == "+"){
		newStr += enNum[0];
	}

    for (i = 0; i < enNum.length; i +=1) {

     // parseInt("1") returns 1.
     // This means it will return arabicNumbersMap[1]

     if (arabicNumbersMap[parseInt(enNum.charAt(i))] != undefined) {
			newStr += arabicNumbersMap[parseInt(enNum.charAt(i))];
		}
	}

	return newStr;
}

3- Adding Arabic keyboard charCodes for input.
English digits have char codes from 48 to 57 (you can check here) but on an Arabic keyboard, the codes go from 1777 to 1785. Similar case for letters.

A duct-tape fix was a matter of adding extra checks for all the variant keyboard charCodes. I think this is acceptable for a free web prototype.

Char codes behave slightly different based on the browser and OS so I made sure the keys work on every mainstream browser, on Windows and Linux, in English and Arabic.