-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localization #35
Localization #35
Conversation
This reverts commit 4edb1c8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start!
For identifying languages, we should adopt the ISO language/region standards, e.g. "en-US" for US English. They're widely standardized for localization and clearly disambiguate dialectic differences (e.g. "en-US" vs. "en-GB" for US vs. British English, respectively). Apple has a good reference doc with examples and links to the actual ISO standards docs.
I'm not sure we should pack all languages into the same output file. It means the more languages a game is localized into, the more data the end user has to download which they'll never actually use (i.e. all the languages except theirs). It may be better to output separate builds for each language, and have the language selection be something that's handled on the author's website, or through a store backend, or however they've chosen to distribute their story. I'd imagine outputting to locale subfolders, so you'd get e.g. build/en-US/index.html
and build/pt-BR/index.html
and so on. I'd also output the JS and assets to each locale folder so we don't have to do any path fixup between languages, and so each locale folder functions as a completely standalone build.
Which raises the question: how does localization for JS even work? It's likely text will be embedded in JS in some cases, since the whole point of function and variable macros is to return dynamic text. It's not clear how much of the responsibility for that lies with Fractive and how much lies with the author. I lean towards most of it being with the author just because those use cases are going to be varied and unpredictable, but this is worth considering.
There's a related question for localizing assets. I expect this will be rare in Fractive since it's primarily text-based, but if images/audio/video are included which need to be localized, there'd need to be a path for that as well. I'd think they can be handled the same as Markdown though, where they just live in locale-specific source folders.
Thinking about this some more today, splitting the languages out into separate files like I previously suggested may actually be premature. I doubt we'll see a lot of games getting localized into a lot of languages any time soon; the most common use case will no doubt be single-language. And in that use case, I'd like to preserve the ability for the entire game to be deployed as a single HTML file, not a loader and then a language file. Long-term, I could see adding a The one other wrinkle I'd add to this is that if a story is built with just one language, we should skip the language select entirely. It's pointless to show it if there's no choice the user can actually make. |
All of the above being the case, I might actually add that it makes more sense to let the user handle ISO standards if they want to. Players won't know what the ISO codes mean so we'd have to have both ISO code and human readable language name defined for each language anyway. The ISO standards aren't necessarily useful that I can think of unless we use the split directory structure. |
Addresses issue #14
Changes proposed by this pull request:
@invicticide to review