Builditluc / wiki-tui

A simple and easy to use Wikipedia Text User Interface
https://wiki-tui.net/
MIT License
405 stars 14 forks source link

[FEATURE] Interactive language section #178

Closed non-descriptive closed 1 year ago

non-descriptive commented 1 year ago

Is your feature request related to a problem? Please describe. Many pages has links to the same pages but in other languages, but I didn't see anything related to this functionality anywhere aside from config option to change default wiki language.

Describe the solution you'd like Generally I think it's good to add three things:

Checklist

Builditluc commented 1 year ago

Hey @non-descriptive and thank you for your feature request! These are great things to implement, especially after the language update 0.7.0.

Some keybinding to change the default wiki language on the fly on the main screen.

We actually have a keybinding since 0.7.0 for changing the wiki language on the fly (only changes for new requests). You can check out the docs about the feature here

Add the same keybinding to display language section selection for current page. Like here, for example. add some status bar to display current language section and available language count like above Of course add some customization settings about it in configuration.

Yes, I think that's a great idea! What would you think about having a status bar at the bottom (or top if you want) that displays the current language and available languages? To change the language of a given article we can use the same dialog as the already implemented language-switching dialog.

Builditluc commented 1 year ago

Implemented the status bar (not fully, still have to find one very weird bug where the program crashes when it's too small?). Going for the selection now

Builditluc commented 1 year ago

Hey @non-descriptive! I've finished implementing this feature in language-selection (PR: #190). Could you please try it out and check if it works for you?

non-descriptive commented 1 year ago

I see language count in the status bar, but don't understand how to select some of it. F2 pops up global language wiki language, but not the page. It also breaks links on the page, since it attemts to follow with wrong base URL. Just saw commit about F3. Kinda works

non-descriptive commented 1 year ago

Also there's some phantom English in the selection, not sure where is it taken from:

  1. search ASD
  2. pick "Autistim spectrum"
  3. F3, type english
  4. There's gonna be two options - English and Simple English. First one will yield error.
Builditluc commented 1 year ago

don't understand how to select some of it

You can press F3 to toggle the popup (will be announced in the release notes). This keybinding can also be customized (with keybindings.toggle_article_language_selection).

It also breaks links on the page

Right, overlooked that! Will try to fix this before merging.

Just saw commit about F3. Kinda works

What do you mean by kinda works?

Builditluc commented 1 year ago

phantom English

That's weird. I cannot reproduce the error unfortunately (do note that English and Simple English are two different languages and yield different articles). Could you maybe provide me with the log?

non-descriptive commented 1 year ago

do note that English and Simple English are two different languages and yield different articles

Thing is I've already opened English article, since it's default language, So it shouldn't display other English beside simple english. Tried to switch to Russian and back again and it displayed two English options (and Simple English of course). One is valid and one is error. Didn't see any anything special in web article, as well didn't see any other articles expose same behaviour with extra language.

Debug log

Builditluc commented 1 year ago

Thank you for the additional information and the log, with them I could reproduce the issue. I'm going to look into it!

Builditluc commented 1 year ago

Regarding the issue with the links, for this I have to rework the way links work in wiki-tui, but I'm going to be working on this before merging this feature. It actually fixes another bug where existing links in articles won't work when you've changed the global language.

Builditluc commented 1 year ago

Hey @non-descriptive, I've re-implemented the links (in #191) and did some more testing to be sure the feature is stable. Could you try it out and let me know if I've missed any bugs and/or if you have some more suggestions that really should be implemented before merging?

non-descriptive commented 1 year ago

will check on this a bit later