Web Browser Extensions (Software) for LingQ

Maybe even just white text on a black background (for light mode) and black text on white background—or cream-colored or something—(for the dark mode browser users) as long as it doesn’t mess with accessibility, since light vs. dark mode is mainly an accessibility feature.

For me, I definitely missed it because it’s so much like the LIngQ interface, but that could be a good thing overall (unobtrusive) as long as the information page for the extension has a big “obnoxious” arrow pointing to it in the preview images or something, lol.

Just some initial thoughts I thought to share :slightly_smiling_face:

2 Likes

Are you referring to the lesson updater or rooster reader premium? I think that idea would be good for both.

That’s what I was going for! Not much point if people don’t see it though. I’ll think of a different way to make it stand out (such as a shimmer or gradient on the color)

Thanks for contributing!

2 Likes

Honestly, anywhere would help new users that won’t otherwise notice the “button” as it is on any of the extensions—if they have similar “buttons”—(poor souls like me, lol—currently, I’m using the Rooster Editor only.

1 Like

Hi @asad100101

I have added Urdu translation to the premium demo.

Here are some more examples you can try out

German Fables | German Short Stories | German Poems

1 Like

Hi @WillowMeDown

I will soon be pushing a fix for the spacebar propagation and also a fix for Asian word fragments!

Edit: → Fix is live now on Firefox. Chrome will take a few days.
imageimage

3 Likes

I have asked LingQ in the past to provide a button to translate every sentence in a lesson. Going through sentence mode and clicking the ‘translate’ button is really annoying. I actually prefer translations to dictionary lookups when I’m a beginner. Also, I sometimes like to use the app offline, which makes online translations impossible. At one point I hacked together a script to do this for my private lessons. I’ll include it down below, maybe someone can make use of it.

Summary
import requests

KEY = '12345'

LESSON_ID = '12345'
LANGUAGE = 'zh'

INDEX_URL = f'https://www.lingq.com/api/v3/{LANGUAGE}/lessons/{LESSON_ID}/editor/?'
TRANSLATE_URL = f'https://www.lingq.com/api/v2/{LANGUAGE}/lessons/{LESSON_ID}/sentences/'

HEADERS = {
    'accept': 'application/json',
    'Authorization': f"Token {KEY}",
    'content-type': 'application/json'
}

def get_indexes():
    response = requests.get(INDEX_URL, headers=HEADERS)

    if response.status_code == 200:
        data = response.json()
        indexes = []

        for paragraph in data.get('paragraphs', []):
            for sentence in paragraph.get('sentences', []):
                indexes.append(sentence.get('index'))

        return indexes
    else:
        print(f'Error: {response.status_code}\nResponse: {response.text}')
        return []

def trigger_translation(index):
    data = {
        'index': index,
        'language': 'en',
        'is_google_translate': True
    }

    response = requests.post(TRANSLATE_URL, headers=HEADERS, json=data)

    if response.status_code == 201:
        return response.text
    else:
        return f'Error: {response.status_code}\nResponse: {response.text}'

if __name__ == "__main__":
    indexes = get_indexes()
    if indexes:
        for index in indexes:
            translated_sentence = trigger_translation(index)
            print(f'Translated Sentence for index {index}: {translated_sentence}')
3 Likes

Thank you for the script @bamboozled. I’ll actually make this extension tonight! Then I can incorporate the auto translation into Rooster Reader. I Would probably limit it to say 100 sentences? I’m not sure they would want large text translations. I could probably make it auto save the translation and just reuse it.

2 Likes

I made this for my private lessons, you would have to get the sentence index from another url. I tried it on one of the new 6k word lessons and it does take some time but I got it all translated. Not completely sure what happens when a translation already exists, it might get replaced? You might need to try around a bit.

1 Like

This is the approach I have been using in javascript to do it dynamically.

 if (window.location.href.match(/https:\/\/www\.lingq\.com\/[a-z]{2}(-[a-z]{2})?\/learn\/[a-z]{2}(-[a-z]{2})?\/web\/reader\/\d+/)) {
        //console.log("Matched URL, creating GUI menu");
        urlParts = window.location.pathname.split('/');
        inLanguage = urlParts[1]; // Get the translation language code (e.g., 'en')
        language = urlParts[3]; // Get the language code (e.g., 'fi')
        lessonId = urlParts[6]; // Get the lesson ID (e.g., '23017594')
}

I’m sure LingQ probably knew about your 600 requests in a row as well XD

I’m considering a hard throttle, like 1 sentence gets translated, wait 1 second, ask for the next. (That would at least mimic someone spamming the next button in sentence view). Let’s see how this goes!

I’m in deep. I’ll figure it out

1 Like

Word Fragments! Especially welcome for Korean!!
(Korean word particles are a doozy).

3 Likes

More updates coming for Rooster Observer soon!

Great to hear. I was testing it out in Korean to try replicate your problem and the fragments were all saying ‘null’. I’ve fixed most… languages but there could still be outliers.

2 Likes

Automatic Lesson Translator Community Version has just been released. Please leave me feedback regarding upper use limits.

1 Like

Woah, I need to check this out! Word fragments for Korean! I second WillowMeDown!

This is awesome! And exciting! :smiley:

Is this under the Rooster Observer extension?

3 Likes

Check it out!

1 Like

Manual Installation via Firefox (for quick access):

To install an extension temporarily:

  • open Firefox
  • enter “about:debugging” in the URL bar
  • click “This Firefox”
  • click “Load Temporary Add-on”
  • open the extension’s directory and select any file inside the extension,
    or select the packaged extension (.zip file).

The extension installs and remains installed until you remove it or restart Firefox.

Source: Temporary installation in Firefox | Firefox Extension Workshop

Video provided by Firefox:

Note: After be sure to follow @roosterburton instructions for enabling the extension—if needed—mine automatically gave permission:

2 Likes

@sarjag

I would have to setup a Linux VM and investigate. Have you tried manual install from the source code and other browsers on your linux OS? Also can you tell me if there are any script errors showing up in the console?

2 Likes

Good stuff. Yomichan is an awesome addon, wish there was more like it.

Not sure, probably some unintended interaction. If it happens again send me over the error

1 Like

I use Safari. Any plans to develop this extension for Safari? (If not, please let me know why – I may be able to help if there’s a problem.)

2 Likes

I don’t own a MAC, I couldn’t test or deploy the extension.

1 Like

Pro tip: If the extension has already been updated for the day (or recently) and you’re not seeing updates you should be seeing. Uninstall and reinstall the extension to get the most recent update (as soon as @roosterburton announces an update since updates are always quick and frequent—when needed with all their extensions).

You’ll most likely have to re-customize the add-on to your needs again—depending on the extension (like with the Rooster Hotkeys extension)—but sometimes, getting the most recent update quicker is worth it—in my opinion.

Otherwise, just wait until it updates on its own with your automatic updates setting shown by roosterburton.

2 Likes