Comments (7)
Any reason for why naming the folder "strings"? Wouldn't it make more sense to just simply name it localisation?
from masendor.
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.
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.
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
from masendor.
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.
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.
Forgot to mention that this change is in dev branch for now.
from masendor.
Related Issues (20)
- error HOT 2
- rotationxy() takes 3 positional arguments but 4 were given HOT 2
- Game not working in the current commit.
- ico san HOT 1
- playing through the browser HOT 4
- Directory pathing for other OS HOT 1
- Issue HOT 8
- issue #2 HOT 4
- issue #3 HOT 4
- Map editor issue HOT 2
- Mechanic Improvement HOT 2
- eRROR HOT 74
- Issue that I'm pretty sure is ok HOT 37
- Question? HOT 12
- error HOT 102
- 'Unsupported operand type(s)' Error HOT 2
- Change the term map "source" to something more specific HOT 1
- Map editor HOT 4
- Add default module system
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from masendor.