Giter Club home page Giter Club logo

Comments (11)

zbraniecki avatar zbraniecki commented on May 13, 2024 1

I'm totally fine with having this be a linter check.

from fluent.

Pike avatar Pike commented on May 13, 2024

One thing we're doing with tags is that we're taking them out of the data space that can be exposed publicly. You can't return the żeński to the calling program.

So I disagree that this is just a tooling feature.

from fluent.

stasm avatar stasm commented on May 13, 2024

Do we really need to enforce this level of protection in the runtime? I could see a linter rule which warns against interpolating attribute expressions on private messages (foo = { -brand-name.gender }), but even then I think it should not be an error.

from fluent.

Pike avatar Pike commented on May 13, 2024

I strongly think that exposing language-internal traits is an error. We've had people try to abuse language-internal traits over and over, and I also think that making it clear on the syntax level that that's not OK is a win.

Sorry for using traits, but we're not using that word right now, so I use it to mean tags/attributes/something.

from fluent.

zbraniecki avatar zbraniecki commented on May 13, 2024

One cannot retrieve a private message from MessageContext, so the only way to someone could attempt to retrieve an attribute on a private message is via interpolation.

If that's the case, we could address Pike's concern by simply forbidding AttributeExpressions on private messages outside of SelectExpressions selector.

from fluent.

stasm avatar stasm commented on May 13, 2024

I disagree on "simply" :) There is a lot of conditions in forbid AttributeExpressions on private messages outside of SelectExpressions selector which makes this rule hard to internalize. I'd prefer to move this check into a linter.

The syntax should help localizers create good localizations without imposing too many strict rules. At any point a localizer can create a bad translation: they can write About { -brand-name.gender } just as they can write About Totally Not Brand Name. Not everything that parses must make immediate sense.

from fluent.

Pike avatar Pike commented on May 13, 2024

Do we really need to enforce this level of protection in the runtime?

Yes, we need to handle this at runtime. If it's legal syntax, people can and likely will put it in files, and we need to have defined runtime behavior.

Linters are things that we run optionally. Hopefully people run it, but we can't enforce that they do in any way.

from fluent.

stasm avatar stasm commented on May 13, 2024

Before we discuss the implementation in #69, I'd like to get sign-offs on this proposal from the majority of the core team. Please comment in this thread and tick the box next to your name if you give this proposal a green light.

from fluent.

stasm avatar stasm commented on May 13, 2024

r+

from fluent.

zbraniecki avatar zbraniecki commented on May 13, 2024

r+

from fluent.

Pike avatar Pike commented on May 13, 2024

We talked about this on the tech call yesterday, and zibi and I share the concern about runtime leakage, though we have different severities for it.

As we've seen folks try to do interesting stuff with hashes in l20n files, we'll want a runtime catch for this.

from fluent.

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.