-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations: Replace texts in code with translated messages #81
Comments
@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? |
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. |
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:
|
It only differs in what is stored in the database. Serialized Object or array. |
Ah yes! So your last solution sounds perfect and is most future proof |
How do we deals with existing data that are created atm? |
We can truncate the old battle reports. I'll deploy these changes while creating new game worlds. Current world is ending some time soon |
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 |
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. |
Some (error) messages in the codebase are now hardcoded to an english message instead of making use of the translation service, but there is a translation possibility available
The text was updated successfully, but these errors were encountered: