Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mauritsweebers opened this issue Aug 17, 2022 · 2 comments

Comments

@mauritsweebers
Copy link

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
Copy link
Author

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

@emanuelstrom
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants