Comments (9)
It only differs in what is stored in the database. Serialized Object or array.
from ultimatewarfare.
@frank9999 i'm hunting down this translation stuff at the moment. Do you think we have to translate the battle reports as well? Those reports are stored in the database and we have to create an entry for each language this game is supporting.
The trade off is of course that if you add a new language after some time, older reports are not available in the new added language.
The other option would be to store the reports as serialized Translateable Objects which will be translated while rendering the page.
Any suggestions?
from ultimatewarfare.
The last option that comes to my mind right now is to store the translation identifier in one field, and the values that should get replaced in the another field as a serialized array. This solution will be fully backwards compatible as the only connection to the real text is the identifier which will be used in every language file that is available.
from ultimatewarfare.
Hi @Schnoop, how do option 2 and 3 differ? I prefer to store the customizable/data in an serialized array or json in the database, and do the actual battle report generation during rendering with for example twig templates and translation files.
This has 3 benefits:
- Keeps data stored in database limited, as we no longer store full reports, only necessary data to generate reports.
- Allows us to change the battle report later, also for old battle reports.
- We can add new languages later, and allow players to change language at runtime and see reports in their preferred language.
from ultimatewarfare.
Ah yes! So your last solution sounds perfect and is most future proof
from ultimatewarfare.
How do we deals with existing data that are created atm?
from ultimatewarfare.
We can truncate the old battle reports. I'll deploy these changes while creating new game worlds. Current world is ending some time soon
from ultimatewarfare.
I have done a lot of stuff - although it is not finished yet. You can have a look at the feature branch here:
https://github.com/Schnoop/UltimateWarfare/tree/feature/Translation
from ultimatewarfare.
Hi @Schnoop, thats a lot of changes! Would be great if you can make smaller merge requests in the future, makes it easier to go through the changes hehe.
I'm not really sure about the datamodel changes. What is the reason you split the datamodel into translation-entity models? Wouldn't it be easier to just use translation files for that as well? So just lookup and translate "Soldier" in language files like you do with all other changes? With the current proposed changes you will have to do translations in language files AND in the database.
from ultimatewarfare.
Related Issues (20)
- Feature Request: ChatServer: Disable chat input for guests HOT 1
- Improvement: Service file for ChatServer HOT 1
- Improvement: Upgrade symfony 5.2 => 5.3 HOT 1
- Improvement: Fix deprecation warning Symfony 5.3 HOT 1
- Improvement: Bump phpstan level to 6 HOT 2
- Improvement: Bump phpstan level to 7 HOT 1
- Improvement: Bump phpstan level to 8 HOT 1
- Idea: Ultimate-Warfare 2.0 HOT 2
- Input validation bug: Must be of type string, null given HOT 4
- Disabled forum internal server error HOT 1
- Deprecation warning: Using XML mapping driver with XSD validation disabled is deprecated HOT 2
- Feature Request: Tutorial for new players HOT 2
- Deprecation warning: Short namespace aliases such as "Game:Construction" are deprecated HOT 1
- Store sessions in database instead of files
- Create game world not working
- Admin: Creating new game world doesn't generate map tiles HOT 1
- Unknown server error when session expired HOT 1
- Sector region coordinates and buy link hard to read on certain backgrounds
- Update github action dependencies to latest version HOT 1
- Improvement: Bump phpstan level 8 => 9
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 ultimatewarfare.