Giter Club home page Giter Club logo

Comments (7)

remance avatar remance commented on May 21, 2024

Any reason for why naming the folder "strings"? Wouldn't it make more sense to just simply name it localisation?

from masendor.

RybenHill avatar RybenHill commented on May 21, 2024

well, I made that path suggestion inspired by how M&B manages thousands of translatable in-game text strings, with a smart way that allows new translations to be added and is open for mod creation.

It might be worth having a look at...
https://mbmodwiki.github.io/String

Also, we could take into account this library...

https://github.com/MyreMylar/pygame_gui

https://github.com/MyreMylar/pygame_gui_examples

https://pygame-gui.readthedocs.io/en/v_067/

that might be useful for saving a lot of effort when implementing a GUI system for a Pygame project; it already includes its own
localization support via python-i18n:

https://pygame-gui.readthedocs.io/en/latest/localization.html

https://github.com/danhper/python-i18n

https://pypi.org/project/python-i18n/

--

from masendor.

remance avatar remance commented on May 21, 2024

Ok, now I understand. But for this game I think it would be better to use localisation as folder name to make it more clear. Can you send an example of string file from mount and blade game? Would be useful to see how they structure the file.

from masendor.

RybenHill avatar RybenHill commented on May 21, 2024

In Mount and Blade, each game module (include the vanilla module or base game, what we are calling historial atm in our project) contains its own translation files:

module_dialogs.py, module_scripts.py, module_troops.py, module_infopages.py, etc.

Here you can read more about how its made in M&B:

For us, if we are using PygameGUI / python-i18n, the format expected would be something like...

{
  "en": {
    "text_id_whatever": "Hello world! :D"
  }
}

As you can see and test yourself from the PygameGUI examples repo:

https://github.com/MyreMylar/pygame_gui_examples/blob/master/translations_test.py

translations_test.py PygameGUI translation system example

from masendor.

remance avatar remance commented on May 21, 2024

So I remember I tried making localisation for UI before. I put the old file in dev branch:

It is not used in game yet but we can use it as a starting point.

https://github.com/remance/Masendor/tree/dev/data/module/historical/localisation

from masendor.

remance avatar remance commented on May 21, 2024

So the game now put localisation data separate from other data. They are kept in "localsiation" folder. The localisation files are in the same or similar name as the data. For example troop_status in localsation is for troop_status data. The data is in csv format to make it consistent with other data.

from masendor.

remance avatar remance commented on May 21, 2024

Forgot to mention that this change is in dev branch for now.

from masendor.

Related Issues (20)

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.