# Can ONE variable select how ANOTHER variable is used?

**URL:** <https://discourse.mozilla.org/t/can-one-variable-select-how-another-variable-is-used/75270>\
**Category:** Fluent\
**Tags:** learning\
**Created:** [February 9, 2021, 7:06pm UTC](https://discourse.mozilla.org/t/can-one-variable-select-how-another-variable-is-used/75270 "2021-02-09T19:06:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henr](https://avatars.discourse-cdn.com/v4/letter/h/8c91f0/32.png) [@henr](https://discourse.mozilla.org/u/henr)\
**Post date:** [February 9, 2021, 7:06pm UTC](https://discourse.mozilla.org/t/can-one-variable-select-how-another-variable-is-used/75270/1 "2021-02-09T19:06:10Z")

</div>

On [https://www.projectfluent.org/](https://www.projectfluent.org/) there is a good example of the FTL-file Fluent syntax:  
(I don’t know why some words are in bold below…)

```auto
tabs-close-tooltip = {$tabCount ->
    [one] Close {$tabCount} tab
   *[other] Close {$tabCount} tabs
}

```

But can ONE variable select how ANOTHER variable is used? Something like this:

```auto
about-the-S-value = {$IndexCount ->
    [zero] In this case S is larger than {$S-value}.
   *[other] In this case S is smaller than {$S-value}.
}

```

---

<div class="post-metadata">

**Author:** ![axel](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/axel/32/40432_2.png) [@axel](https://discourse.mozilla.org/u/axel)\
**Post date:** [February 10, 2021, 7:49am UTC](https://discourse.mozilla.org/t/can-one-variable-select-how-another-variable-is-used/75270/2 "2021-02-10T07:49:45Z")

</div>

Yes, you can reference any variable you want inside a pattern of a select expression.

Your example hints at something else, though, that you’re trying to put logic into a single message. Select expressions are designed to be independent in each localization. You shouldn’t assume that just because English uses one, all locallizations would do, too. A more detailed explanation is on [https://github.com/projectfluent/fluent/wiki/Good-Practices-for-Developers#prefer-separate-messages-over-variants-for-ui-logic](https://github.com/projectfluent/fluent/wiki/Good-Practices-for-Developers#prefer-separate-messages-over-variants-for-ui-logic).

---

<div class="post-metadata">

**Author:** ![henr](https://avatars.discourse-cdn.com/v4/letter/h/8c91f0/32.png) [@henr](https://discourse.mozilla.org/u/henr)\
**Post date:** [February 10, 2021, 9:51am UTC](https://discourse.mozilla.org/t/can-one-variable-select-how-another-variable-is-used/75270/3 "2021-02-10T09:51:54Z")

</div>

OK. I will follow the recommendation to have 2 messages instead and let Python choose between them.
