Code Monkey home page Code Monkey logo

Comments (6)

shawncplus avatar shawncplus commented on June 20, 2024 1

It's not expected that you display the raw value from that property to the user, those exit names are keys. As Brian suggested building a translation map would be the correct approach. That's how most localization libraries work: you have a localization key, combine with the user's locale ,and that maps to a given output. The CommandParser is an example implementation in a bundle, if your players are inputting text in Spanish you would likewise have to customize mainly the checkMovement method of the example CommandParser to map their input in reverse.

As far as a PR for the core I'm not entirely sure what's being suggested is a good idea. The suggestion of being able to configure the exit names is, in essence, a half-measure approach to core localization. But the core doesn't have any output, there's nothing to localize (those exit names aren't output, they're keys. The code itself is in English, those keys are also in English as they are code, not output.) All of the localization can happen at the bundle layer as outlined above.

from ranviermud.

nelsonsbrian avatar nelsonsbrian commented on June 20, 2024

Hello,
Leaving aside the localization (I dont have knowledge in that area), you can pretty easily redo how movement names are done. All you have to do is change the directions in here. That is just in an example bundle that you're free to change as your see fit your muds needs. Anything in the example bundles are just that, examples.

from ranviermud.

francipvb avatar francipvb commented on June 20, 2024

from ranviermud.

francipvb avatar francipvb commented on June 20, 2024

Hello,
Leaving aside the localization (I dont have knowledge in that area), you can pretty easily redo how movement names are done. All you have to do is change the directions in here. That is just in an example bundle that you're free to change as your see fit your muds needs. Anything in the example bundles are just that, examples.

Hello,

As noted above, the problem are the inferred exits, not the added ones.

Cheers,

from ranviermud.

nelsonsbrian avatar nelsonsbrian commented on June 20, 2024

Ahh, didn't know you were using the inferred.

Of the top of my head looks like you have a few options,

  1. Don't use coords so that the exits will stay how you define them to be, so you can use a spanish set of directions in the exit.
  2. Overwrite the getExits() method on Room to use your new directions.
  3. Modify the core code itself to include your new directions. Can even submit a PR with changes and others can refer to that change if they want to implement a similar thing.
  4. Keep the current mapping of rooms and wherever there is player interaction with the english names, map to spanish.

All of those should work above, with varying degrees of complexity.

I do agree with you, would be nice to be able define your own exits in a config and still be able to use the coords/inferred.

from ranviermud.

francipvb avatar francipvb commented on June 20, 2024

Ahh, didn't know you were using the inferred.

Of the top of my head looks like you have a few options,

  1. Don't use coords so that the exits will stay how you define them to be, so you can use a spanish set of directions in the exit.
  2. Overwrite the getExits() method on Room to use your new directions.

Is it possible to do this?

I were thinking about loading an exit config from the game state and use it from there instead of the hardcoded map.

  1. Modify the core code itself to include your new directions. Can even submit a PR with changes and others can refer to that change if they want to implement a similar thing.
  2. Keep the current mapping of rooms and wherever there is player interaction with the english names, map to spanish.

All of those should work above, with varying degrees of complexity.

I do agree with you, would be nice to be able define your own exits in a config and still be able to use the coords/inferred.

Not sure if the game state can be accessed from the room class, but this would be a nice idea.

Is the code still maintained? If so, I can craft a little PR to do this.

from ranviermud.

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.