-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Enhancement
Adding Thai localization and fixing broken Thai language.
#2331
Comments
Do you mind splitting those in two different issues (maybe just add a new issue for the display issue)? |
For the first request, could you please help the the translation of the following strings (just the part on the right of en: # English
bytes_per_char: 1
weekdays:
mon: Monday
tue: Tuesday
wed: Wednesday
thu: Thursday
fri: Friday
sat: Saturday
sun: Sunday
weekdays_short:
mon: Mon
tue: Tue
wed: Wed
thu: Thu
fri: Fri
sat: Sat
sun: Sun
months:
jan: January
feb: February
mar: March
apr: April
may: May
jun: June
jul: July
aug: August
sep: September
oct: October
nov: November
dec: December
months_short:
jan: Jan
feb: Feb
mar: Mar
apr: Apr
may: May
jun: Jun
jul: Jul
aug: Aug
sep: Sep
oct: Oct
nov: Nov
dec: Dec
relative_day:
today: Today
tomorrow: Tomorrow
in_2_days: In 2 days
in_3_days: In 3 days
in_4_days: In 4 days
climate:
states:
"on": "on"
"off": "off"
heat: heat
please_confirm: Please confirm
unavailable: Unavailable
unknown: Unknown
no_name: No name
alarm:
home: Home
away: Away
night: Night
vacation: Holiday
bypass: Custom bypass
disarm: Disarm
settings:
reboot: Reboot
sleep: Sleep mode
brightness: Brightness
bright: Bright
dimming: Dimming
dim: Dim
meridiem:
am: AM
pm: PM As a reference, you can take a look at other translations here: NSPanel_HA_Blueprint/nspanel_blueprint.yaml Line 4855 in e146b1f
Thanks a lot for your support with this. 😃 |
Will do. Let me finish the translation and I will open another issue for the display. Thank you. |
I will post the translation for you within an hour. Thank you. |
Hope this helps. Thank you in advance. |
This was solved in |
I changed the ref to DEV branch and re-flashed my NSPanel successfully but I couldn't find 'Thai' in the localization of Blueprint Setting Page. Is there anything I must do in order to activate and test these Thai language and make sure everything is working great before the 'main' version update? Thank you and looking forward to hearing from you. |
You have to update the Blueprint also and this is a manual process: TFT also must be update, but this is easy, as you can just press the TFT button to update as you do now. But please be aware the version on dev is quite broken, so be prepared to return to main after your tests. 😉 |
Thanks for the link. I'll do some testing tonight and will give you feedbacks then swap back to the main branch. |
Tested and the only page I could get to interact with is the front page (Home Screen), I can see the day, which is 'อาทิตย์' just fine but for the date and month, it only shows 20 (which is date) without following by the month. When switching back to English, it shows a complete Sunday, 20/10 though. I think it's because of the max char limit in that text area. For some reason, clicking on other pages will just return back to Home or not going anywhere. Because of this, I can't check whether other pages on the panel could display everything correctly. I'm switching back to |
Ok, I will increase length in some of those common fields... |
About not opening the other pages is an issue I'm working on right now and is not related to the language you selected. |
I've just tried and the pages are opening... It's slow, but it is opening. |
When I tried navigating to any pages, the screen flickered and came back to home page instantly. However, it did manage to show a climate page in a blink but it was too fast that I couldn't notice anything apart from the temperature bar. Will re-flash back to dev branch to get the ESPHome logs. |
Re-flashed back to dev branch with dev branch blueprint and latest version of TFT from dev branch. The result is still the same. I can't navigate to any pages as it will just send me back to home in a blink. I also notice the Red HA icon but when I trigger stuff from the physical relay switch (which is bind to turn on/off the fan without wiring anything for real), it could turn on and turn off the fan as normal. I assume that the blueprint links to the Panel just fine (since it also shows Thai language on the date) but I don't know why the HA icon is still showing red. I should also mention that I'm only using bluetooth proxy addon with the panel as well. Please kindly find the log enclosed along. I tried to subtract anything that is not relating to the NSPanel so it's easy for you to diagnose. Thank you. |
Your logs shows the tentative of a service call providing the parameter Without that, it will flag as missing the blueprint (the reason for the red icon) and this will prevent opening most of the other pages. |
I'm sure it's the right blueprint since I'm using the one from this link https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/dev/nspanel_blueprint.yaml If it's not the right one, can you please kindly point me to the right link? Thank you and looking forward to hearing from you. |
Give me a couple of hours and I will change all to dev2, so we make sure you have all the latest... I will double check the service calls also to make sure it isn't a remaining one using that |
Helps with troubleshooting on #2331
Please let me know your results with dev2. |
I got this error while compiling even with the clean build.
Do you know what's the cause of the problem? Edited: It works out of sudden. I can continue flashing and compiling now for some reason. I will paste the logs here again later. Thank you very much. |
Still at 97%. HW Relays seems to still be the problem here. Everything on the Home Screen loaded up perfectly, chips included. All the chips can also report the right stage. The small buttons on home screen also reflect the state of the devices. However, I will have that Red HA Icon on the screen and it's impossible to navigate to any other pages than the Home Screen. I think though, as I don't use a fallback function of HW Relays, I don't know why there a [1][1] at the very start of the chips position. I remember not seeing this in the current main version. It just appears this time. Hope this could bring any light to the problem. Edited: Forgive my recklessness. I just noticed that the [1][1] of HW Relays was shown on the screen because I enabled Relay 1 and Relay 2 in ESPHome setting. I turned those off and [1][1] is now gone but I still can't navigate to any other pages than the Home page. |
Here is more of the logs
|
Ok, I still have to fix this issue with the relay, which I couldn't duplicate here, but I also think the navigation should work regardless, so I will work a bit on this. |
Could you please flash your device again and give another try? |
It works now. No more RED HA icon and I could now able to navigate to other pages. The boot is still at 97% though but it doesn't effect the user experience. The panel seems to be quite snappy too. Thank you very much for your effort in making the panel working. You are awesome! |
What about the Thai strings? |
It shows up almost correctly. Some text fields will need extra spaces. For example, the word tomorrow, in 2 days, in 3 days, in 4 days and so on. Also, the button_text field will also need to be extended as well. Apart from that, I can't seem to be able to navigate to Entity Page as well. I can only scroll through Button Pages but once it goes through all the button pages, it will just turn back to Home page instead of continuing with Entity Pages |
Entity pages are accessible via a specific button on Home page with a mdi:format-list-bulleted icon (or some other if you changed in the Blueprint). |
I don't wanna increase max length randomly as in some cases the field is global (mainly the ones on Home page) and could take considerable memory from Nextion, which is already around it's limit, so I would appreciate if you can indicate how much more chars you estimate those would require. |
Thanks for pointing me to that entity icon on the Home page, it works. As I don't have Windows Laptop or Computer around me at this moment, I will try playing with the HMI file to find the right length for the text in each field. I'm leaving for China tomorrow so I will be back and work on this again on 10th October. I will check on the HMI immediately after I'm back to my home. For some reason, I kinda think it might be a better idea if you can allow another TFT file (a Thai version). The normal font size of the current standard TFT is very small in Thai. For example, the size of the button_text and entity_text would need around 4 size bigger so that it could be read without having to take a very close look at the screen. Hence, having another version of TFT would seem to be the easiest option here. But then again, I understand how time consuming it is for you to have to maintain all TFT versions for an update. Again, thank you very much for this. It's great to see the Panel being localized in Thai with your firmware. |
We can try with another TFT, but it's hard to believe it will get much better with this approach. The screen resolution is limited, and increasing fonts will bring us new obstacles. But let's try, so we know. 😉 |
Done! |
I just came back home from Shanghai and finished reflashing with the latest TFT. As far as I have tested, the text fields seem to be reasonable now and it could display the word as it should be. I think this should be okay as long as we Thais try to be creative by shortening the words down with a name in Thai language when labelling the buttons. Thank you very much for all the hard work. Cheers. PS. Not sure why the entity page icon and utility page icon on the Home Page is disappear again though. |
I have to make this more robust. 😩 |
Let me know if you want me to test on anything. I'm back and ready to do it now =) |
I will close this one related to support to Thai. Please feel free to re-open if you have anything related to that. |
Could you please try again the page button with Thai on v4.4.0.dev5? I've made some changed on how those pages are rendered and would like to know the impact with Thai and this issue you reported. |
Just wanna let you know that everything works really great again in Dev7. I think it's the most stable among all the dev versions. Great Job! |
I'm glad to hear that. I've rebuild lots of things to reduce memory consumption... |
I don't mean to ask another question in this thread but is it possible to set the hardware relay for local control permanently instead of switching to local automatically only when the network is down? I have 1 location where I need to use the relay button to on and off the lights since the lights in the location are not a smart one. Thank you in advance. |
If you use the Blueprint to assign the relay 1 to button left or relay 2 to button right those will be always controlled locally. |
Got it working now. Thank you very much. |
Enhancement Summary
Enhancement
Adding Thai localization and fixing broken Thai language.Detailed Description
How can I help in localizing this project for Thai language? I can help translating all the words from English to Thai (one by one) if it means to get my native language supported by the project.
Currently, Thai characters are displayable since it's also included in full charset list. However, it's not being display in a correct way and it's impossible to read. I believe it's due to the letter combination we have in our language and it much like Korean or Chinese where we mix the character up for words with upper and lower letter for vowels and intonations.
Based on the hmi/dev/ui/fonts/CJK/Full Charset.txt, we currently have
"กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำ฿เแโใไๅๆ๏๐๑๒๓๔๕๖๗๘๙"
,which covers all of Thai letters, vowels, intonation marks and numbers. However, when we write word in Thai, we combine these characters in a weird way and not just by ordering the letter from front to back to form a word. This is why the word appear on the display in a weird way when it has an upper or lower letter. For example, "ข ำ" is displayed instead of "ขำ", which is the correct way to write the word.
I think the problem could be both an unsupported Thai character font is being used in the project or the the space between the letter is too much that it causes the letter break.
I tried to look for the font_id or anything that I can use to tweak in the yaml of ESPhome in order to change for to Thai supported Google font but I can't seem to find that in both
substitutions:
area and anywhere in theesphome/nspanel_esphome_core.yaml
. As I'm a newbie in ESPHome, can you please guide me what should I do in order to change the displayed font to the fully supported Thai character from Google Font or how can I make this project 100% compatible with Thai language?This project is such a great project. Thank you very much for making NSPanel usable for real.
Really looking forward to your reply.
Additional Context
Picture showing how the Thai characters are currently displaying on the NSPanel with the project.
The text was updated successfully, but these errors were encountered: