-
Notifications
You must be signed in to change notification settings - Fork 94
More sensible default language pair #352
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
Conversation
more sensible default language pair when apertium.org is loaded
sushain97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for the PR.
No new JS should go into index.html.in. It should all go in assets/js.
|
@sushain97 how can i run this code? |
|
What error did you run into when following the instructions in the README? |
|
I ran it. :), But |
|
But...? |
|
okay im done i think. :) |
|
Now the default translator pair is first available user's browser preference language pair. :) or it will select english as default. :) |
|
https://maathavanjkr.github.io/ here you can see it in action. :) |
sushain97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving this code!
jonorthwash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to change to the browser-preferred language even if it isn't an available for translation. This is incorrect behaviour.
Its Done I think. :) anymore changes? :) |
sushain97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better! Still some concerns and broken tests apparently.
|
I'm fine with Just not happy with checking whether things exist in local storage first. If things do exist there, we should let |
I think it will work. Lets try. :) |
|
@sushain97 its working on both Chrome and IE. Can u please take a look at the code. :) |
|
I'm not exactly sure we're on the same page. I suggested leaving this as is with your new code setting |
But it didnt work when running it after |
|
Why? |
|
Im not sure with it, wait i will have look. |
|
Got it! Because |
|
apertium-html-tools/assets/js/persistence.js Line 158 in 0fe0c81
|
yeah, You are right. I ran some tests and It seems the language we set to |
|
Gotcha! In function |
|
Ah, jeez. Good detective work. I made some tweaks that I think should fix it? Also, I wonder if we should be calling |
Yeah!! I thought this to do inside set |
And i think we should call |
Yep, that sounds like the right move after taking a quick look at the code. Could you make that tweak and test it? |
Done. :), Tested on both Chrome and IE for both instances and its working perfectly. |
|
Seems good! |
|
@jonorthwash This looks good on my end. Wanna try it before I merge? I don't have any particularly unique browser settings. |
more sensible default language pair when apertium.org is loaded. I think it might work!