-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Basic localization support #972
base: master
Are you sure you want to change the base?
Conversation
awesome work. reviewing |
I think you should add a selenium test. This is quite easy to do and will properly test it works. |
This is dope. So yes, only thing missing is the selenium test that will ensure your tagHelpers and the |
…ating the translation class on every translation call. Huge performance improvement!
@NicolasDorier I have just committed the Selenium test but cannot run it myself. The selenium tests only run on Chrome 74, but I have 76. Not sure how to handle this. I also did a major performance improvement: Previously each translate call would re-create the translator and read the JSON file again and again, causing very slow page load. No longer an issue. |
@woutersamaey that's strange, you should be able to run the tests. I will check. |
You also need to fix the warnings by the way. |
@NicolasDorier I'm seeing a lot of The warnings have been fixed. The Selenium test still fails. Not sure why. |
Ignore |
@NicolasDorier Where do you suggest I put it? I can put it in the footer if you prefer that, but in that case I'll make sure to add automatic language detection based on the |
Pulled the code and it is working! Tnx for your help! |
@woutersamaey idea: (fa-globe) |
@NicolasDorier I like the minimalistic presentation, but don't think the globe is well recognized for translation. Why not keep the dropdown but with:
I prefer to keep the dropdown as it triggers a form HTTP POST + it is convenient on mobile devices thanks to native input controls. Having a traditional menu dropdown or a pop-up modal would be a problem once we get like 40 languages. If you think changing the CSS is sufficient, I would prefer to keep the languages names in full form and not 2 letter codes. Maybe add a separator on the left, that could also help set it aside from the main menu. What do you think? |
I am not good in html/css but I think that you can make the globe (or any other logo you like in font awesome) show a dropdown when clicked without javascript.
We'll see what do to when we get to this point. Though I don't think this is problematic.
Whatever, but it should not take too much screen space as it is rare people use it once they have set their location. Another idea is to put this in the |
You can browse icons on https://fontawesome.com/icons |
Maybe in the footer it can also work. |
@NicolasDorier I'll do a combination of what you suggested. Full dropdown in footer (best to keep this for older people) + globe icon on top. You're right about the dropdown without JavaScript and I am familiar with FontAwesome. This is kinda my thing 👍 |
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.
There are a lot of changes in master causing a big diff and making it hard to review, can you rebase?
@@ -119,7 +119,7 @@ services: | |||
- "bitcoin_datadir:/data" | |||
|
|||
customer_lightningd: | |||
image: btcpayserver/lightning:v0.7.1-dev | |||
image: btcpayserver/lightning:v0.7.2-dev |
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.
I think you need to rebase
@woutersamaey please rebase. We will use the current dropbox only in regtest (hidding it on mainnet) until you can replace it with something better. |
Will do. Please give me 1-2 days. My holiday is over and I'm back at work so busier again :( |
Unfortunately I'm not finding the time to continue work on this. I got pretty far, but lacking the time to finish. |
Will take it upon myself to finish this as soon as I'm free |
I'll take this over... will close it temporarily as we clean up our PRs (gotta reach 0 @NicolasDorier). Will rebase and merge existing effort as soon as I have time. |
Reopening to reconsider |
@NicolasDorier please review the code in this PR as a basis for localization.
It is fully working with:
Todo's are:
Accept
request header as a last resort (if he doesn't have the cookie & no language stored in his user profile)en.json
file during development, so the file can be easily uploaded to Transiflex without needing to manually copy-paste keys. This is a pain.Some things I'd like some help with are:
I'm not 100% sure the translations are kept in memory and the JSON file isn't re-read. Maybe you could help me find out? There is a flag to "reload on change" and that is set to "true", so maybe it's decent. I dunno.I'm planning to address all of these TODOs, but would like to get your thought so far.
I don't expect you to approve the PR in this current state, though you probably can!! After all it is functional, just not 100% translated yet.