GithubHelp home page GithubHelp logo

Comments (9)

Schnoop avatar Schnoop commented on June 26, 2024 1

It only differs in what is stored in the database. Serialized Object or array.

from ultimatewarfare.

Schnoop avatar Schnoop commented on June 26, 2024

@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.

Schnoop avatar Schnoop commented on June 26, 2024

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.

frank9999 avatar frank9999 commented on June 26, 2024

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.

frank9999 avatar frank9999 commented on June 26, 2024

Ah yes! So your last solution sounds perfect and is most future proof

from ultimatewarfare.

Schnoop avatar Schnoop commented on June 26, 2024

How do we deals with existing data that are created atm?

from ultimatewarfare.

frank9999 avatar frank9999 commented on June 26, 2024

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.

Schnoop avatar Schnoop commented on June 26, 2024

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.

frank9999 avatar frank9999 commented on June 26, 2024

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)

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.