GithubHelp home page GithubHelp logo

Comments (3)

cllns avatar cllns commented on May 30, 2024 1

Sorry you're having trouble!

I don't think we expect the keys to be displayed to the user. Notice the message is just "must be an adult", which is a message about the person, not the age specifically. "must be 18 or older" would be the message for the age. Does that make sense?

You could work around this by not showing they key, and putting that translation into the value.

en:
  errors:
    email?: "must be an email"

    rules:
      signup:
        age: 
          gt?: # japanese for "age must be 18 or older"

If you do want to show the key, I think you can look at leveraging the i18n gem for translating that.

jp:
  age: 年齢

(I don't know if this translation is correct, it was Google Translate's first result :) )

from validations.

projecthl2 avatar projecthl2 commented on May 30, 2024

Thanks for your answer! I was misunderstanding about it.

gt?: # japanese for "age must be 18 or older"

This is what I was looking for.
I should have tried it first in my code, sorry.

Thank you for your kindness! I'll close my issue.

from validations.

cllns avatar cllns commented on May 30, 2024

No worries, glad you figured it out! 🌸

from validations.

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.