Code Monkey home page Code Monkey logo

Comments (3)

pbrisbin avatar pbrisbin commented on August 16, 2024 1

OK, it shouldn't be much trouble to implement,

-        if [[ "${ans,,}" == $(gettext 'y')* ]]; then
-          pacignore add -c "$PACMAN_CONF" "$pkg"
-        fi
+        case "${ans,,}" in
+          # comment explaining why we're doing this surprising thing
+          $(gettext 'y')*|y*)
+            pacignore add -c "$PACMAN_CONF" "$pkg"
+          ;;
+        esac

(And similar anywhere else we have a y/n prompt.)

I'm not sure when I'd be able to actually do this work/release, etc, but I'll leave this here in case anyone else can jump on it.

from downgrade.

pbrisbin avatar pbrisbin commented on August 16, 2024

Oh, interesting use-case!

Looking over the code, I find this:

        eval_gettext "add \$pkg to IgnorePkg? [y/N] "
        read -r ans
        if [[ "${ans,,}" == $(gettext 'y')* ]]; then

What that means is that we compare ans with the localized string for y. With the ru locale, which I assume you're using, that is:

#: bin/downgrade:129
msgid "y"
msgstr "д"

So gettext 'y' returns д. If you enter that (ans="д"), then the condition's true and it works. If you type y instead (ans="y"), the condition's false and it doesn't work.

It sounds like your use-case is to be in one locale (ru), but answer prompts in another (en). This isn't directly related to keyboard layout, but I can see how one leads to the other. Just curious, is there a reason you don't switch locales when you switch keyboard layouts?

The only way I can think of to make this work is if we change our code to also accept en answers to prompts in addition to the localized values.

Does this all sound accurate? Am I missing anything?

from downgrade.

TAforever avatar TAforever commented on August 16, 2024

Yes, thank you, you understood everything correctly. I’m just too lazy to switch the layout because when working in the shell, the Russian layout is almost never needed.

from downgrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.