afs:lang - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

Role

Sets the language filter. It supports a language code (complying to ISO 639-1 code) and optionally a region code (complying to ISO 3166-1).

When using both lang and region codes, they have to be written together. AFS also supports usual syntaxes splitting codes using "-" or "_":

afs:lang=isoCode is a shortcut for adding the filter afs:lang="isoCode" to the query. It will be rewritten into afs:filter=afs:lang="isoCode".

For more information, see List of ISO 639-1 Codes and List of ISO 3166-1 Codes.

Status

Optional. When unset, all localized items are returned.

Example

afs:lang=fr

afs:lang=frFR

afs:lang=en-US

afs:lang=de_DE

The value of this parameter will drive the behavior of localized search queries elements, such as empty words, operators...
See Search Queries Localization for more information.

Behavior example when using afs:lang parameter.

Suppose a facet for which the following localized labels are defined:

  • fr: Voiture
  • fr-CA: Char
  • fr-BE: Chariotte
  • "default": Car

Here are the results for each of the following queries:

  • query:
    • lang=fr-FR
  • reply:
    • fr > Voiture

  • query:
    • lang=fr-CA
  • reply:
    • fr-CA > Char

  • query:
    • lang=fr-BE
  • reply:
    • fr-BE > Chariotte

  • query:
    • lang=fr
  • reply:
    • fr > Voiture
    • fr-CA > Char
    • fr-BE > Chariotte

  • query:
    • lang=en
  • reply:
    • "default" > Car

  • query:
    • without language or with all pseudo language
  • reply:
    • fr > Voiture
    • fr-CA > Char
    • fr-BE > Chariotte
    • "default" > Car