Giter Club home page Giter Club logo

Comments (3)

thekip avatar thekip commented on May 23, 2024

Yup.string().matches(/^([0-9]{16})$/, t'${tFirst name}' must be ${16} characters.),

is it a real example? Still don't understand the need for using t in t.

This i suppose known issue, the macro treat {t`First name`} as a variable and keep it intact, so t is not transpiled.

May I ask what you expect to get in extracted messages in this case?

from js-lingui.

Kepro avatar Kepro commented on May 23, 2024

Hey, yeah, it is a real example... just migrating our legacy translation system to Lingui
old message format was UPPER_CASE and the second parameter was values e.g.

const FORM_MAX_CHARACTERS = "[FIELD] must be [NUM] characters";
t("FORM_MAX_CHARACTERS", { FIELD: t("FIRST_NAME"), NUM: 16 }

in the whole application, we are using Macro t and Trans and hash-generated IDs

I know I can use i18n._ but then I need to provide id which we don't want...

May I ask what you expect to get in extracted messages in this case?

basically {0} must be {1} characters

but if it is a limitation of babel-macro and there is nothing to do, then we can close it

from js-lingui.

thekip avatar thekip commented on May 23, 2024

Yeah, you probably can solve this differently in your code. This is not a limitation of babel-macro itself, rather how lingui macro is written, and i don't really want to touch it since it may break something else.

from js-lingui.

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.