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

Implement fallback language for PyCSW to avoid warnings #10615

Closed
etj opened this issue Jan 30, 2023 · 0 comments
Closed

Implement fallback language for PyCSW to avoid warnings #10615

etj opened this issue Jan 30, 2023 · 0 comments
Assignees
Labels
4.0.x 4.1.x master minor A low priority issue which might affect only some users and /or not the main functionality

Comments

@etj
Copy link
Contributor

etj commented Jan 30, 2023

pycsw recognizes only a few languages:
https://github.com/geopython/pycsw/blob/7fc81b42bfdc5b81250c24887fd6a66032a6b06e/pycsw/core/config.py#L50-L54

        self.languages = {
            'en': 'english',
            'fr': 'french',
            'el': 'greek',
        }

GeoNode, as of master, forces pycsw to use its own language:

"language": LANGUAGE_CODE,

If the GeoNode language is not allowed in pycsw, there will be lots of warning in the log, making it hard to spot real issues.

Here the line raising the error
https://github.com/geopython/pycsw/blob/2.6.1/pycsw/server.py#L182

It would be useful to replace in GeoNode this line

            "language": LANGUAGE_CODE,

with

            "language": LANGUAGE_CODE if LANGUAGE_CODE in ('en','fr','el') else 'en'
@etj etj added the minor A low priority issue which might affect only some users and /or not the main functionality label Jan 30, 2023
@giohappy giohappy changed the title pycsw language Implement fallback for PyCSW language to avoid warnings Feb 23, 2023
@giohappy giohappy changed the title Implement fallback for PyCSW language to avoid warnings Implement fallback language for PyCSW to avoid warnings Feb 23, 2023
github-actions bot pushed a commit that referenced this issue Feb 27, 2023
#10692)

* - [Fixes #10615] Implement fallback language for PyCSW to avoid warnings

* update formating

(cherry picked from commit 6e15d4d)
giohappy pushed a commit that referenced this issue Feb 28, 2023
#10692) (#10702)

* - [Fixes #10615] Implement fallback language for PyCSW to avoid warnings

* update formating

(cherry picked from commit 6e15d4d)

Co-authored-by: NAGGINDA MARTHA <[email protected]>
@afabiani afabiani added the 4.0.x label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0.x 4.1.x master minor A low priority issue which might affect only some users and /or not the main functionality
Projects
None yet
Development

No branches or pull requests

4 participants