Giter Club home page Giter Club logo

destsolpseudolocalisationexample's Introduction

Destination Sol pseudo-localisation example

See here for an explanation of what pseudo-localisation actually is. An image of the game's main menu, containing pseudo-localised text, such as "Ṕḽααẏ Ḡααṃḛḛ".

This is a quick sample to demonstrate how you can replace strings in the game's assets for a limited form of translation. Some strings are still hard-coded in the game's source code and cannot be altered in this way.

Proper support for translations in the engine may happen in the future but this works as a temporary work-around for now. It also serves as an example of an innovative way in which the Gestalt asset system can be used.

You may have to change Java's default file locale to view the characters properly. You can do this by adding -Dfile.encoding=UTF-8 to the JVM start-up options.

Structure

Deltas (Overview)

The deltas folder contains partial alterations of certain game files. Only the changed portions of the file are present.

As an example, the original file may look like the following:

{
  "myShip": "core:smallShip",
  "hireCost": 400,
  "displayName": "Small Ship"
}

If you only want to change the displayName value, then you would include only the changed value in the delta file. Such as this:

{
  "displayName": "Small Ship with Changed Text"
}

Deltas (Schemas)

The files in the deltas/engine/schemas folder alter the validation logic used by the engine to check JSON files before loading them. We need to do this because the current logic only permits ASCII-range characters in some places, rather than the full UTF-8 range.

Overrides (Overview)

The overrides folder contains files that completely replace the original file content. Due to limitations in the deltas algorithm currently, it is not possible to apply a delta to a value within an array. You have to replace the entire file instead, using a copy of the original.

Example of a scenario that requires an override:

{
  "type": "RelativeLayout",
  // This is the array here.
  "contents": [
    {
      "type": "UILabel",
      // The text here is within an array, so we can't apply a delta to it.
      "text": "Some Text"
    }
  ]
}

Overrides (Schemas)

There is one schema containing a value in an array, so it needed to be overridden entirely.

Overrides (Fonts)

The default Jet-Set font provided with the game only contains a subset of ASCII characters. In order to use characters in the wider UTF-8 range, I've had to replace the game's font with a different one (found in overrides/engine/fonts/main.font).

You can generate the files needed for your own font using the libGDX Hiero tool. The following settings should work:

Font Size: 36
Padding: 0, 0, 0, 0
X Spacing: 1
Y Spacing: 1

The font files use a .font extension, instead of the tool's default .fnt extension. The output .font file should be called main.font, so that it has the same asset name as the font being overridden.

References

Attribution

destsolpseudolocalisationexample's People

Contributors

benjaminamos avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.