I’m really not sure where the best place to post this is but as I’m trying to test how text looks in the Japanese localization of my game. The thing is… I’m not sure how to do that on either the simulator or device? I don’t see anywhere in the system settings to change the device’s language.
So, that begs the question… how do I actually test what my game looks like in Japanese?
Hey! While the SDK supports string lookup for English and Japanese, I don’t believe the Playdate OS has support for multiple languages yet. You’ll need to implement a language selector yourself in your game, then display strings in the relevant language based on that.
… this makes a lot more sense. Welp! I wasn’t planning on actually formally supporting Japanese until post-launch, so adding a UI flow for it will just be part of that process, haha. Thanks!
Hello, I made a localization system inspired by godot’s own translation system (which is an engine that I have known deep enough to see the benefits of that approach), it is interesting to see that people have also wanted something of the sorts…
I am very proud of what I did, but the code is a bit coupled with my game. I was planning on releasing some of the tooling I made (including some converters from and to pdi as command line tools) and that was one of it… I even made it in a way that I can translate it using yaml files, then I convert through a parser to lua as a key-value pair.
The api is very basic, it is basically one function:
---If exists, returns a translated string to the active language,
---but if this string is the same as the key or does not exist, give the main language string version of it
---@param translationId string
---@return string
function translationManager:tr(translationId)
local returnedString = "oh no! no language available!"
if Globals.databases and Globals.databases.translations and Globals.databases.translations[self.activeLanguage] then
returnedString = Globals.databases.translations[self.activeLanguage][translationId]
if returnedString == translationId then
returnedString = Globals.databases.translations[self.defaultLanguage][translationId] or translationId
end
end
return returnedString
end
Then anywhere in my code I just do: gfx.drawTextAligned(tr("created_by"), text_x_position, text_y_position, kTextAlignment.center)
And I have: