In a multilingual glossary, every language has its own terms: a Spanish term is a translation of the English one, with its own page and address. This page explains how to give each language its own glossary page and its own term lists, with Signocore Multilanguage or another translation plugin.
One glossary page per language
The Glossary Page setting holds one page, and the glossary is only added to that page automatically. Translated versions of the page need the shortcode.
- Choose the glossary page in your default language under Glossary Page in Glossary → Settings, and save.
- Translate the page with your translation plugin.
- Add the
[wpsgls-glossary]shortcode to every language version of the page, including the default one, so the glossary sits in the same place in each language.
Note: With Signocore Multilanguage, automatic links skip the page chosen as Glossary Page and its translations. With other translation plugins, only the chosen page is skipped: if Pages is selected under Content Types in the Glossary Links card, tick Turn off glossary links and tooltips in this content in the Glossary Links box of each translated glossary page.
Term addresses start with the slug of the glossary page, such as /glossary/, in every language. To give the base a translated slug per language, such as /glosario/ for Spanish, translate the Terms base in Signocore Multilanguage Pro. See Language URLs.
What works with Signocore Multilanguage
Glossary terms are a public post type, so Signocore Multilanguage offers them for translation under Translatable Post Types, where they are called Terms. With Terms selected there:
- Each translated term has its own term page in its language.
- The plugin keeps a separate stored copy of the glossary, the term count, the Recent Glossary Terms widget and the list used for automatic links for each site language, so the languages never show each other's cached lists.
- With Signocore SEO, the breadcrumb trail of a term page leads to the glossary page's translation in the visitor's language, when that translation is published.
- Related terms and related questions are matched through tags. When the terms in each language carry tags in that language, each language lists its own terms.
What needs a snippet
The glossary list, the term count, the Recent Glossary Terms widget and the automatic links look up terms with their own queries. Signocore Multilanguage filters the main content of a page by language, but not these extra queries, so without a snippet they show terms from every language.
The wpsgls_terms_query_args filter lets a developer restrict them. This snippet, placed in your theme's functions.php or a must-use plugin, limits all four lists to the current language:
add_filter('wpsgls_terms_query_args', function (array $args, string $context): array { // Only list terms in the language the visitor is viewing. if (function_exists('signocore_ml_get_current_language')) { $args['sml_filter_language'] = true; } return $args; }, 10, 2);
sml_filter_language is the same query argument Signocore Multilanguage's signocore_ml_get_posts() function adds to filter a query by the current language. After you add the snippet, go to Glossary → Settings and click Save Changes once, so the stored lists are rebuilt with it.
Important: Only use the snippet while Terms is selected under Translatable Post Types in Signocore Multilanguage. Terms without a language are treated as default language content: they show in the default language and are left out of every other language.
For the four lists the filter covers and its other uses, see For developers.
Other translation plugins
The glossary lists are built with get_posts() and keep WordPress query filters switched on. A translation plugin that filters every query by language applies to them without any setup. If yours only filters the main query, use the wpsgls_terms_query_args filter above with the language argument your plugin documents for extra queries.
The tips for the glossary page apply to every translation plugin: one page per language with the [wpsgls-glossary] shortcode, and automatic links turned off on the translated glossary pages, which Signocore Multilanguage does for you.
Letters in the A-Z index
The letter bar always shows # and the alphabet of the language:
- Danish and Norwegian pages show A to Z followed by Æ, Ø and Å, with Ä filed under Æ and Ö under Ø.
- Swedish and Finnish pages show A to Z followed by Å, Ä and Ö, with Æ filed under Ä and Ø under Ö.
- Spanish pages show Ñ right after N, so "Ñandú" gets an Ñ key.
- Every other letter with an accent or mark is filed under its base letter, so "Éxito" appears under E and "Über" under U.
The index follows the language of the page, so the Spanish glossary page sorts its letters the Spanish way while the English one keeps the English order.