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

Added Persian translation #158

Merged
merged 13 commits into from
Apr 26, 2023
Merged

Added Persian translation #158

merged 13 commits into from
Apr 26, 2023

Conversation

4r7if3x
Copy link
Contributor

@4r7if3x 4r7if3x commented Apr 19, 2023

This PR addresses a few improvements in the font and language support:

Change Log:

  • Resolved the character rendering issue by incorporating font support for an extensive selection of languages
  • Added Persian as the first RTL language along with its respective translations
  • Reorganized the languages and their translations according to their ISO codes to improve readability and consistency

Known Issues:

@GyulyVGC
Copy link
Owner

Thanks for your contribution.

Just a few notes:

  • before adding new font files, have you tried to use the fonts in the font/full folder?
  • I cannot include all those fonts file, as the size of the binary would be too high

@GyulyVGC GyulyVGC added the translation User interface translation label Apr 19, 2023
@4r7if3x
Copy link
Contributor Author

4r7if3x commented Apr 19, 2023

  • before adding new font files, have you tried to use the fonts in the font/full folder?

Yes, those fonts won't work for Persian and some other languages.

  • I cannot include all those fonts file, as the size of the binary would be too high

No single font supports all characters. Merging them wouldn't help reduce the volume, nor is it a straightforward process. Instead, we could consider loading them on-demand from a CDN during runtime, rather than embedding them directly into the executable file.

Do you have any suggestions?

@4r7if3x
Copy link
Contributor Author

4r7if3x commented Apr 19, 2023

On second thought, what if we don't use a custom font at all, but rely on a widely-used, pre-installed default font on the client side? Would Iced support system fonts just by specifying their names?

@GyulyVGC
Copy link
Owner

I don't think so... until iced will not support font fallback I think there is little we can do.
I'd suggest waiting for iced to support it before merging this PR.

@4r7if3x
Copy link
Contributor Author

4r7if3x commented Apr 20, 2023

I addressed the issue with the executable size and kept the original font as a fallback.

In near future, I tend to assist with packaging the app for more platforms and installer tools. At that point, we may opt to install the custom fonts during setup, considering the approaches taken by traditional desktop apps, but I don't like the idea of installing other language fonts on the client's system.

I still like the idea of relying on pre-installed fonts if we can manage to display the language names on the settings page whether the language font exists or not, perhaps by bundling a limited-character custom font. However, this method requires a fallback solution, such as the dynamic loading that I just introduced in this PR, so it can handle unexpected selections of curious minds.

@GyulyVGC
Copy link
Owner

I'll give a more in-depth look to this PR in the next few days.
It seems a good start, but I'm still convinced that there could be a better solution without involving a CDN.
I could try keeping the original font file for the other languages while using for Persian a subsetted version of the font file you submitted yesterday.
I know it's not a very scalable solution if in the future new arabic translations will be submitted, but it's the best thing that comes to my mind.

Also, it'd be very appreciated if you could help with packaging.
In particular, I'd like to come up with a script to automate the packages build for the different platforms, and I'd prefer to generate not just a binary but a bundle including a desktop icon.

@4r7if3x
Copy link
Contributor Author

4r7if3x commented Apr 20, 2023

I'm still convinced that there could be a better solution without involving a CDN.

I understand... But traditionally, when the application didn't adopt system fonts, custom fonts have either been bundled within the executable or included in the accompanying resource files. Loading fonts from CDN however, is a common practice in hybrid applications. Alternatively, we could merge glyphs from other language fonts into the subset font that you have already created since only a few additional characters would be introduced, although we may encounter some technical difficulties in the process.

Nonetheless, as you suggested, we can only include an additional Arabic script font for both Arabic & Persian since the original font works for the rest of the current selection. This approach should work well for most non-East Asian languages, which typically have lighter font sizes compared to East Asian languages. However, for languages with larger font sizes, font subsetting might be used to reduce file sizes, as you are already familiar with this technique.

I'd prefer to generate not just a binary but a bundle including a desktop icon.

Sure, that was actually my main objective. I can certainly help with the other aspects as well.

@GyulyVGC
Copy link
Owner

Sorry for the delays, but I'm currently busy implementing new features for the next version.

Tomorrow I'll merge the font file with Arabic characters in the full font file and I'll subset it keeping only the used glyphs.
My plan is to keep only the modifications you made with this commit.

@GyulyVGC
Copy link
Owner

I've added the arabic glyphs to the original font files.
Let me know if everything seems ok to you.
If it's all good, I'll proceed merging the PR.

@GyulyVGC GyulyVGC changed the title Enhancements to Font and Language Support Added Persian translation Apr 26, 2023
@GyulyVGC GyulyVGC merged commit 90fc34c into GyulyVGC:main Apr 26, 2023
@GyulyVGC
Copy link
Owner

@all-contributors please add @4r7if3x for translation.

@allcontributors
Copy link
Contributor

@GyulyVGC

I've put up a pull request to add @4r7if3x! 🎉

@4r7if3x 4r7if3x deleted the feature/additional-languages branch April 26, 2023 16:53
@GyulyVGC
Copy link
Owner

GyulyVGC commented May 3, 2023

@4r7if3x are you still willing to help packaging the app?
I'd especially need some kind of automation to package deb and rpm packages for Linux.
If you are in, I can assign you an issue giving more details.

@4r7if3x
Copy link
Contributor Author

4r7if3x commented May 3, 2023

@4r7if3x are you still willing to help packaging the app? I'd especially need some kind of automation to package deb and rpm packages for Linux. If you are in, I can assign you an issue giving more details.

Sure! Please let me know about the deadline as well. If you need to discuss something personally, you can always reach out via email.

GyulyVGC added a commit that referenced this pull request May 7, 2023
@GyulyVGC GyulyVGC added this to the v1.2.0 milestone May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation User interface translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants