Skip to content

Fix some vaild lang_result that get incorrectly fallbacked#42

Merged
opsdisk merged 3 commits into
opsdisk:masterfrom
libenc:patch-1
Apr 7, 2024
Merged

Fix some vaild lang_result that get incorrectly fallbacked#42
opsdisk merged 3 commits into
opsdisk:masterfrom
libenc:patch-1

Conversation

@libenc

@libenc libenc commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

Fix #41

Comment thread src/yagooglesearch/__init__.py
@opsdisk

opsdisk commented Apr 4, 2024

Copy link
Copy Markdown
Owner

Good point about the breaking changes @libenc. The source of truth is the case-sensitive languages in the result_languages.txt file (which is from Google (#41 (comment)) . I like your original code in the PR to make the lang_result match what is exactly in result_languages.txt file.

I played around with just lowercasing everything, but when using the Chrome browser, Google only respected the lang_result when the case was exactly correct ("lang_zh-CN" worked and "lang_zh-cn" didn't).

Bump the version to "1.10.0" and then I'll update the README with your contribution.

@libenc libenc requested a review from opsdisk April 7, 2024 00:29
@opsdisk

opsdisk commented Apr 7, 2024

Copy link
Copy Markdown
Owner

Thank you @libenc! I also added you to the contributors section of the README.

@opsdisk opsdisk merged commit fb50cf8 into opsdisk:master Apr 7, 2024
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

Successfully merging this pull request may close these issues.

Some valid lang_result with capitalized parts will be incorrectly fallback to the lang_en

2 participants