# vue: Handling plurals and branches URL: https://generaltranslation.com/en-US/docs/vue/guides/handling-plurals-and-branches.mdx --- title: Handling plurals and branches description: How to translate count-based and conditional Vue content with and . related: links: - /docs/vue/guides/formatting-variables - /docs/vue/guides/translating-content - /docs/vue/guides/translating-strings - /docs/vue/guides/managing-locales --- Different locales can require different plural forms and different wording around a condition. Represent every finite alternative in named slots so the CLI can extract each complete phrase. Use [``](/docs/vue/reference/components/plural) when a number selects the wording. Use [``](/docs/vue/reference/components/branch) for statuses, plans, booleans, and other named values. ## Choose plurals or branches [#choose] - Use [``](/docs/vue/reference/components/plural) when a count determines the phrase. - Use [``](/docs/vue/reference/components/branch) when another value determines the phrase. - Place either component inside [``](/docs/vue/reference/components/t) so every named slot belongs to the translated entry. - Use the default slot as a fallback for an unrecognized category or branch. - Wrap runtime values inside each phrase with [``](/docs/vue/reference/components/num), [``](/docs/vue/reference/components/var), or another formatting component. ## Pluralize with `` [#plural] Pass the count through `:n` and provide named slots for the categories used by the source locale: ```vue ``` [``](/docs/vue/reference/components/plural) combines numeric overrides for absolute values `0`, `1`, and `2` with the active locale's [Unicode CLDR plural rules](https://cldr.unicode.org/index/cldr-spec/plural-rules). English commonly uses `one` and `other`; target translations can contain additional categories such as `zero`, `two`, `few`, and `many`. Do not model plural grammar with `count === 1` or by appending a suffix. Those shortcuts encode the source language's rules rather than the active locale's rules. ## Branch on a named value [#branch] Pass a string, number, or boolean through `:branch`, then use a statically named slot for each expected value: ```vue ``` Every slot is included in the surrounding [``](/docs/vue/reference/components/t) entry, while only the active branch renders. If no named slot matches, [``](/docs/vue/reference/components/branch) renders the default slot. ## Replace inline conditionals [#conditionals] An inline `v-if` changes the translated structure at runtime. Move finite alternatives into [``](/docs/vue/reference/components/branch) instead: ```vue Active Inactive ``` Slot names must be static and unconditional. When the set of alternatives is not finite at build time, keep that runtime content outside [``](/docs/vue/reference/components/t) or preserve it as an opaque [``](/docs/vue/reference/components/var). ## Next steps - /docs/vue/guides/formatting-variables - /docs/vue/guides/translating-content - /docs/vue/guides/translating-strings - /docs/vue/guides/managing-locales