Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow select-expression with an empty selector #5

Closed
stasm opened this issue Jan 4, 2017 · 2 comments
Closed

Allow select-expression with an empty selector #5

stasm opened this issue Jan 4, 2017 · 2 comments
Milestone

Comments

@stasm
Copy link
Contributor

stasm commented Jan 4, 2017

Goal

Define variants of a message which can be accessed from other strings.

Description

We currently define variants of the message which are local and specific to the natural language using traits. For instance, we'd write:

brand-name =
   *[nominative] Firefox
    [genitive]    Firefox's

This is a bit weird because in the above example, "Firefox" is the real value of the message and nominative and genitive are the value's facets. However the value field of the message remains empty due to the fact that the facets are defined as traits. These traits also need to remain private which in turn necessitates a way to mark public traits as public; we currently use namespaces for this purpose.

The proposed change is to allow defining facets of a value as variants of a select-expression which doesn't have a selector:

brand-name = {
   *[nominative] Firefox
    [genitive]    Firefox's
}

This would also allow to remove namespaces from member keys (keywords). The member-expression would change the meaning: it would now be used to access a named variant of the first placeable in the value of the message. If that placeable isn't a select-expression or already has a selector, normal evaluation would follow.

about1 = About { brand-name }
about2 = About { brand-name[nominative] }

Dependencies

#1.

Discussion

https://groups.google.com/forum/#!topic/mozilla.tools.l10n/dhWfBXHzuZI

@stasm stasm changed the title Allow SelectExpression with an empty selector Allow select-expression with an empty selector Jan 4, 2017
@stasm stasm modified the milestone: 0.2 Jan 19, 2017
@Pike
Copy link
Contributor

Pike commented Jan 19, 2017

I'm looking at this from the POV of a developer writing an ftl file in an editor, and from that view, it just looks as if we added two characters that I can get wrong.

I'd love to look at this proposal once we know what ot do with #6 and #7, and look at the impact then.

@stasm
Copy link
Contributor Author

stasm commented Jan 23, 2017

@Pike, I'd argue that from the POV of a developer this change is about putting the value into the value field instead of abusing traits. And with #6 it should be clear that attributes are just that: attributes.

@stasm stasm closed this as completed in a183bef Jan 30, 2017
stasm added a commit that referenced this issue Jan 30, 2017
Fix #5. Allow select-expression with an empty selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants