Coder Social home page Coder Social logo

Comments (2)

lcreid avatar lcreid commented on July 17, 2024 1

Thanks for your interest in using bootstrap_form!

I haven't done a lot of work with bootstrap_form and internationalization. What I remember is that internationalization is hard.

What's mentioned here is basicallly that, if you don't need to specify your own label text, then bootstrap_form will act just like regular Rails forms, as covered in the Rails guides. If I recall correctly, even that can be a bit tricky. Rails doesn't come out of the box with translations, so you need to find a gem (rails-i18n) that provides translations for the standard Rails error messages.

If you want to provide your own translated labels, then you need to use the label option, but providing a string from Rails' translations, typically by saying something like: label: I18n.t("key.to.translation") in the parameters of the bootstrap_form method you're calling. That means you've set up the locale files with translations, and that you have the right language selected.

You could take a look at the views in this gem for some ideas. The same gem has a Spanish test app that might help.

Let me know if this helps, or if you have other questions.

from bootstrap_form.

hww avatar hww commented on July 17, 2024

You are right, everything works as you said. To translate the lablel and help -- I use this text

ru:
  activerecord:
    attributes:
      user:
        email: "Адрес электронной почты"
    help:
      user:
        email: "Должен использоваться уникальный электронный адрес"

from bootstrap_form.

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.