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

Semantic Comments Proposal: Variables #140

Open
zbraniecki opened this Issue Jun 1, 2018 · 0 comments

Comments

Projects
1 participant
@zbraniecki
Contributor

zbraniecki commented Jun 1, 2018

This is part of the series of proposals spanning out of the meta #16.

Variables

One of the core elements of the Fluent ecosystem is a model of passing a set of variables from the developer to localizer enabling the localizer to augument their translation.

Establishing a semantic way of describing the variables available to the localizer would help localization tools, checks and localizers themselves better understand the context in which they operate.

It would be especially beneficial for Rich Editor in Pontoon to provide better UX when operating on variables, and for checks to be able to raise warnings on misuse of the variables.

Variables can be considered part of #139, but they're such a core feature that I'd like to discuss them separately for two reasons:

First, being the most common and omnipresent example of a semantic information they should drive the whole conversation and we should design the meta-information model specifically taking into account this use case over others.

Secondly, because they're so dominant, we may want to consider separating them out of meta information and providing further syntax sugar to make them easier to work with.

So, as part of meta-information they could be represented as:

#   @param $value (Number) - Value of the unit (for example: 4.6, 500)
#   @param $unit (String) - Name of the unit (for example: "bytes", "KB")
sitedata-total-size = Your stored cookies, site data and cache are currently using { $value } { $unit } of disk space.

but since we know that $ sygil denotes a variable, we may want to provide additional syntax sugar to reduce the visual clutter:

#   $value (Number) - Value of the unit (for example: 4.6, 500)
#   $unit (String) - Name of the unit (for example: "bytes", "KB")
sitedata-total-size = Your stored cookies, site data and cache are currently using { $value } { $unit } of disk space.

It then could be visually represented in Pontoon as:

and linters would be able to determine use and misuse of variables and warn about unused variables if needed.

@stasm stasm added this to To do in Syntax 0.8 via automation Jun 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment