wp-graphql-polylang icon indicating copy to clipboard operation
wp-graphql-polylang copied to clipboard

When using language codes/slugs like 'nl-nl' the graphql return an enum error

Open mauritsweebers opened this issue 2 years ago • 2 comments

Some websites need a double language code/slug. nl-nl nl-en be-nl be-fr be-en

The graphql does not open when a language is configured this way. it gives this php error en remains loading endlesly

Names must only contain [_a-zA-Z0-9] but "NL-NL" does not.

easy replicable by simply changing the code name of a language

It looks like a minor validation issue, but i can't trace it in the php

mauritsweebers avatar Aug 17 '22 10:08 mauritsweebers

Seems this resolves the issue

$language_codes[str_replace('-', '_', strtoupper($lang))] = $lang; but it hasn't been implemented

https://github.com/philJohnson/wp-graphql-polylang/blob/hotfix/LanguageCodes/src/PolylangTypes.php

mauritsweebers avatar Aug 17 '22 10:08 mauritsweebers

This issue is still there. Maybe implementing the hotfix would be an idea? 😊

emanuelstrom avatar Apr 27 '24 04:04 emanuelstrom