Localization files for unsupported languages

Hello ! I'm currently developing a game for my Playdate, and most of the people that know my work today are french. I'm french myself, so I would like to have a french translation for my game.

At this time, Playdate only supports English and Japanese localization through en.strings and jp.strings files, because those are the only two languages that are available on the system.
Some games like Playnote Studio have implemented their own translations mechanisms, not using the internal translation system at all.

So, for my own game, I've created an en.strings file, but I've also made a fr.strings file even if there isn't any way to use it easily at this time. I don't want to manage my own translation system at this time, but I wanted to know if it would be possible to use the internal translation system to switch languages for each game, even for languages which aren't currently supported by Playdate ?

For example, we could imagine that a game starts with the system language by default (English here for the example). You could have a language selector in the game directly (or through checkmark items in the system menu if there's only one other language available, or if there's not too many items already used). When you select another language (French here for the example), the game switches from en.strings to fr.strings and will use this file to translate all strings from now on (maybe we can use the datastore to keep the change between game launches).

The major problem could be that some accented characters / alphabets couldn't be supported by the system fonts, and there may be problems when rendering them. I don't know how it could be solved easily. Maybe by limiting the supported languages to the ones using a latin alphabet at first, but the accented characters must be implemented through the system fonts to avoid problems.

First, it's worth noting that the fully localized OS isn't quite ready yet, so even if you implement the strings files, you'll have to manage your own language switcher for now, local to the game.

I did do basic some testing of this in the past and it's easy enough to set up a translation system to switch Fonts and strings, for nonEN/JP strings. And, the EN/JP strings files do work properly (make sure you use double quotes in those strings files, I had some weird issues otherwise!)

Maybe you tried it already, but I don't see any way to hijack the SDKs custom strings file for additional languages, like "fr.strings" or something. The best you could do is store the key/value in a lua table somewhere for now, until further language support arrives.

I'd picture that as something like any time you're using drawLocalizedText(), to first check your game's global language setting and if it is not English or Japanese, use instead a drawText with a manual lookup/search to that French (or whatever current language) strings table. There may be a simpler way, but in general it will require managing it yourself for now.

Worth noting, there's an "options" menu type :addOptionsMenuItem() that allows you to have a multi-select option, so you could have as many languages as you like :slight_smile:

Thanks for the answer ! I've missed the thread about the localized OS and the :addOptionsMenuItem() function.

My idea was more or less to make the "strings file hijacking" official if the targeted language wasn't ready to be officially shipped. But seeing the answer on the other thread, it seems that this kind of functionality has already been discussed and won't be done.

My game will not be ready before some weeks, so if the localized OS isn't ready for its release, I will maybe make a custom language switcher if I have time.

1 Like