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

Add support for all languages in wikitionary #66

Open
ligix opened this issue Feb 28, 2024 · 1 comment
Open

Add support for all languages in wikitionary #66

ligix opened this issue Feb 28, 2024 · 1 comment

Comments

@ligix
Copy link

ligix commented Feb 28, 2024

Instead of continuing to add more and more ugly if cases and hardcoding the lists of the languages it might be a good idea to make the code generic to allow adding more languages by just changing a simple configuration file.

A few examples of code that needs changing:

if (current_locale.startsWith(
"fr",
ignoreCase = true
)

val languages = arrayOf("English", "French", "German", "Polish")


// TODO: Need to organize mapping somewhere. This is not scalable on introducing new languages.
if (item == "English") {

Relevant issues: #39 #49 #55 #56

@tirkarthi
Copy link
Owner

Agree that the language handling needs refactoring since I remember the places to update which is error prone.

The issue with adding new language is that is it's not easy to parse XML of different languages since they exist in different formats of markup without any standard to parse them. AFAIK, there is no database dump available from Wiktionary and the XML dump has to be parsed per language using Python. Since I am not a native speaker I also need to randomly verify few words to ensure the meaning and parts of speech are correct. This also involves updating CDN which is also a manual process. This makes adding new languages a tiresome process.

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