Comments (9)
Storing the text and fetching it isn't the hard part; the hard part is making it load the right text bundle for the locale, and having it fallback when necessary.
Advantages:
- simpler format, no quotes, easy to edit
- automatically format strings you pass in with specific arguments
- automatically load the right bundle for the locale of the user
- automatically fall back to the right bundles when the optimal one is not found
- works across all platforms, including HTML5 (a lot of standard Java stuff doesn't work there, so that's a big deal)
- probably faster to load and use than JSON, as the format is much simpler
If I use JSON, I'll have to re-implement all of these features, probably for each platform, too. The formats aren't too different; can't you do something like remove all quotes and replace :
with =
, using the appropriate tools in your editor?
from mindustry.
...can't we just use JSON? What are the advantages or benefits in using I18Bundle instead of JSON? I've already gone through about half of the total game text and put it in JSON, and was thinking we'd be able to import the JSON as an object in the files that the game has text in, and then reference them wherever it is needed.
from mindustry.
Ah, gotcha. I'll work on porting all the gametext i stored onto the JSON into I18Bundle. Starting pull request when done.
Also, one thing: on Desktop (atleast as far as i know), the text in the main menu are sprites, so we should probably make new sprites for them corresponding to the languages we translate the game into...
from mindustry.
I just want to note that there is likely an automatic JSON to l18Bundle converter out there somewhere that you could use.
from mindustry.
...I wish I had known that... earlier... 😒
(jk thx epower, ill try it out and see what i can find)
from mindustry.
If you give me the files, I can probably write a script that can convert them very quickly. The l18Bundle format is very simple.
from mindustry.
I want translate Korean in this game.
from mindustry.
@Cloud9350 It might be best if you join the Discord server for this, as it's easier to ask questions there, and I have the instructions and files already posted.
from mindustry.
Hey guys, I see the app on the play store doesn't have a full French translation. I have made one myself. Should I add a fr-FR
folder in fastlane/metadata/android/
mimicking the russian folder?
from mindustry.
Related Issues (20)
- yes another one...... some units not visually drown correctly
- Container Payloads only pick up less than 10 items
- Logic @speed inaccurate HOT 1
- Logic @rotation inaccurate HOT 1
- ItemTurrets can't shoot HOT 1
- Continuation with save for 9739 HOT 2
- Control keybind issue HOT 1
- Youtube + mindustry = pain HOT 2
- Bitwise operation error HOT 1
- Lose connection after the screen is turned off HOT 6
- Blend filter and Path to Spawn filter don't have an icon
- Crash when attempting to change rules in a map HOT 3
- OutOfMemory error HOT 6
- L-alt Bug HOT 2
- Thorium in Erekir before you actually unlock it HOT 1
- Mindustry crash when i go online HOT 2
- Bug HOT 8
- servers and modifications are not working HOT 2
- A problem cause shield takes no time to cool down HOT 3
- Weird distortion/scaling with non-standard screen resolution HOT 2
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 mindustry.