Code Monkey home page Code Monkey logo

Comments (2)

guilherme-gm avatar guilherme-gm commented on July 27, 2024 2

The reason those messages in the timer doesn't get translated is that they don't have an attached player to get the language from.

In this case, it uses the server default language (as defined in conf/map/map-server.conf - default_language) as a fallback. I believe in your case the server's default language is english, and that's why you saw it in english instead of spanish (spanish being the player-defined language only).

I am not sure if using the fallback when there are no players attached should be called a bug... because this comes with a limitation in HULD: messages that are sent to multiple players will be in a single language (probably for performance reasons).

In this case, if there are no player attached (like when this timer runs), which language should it pick? the server default one or ??, since any player could have triggered this (or no player at all) and several players will see it (in a single language). But there is also another side here: the announce in the main initial code, although being global, is being translated to the player's language (in this case showing in Spanish to everyone).

Edit: You can check this out by changing the default_language in your map-server.conf to Spanish. You will probably get those messages from the timer in Spanish. end of edit


From my point of view, going with the server defined language makes more sense, but it should also affect other global messages. But that's only my opinion.

There are some workarounds that could allow you to keep the player's language in the timer (and if 2 players trigger that at same time, we get the last one language): store the string in a npc variable before starting the timer, and use the variable in the timer instead of the string.

The same workaround would allow the first announce be in server language: store the string in a npc variable during OnInit and use it in player context (because it was translated at OnInit, it goes in the server language).

But in both cases, they are only workarounds.

from hercules.

Vaans avatar Vaans commented on July 27, 2024

Thank you for the clarification. Yes, i used the workaround that store the strings translated and put it in the timers labels.

Well, seems an issue with the operation instead of the system, gonna close this issue.

Thank you @guilherme-gm

from hercules.

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.