Locale filtering
Numerous e-commerce applications function in various regions and rely on localized data. While product labels and descriptions are clear examples, there are also several numeric values that must be specific to each locale due to the distinction between the metric system and imperial units. That's why evitaDB offers first-class support for localization in its data structures and query language.
Entity locale equals
- argument:string!
- a mandatory specification of the locale to which all localized attributes targeted by the query must conform; examples of a valid language tags are: en-US or en-GB, cs or cs-CZ, de or de-AT, de-CH, fr or fr-CA etc.
The language tag, also known as the locale or language identifier, is a standardized format used to represent a specific language or locale in computer systems and software. It provides a way to identify and differentiate languages, dialects, and regional variations.
-
Primary Language Subtag: In the example above, en represents the primary language subtag, which indicates English as the primary language.
-
Region Subtag: The region subtag is optional and represents a specific region or country associated with the language. In the example, US represents the United States.
Language tags can also include additional subtags to specify variations such as script, variant, and extensions, allowing for more granular language identification.
While it's technically possible to implement support for these tasks in evitaDB, they represent edge cases, and there were more important scenarios to handle.
... and we will get a list with the number of them.
List of all products with English localization in category
But when we request products in Czech locale:
... the query returns none of them, even though we know there are products in this category.