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

Better Language Indicator #7

Open
patrickdark opened this issue Apr 22, 2017 · 6 comments
Open

Better Language Indicator #7

patrickdark opened this issue Apr 22, 2017 · 6 comments

Comments

@patrickdark
Copy link

If I enter something like "eng;q=0,zho", this disallows English, but "eng" is nevertheless displayed over the icon when I'd expect "zho".

Seems like it'd be better to either determine the highest weighted languages and display the code for the highest weighted language or "mul" (an ISO 639-2 language code indicating multiple languages) if there are multiple highest weighted languages.

Alternatively, one could do no weighting at all and display something indicating multiple languages.

Also, I'm not sure if invalid input like "???" should be displaying anything. (It displays "???".)

@callahad
Copy link
Owner

Good idea! The badge API can only display around four characters, so right now it's just showing the beginning of the string, mainly as a reminder that something is set, but you're right that showing the locale with the highest qvalue would be more informative.

Are you interested in fixing this? I'm totally open to pull requests. :)

@patrickdark
Copy link
Author

@callahad Yes, I can fix this if I can figure out how a pull request works. (I've written my own extensions.)

It looks like I'm supposed for fork the project, update popup.js, and merge it back into this project? I don't understand how one merges modified code back into the project though.

@callahad
Copy link
Owner

Awesome! No time like the present to learn how GitHub handles this stuff. :) Are you familiar with git itself, or are you also learning that at the same time?

You've got the right idea on the workflow:

  1. Fork this repository
  2. Edit your copy
  3. Propose changes (pull request)

Once you've updated popup.js, GitHub should show you a big yellow banner with a button to create a pull request. When you do that, I'll get a notification and be able to review and incorporate your changes.

If anything doesn't make sense, let me know. I'm happy to help, and even happier for this project to gain its first external contributor!

@patrickdark
Copy link
Author

patrickdark commented Apr 27, 2017

@callahad I downloaded Git Bash and Visual Studio 2015 and created some special command line ID when I tried to contribute a Firefox patch for an issue that required trivial JavaScript changes to their codebase, but then gave up since I couldn't figure it out.

I'm familiar with GitHub in a basic sense as I regularly submit bug reports and git as in I know it's a command line item, but that's about it. I don't know how to pull code from a specific GitHub repository, for example, so I just manually downloaded every file from my forked copy of yours.

I created a pull request with tested changes at #8. It's a total file overwrite so the diff page doesn't look nice. Not sure how to do it correctly.

I didn't see a yellow banner. I uploaded a file to the master, clicked a white "New pull request" button on the fork's main page then clicked a green pull request creation button afterward.

And glad to help!

@patrickdark
Copy link
Author

So apparently I get the nice diff by using GitHub's file editor instead of doing a whole file overwrite.

@callahad
Copy link
Owner

Overwriting the whole file should be fine -- git should be able to generate its own, minimal diff between the two versions -- but somehow that didn't happen this time. Weird. :)

It might be worth checking out Microsoft's lighter-weight VSCode editor, which has a nice built-in Git client that should make it easier to see exactly what is being committed. I presume VS2015 has something similar, but I haven't used it.

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