Skip to content

Commit

Permalink
[Logs UI] Correct logs anomalies i18n expression (#185660)
Browse files Browse the repository at this point in the history
## πŸ““ Summary

Closes #184663 

The expression used to display selection modes/plurals was the
following:
```
{includeType, select, 
    includeAll {All datasets} 
    includeSome {{includedDatasetCount, plural, 
        one {# dataset} 
        other {# datasets}
    }}
}
```

Per [formatting
specification](https://formatjs.io/docs/core-concepts/icu-syntax/#select-format),
`select` expressions require a `other` and will throw an error if
`select` is used without `other` (`MISSING_OTHER_CLAUSE` error).

Adding the `other` clause to the expression as follows should fix it:
```
{includeType, select, 
    includeAll {All datasets} 
    includeSome {{includedDatasetCount, plural, 
        one {# dataset} 
        other {# datasets}
    }}
    other {No dataset available}
}
```


https://github.com/elastic/kibana/assets/34506779/248c4549-b828-4e83-a947-6374f5f27ddf

Co-authored-by: Marco Antonio Ghiani <[email protected]>
  • Loading branch information
tonyghiani and Marco Antonio Ghiani authored Jun 13, 2024
1 parent c2a82fe commit a38852d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const IndexSetupDatasetFilter: React.FC<{
>
<FormattedMessage
id="xpack.infra.analysisSetup.indexDatasetFilterIncludeAllButtonLabel"
defaultMessage="{includeType, select, includeAll {All datasets} other {{includedDatasetCount, plural, one {# dataset} other {# datasets}}}}"
defaultMessage="{includeType, select, includeAll {All datasets} includeSome {{includedDatasetCount, plural, one {# dataset} other {# datasets}}} other {No dataset available}}"
values={{
includeType: datasetFilter.type,
includedDatasetCount:
Expand Down

0 comments on commit a38852d

Please sign in to comment.