Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
135 stars 2 forks source link

Asset Localization System #763

Open Psychpsyo opened 10 months ago

Psychpsyo commented 10 months ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when trying to localize text or images on my own creations.

This comes down to multiple reasons:

  1. There is no elegant way of providing fallbacks for unlocalized strings/assets in certain languages.
  2. Decoupling the creation's language setting from the user's Resonite language setting requires some override that falls back to the Resonite one if not set. This needs to either be duplicated across all items belonging to the system or be handled in some global manager item.
  3. There is no convenient way to store the localization data in one place, apart from a bunch of multiplexers.
  4. There needs to either be a dedicated item to change the creation's language or that option needs to be included in involved items.
  5. Updating localized content is hard when users are expected to save parts of it. (Cloud variables really aren't made for this)

Describe the solution you'd like

An inbuilt localization system that lets us define strings and assets with their localized versions and fallbacks. These should be able to be referenced in created items somehow, probably similar to how Resonite does it for it's own locale. (Not sure what to do about assets like images)

Things this should support:

  1. Setting a language for the creation that's different from your Resonite language.
  2. Setting a default language other than English for strings to fall back to.
  3. Localizing images, audio, videos, meshes and text.
  4. Updating the localization without having to update the item it is applied to would be really nice.
  5. Support languages that aren't supported by Resonite itself.
  6. Language-specific text formatting for things like plurals, possessives and other language features.

Describe alternatives you've considered

  1. Different copies of the localized asset in the content. (ugly, in some cases impossible due to space constraints)
  2. An in-world language toggle that updates a bunch of drivers. (Doesn't work when the content may be used outside of the world, needs to be re-applied every time)
  3. Cloud variables to store both the language selection and the localized asset URLs. (my current solution but cloud variables are not made for this and run into issues constantly)
  4. Hosting the localized assets externally. (Localization can't be updated since Resonite caches external images forever.)
  5. Different versions of the content for different languages (Massive pain to update, does not work when users with different language settings are using it together)

Additional Context

The above requirements are motivated by three different use-cases:

  1. A static item that can support different languages. Users should be able to set this to a different language than Resonite itself because the item might originally have been made in a language other than English and a person who speaks both might want to set their Resonite to English but the item to its original language. Images and meshes might need to be localized in cases where they are used for stylized text or if there is other regional differences to account for.

  2. A world that hands out localized souvenirs. Example: 'Robot Safari' lets you save pictures with a score printed on them to your inventory. That printed score is an image and should be localizable. I should also be able to add new languages or update existing ones without having to edit everyone's saved pictures.

  3. Systems that come in many pieces which can be spawned in any world. Example: Cross Universe (card game) lets players build decks from a large number of individual cards. They save those decks to their own inventory and spawn them in other worlds to play. This means there is a large amount of different objects that all need to adhere to the same language whithout ever coming as a single package. This is where it would be nice to have the language setting available in a predictable place, ideally together with the regular Resonite language settings.

Banane9 commented 10 months ago

Potentially related to #728, for some kind of dynamic localization source scheme 🤔