How to know whether WinForms can render certain menu fonts? - winforms

I have a WinForms application written in Visual C++/CLR. I have a "Languages" menu which drops down to show the available languages and which one is currently selected. The languages are written in their native form, e.g. instead of "German" it shows "Deutsch".
Some of these languages are written in different alphabets/fonts, such as Russian and Traditional Chinese. On my machine, they render fine, but some users have reported to me that certain languages render as gibberish/garbage on their machines, as you can see here:
Is there a way to correct this, or at least detect it? Currently I load these language names from folder names (a language is supported and thus listed if a folder exists with certain data files inside it). Ideally I can do something to make it "just work" but I could live with detecting a missing font and falling back to a Romanized/English version if I have to.

Related

How to make React app that support multilanguage?

I have reacted app and there are many components, and I want that the text will support multiple languages,
I mean if the user wants English then all content of the component translates into English.
I try to add multilanguage in my react app using the i18next library but I found that I need to write all text in every language and store somewhere then use that.
But I want it when the user selects language and then it translates into the desired language without hard code.
like when we write anything in google translator then it translates all the page with the desired language.
If you want the content of your site to be machine translated on the go, then some browsers (if not all of them) have this built-in functions. Just right click and "translate" the page. So maybe you should just mention about this function somewhere on the page?)
But if you want the content of your site to be professionally translated, then you've got to store it in the db. And depending on the global language state (which could be managed with redux), the content in selected language will be rendered.
Live translation on your website is not a good idea.
Alternatively, checkout translate.i18next.com
like google translate but for i18next.

Basic text formatting during text input with Codename One

I know that is possible to programmatically format a text in Codename One using something like "Rich Text View". But in my use case the user can do basic formatting of the text.
For example, see the following two screenshots of the Protonmail app. How can I do something similar with Codename One?
In the first screenshot, "Taglia" means "Cut" and "Copia" means "Copy".
In the second screenshot, "Grassetto" means "Bold" and "Corsivo" means "Italic".
We don't support that. This behavior is very inconsistent between platforms and pretty limited in all native platforms so implementing it in a cross platform way isn't practical.
However, since all platforms have good HTML5 support it's pretty easy to implement it with a WebView by embedding a web based rich edit widget. Since these consistently work with HTML the results are cross platform and should be easy to work with. In the past we had a CKEditor cn1lib but I think it's out of date by now. The core concept should work though and should be much easier to implement as we now support the html package for deploying web resources. So you can take any HTML based text editor and just place the files under the src/html directory then open that hierarchy for editing.

Developing User Interface using only C or C++

How are user interfaces developed from the ground up in low level languages like C or C++? We usually make GUIs using libraries or APIs. But I'm interested in understanding the fundamentals of how these libraries are implemented and how they create a Window from just coding only.
There is a surprising amount of stuff to make a simple GUI control like a button work.
Quite a few years ago I was on a project developing a Pacemaker Programmer (custom computer) where we needed to write a GUI application but the OS we were using only had text-based output support. We purchased a product called the Zinc Application Framework that could do that for and since it was designed to work on anything, we had access to the source code (and I peeked).
There are simple thinks like you would not even think about. Like, what if the button is partially covered by another window. Then you have do the divide the button into both an visible and hidden region so you can display the correct part. Remember, a screen is only one set of pixels. Now, I am sure a graphics card or a library/protocal like direct-X might do that for you; but, it has to get done and you wanted to know the details.
Zinc was a very Object Oriented design so the part I described is part of the window drawing component that the button did not need to know about. Also, it used a lot of inheritance (written in C++) to build class upon class; so, the total functionality of a button was spread all over the place. Ex: A button and a check box are very similar except in the way they are displayed; so, the classes the realize them share the same base classes.
If you are really interested and are willing to spend the hours to understand it, there should be open-source Windowing/GUI code you could look at. X-Windows comes to mind. I wish I could show you the Zinc code because I am sure it was much simpler.
One of interesting readings on this topic i read was document of wayland http://wayland.freedesktop.org/docs/html/ch01.html. It explains on X Window System and wayland architecture. To begin with, may be interested.

using silverlight for user interface only

I am planning to make a web application, using silverlight for frontend. requirement is: this frontend will be just an empty shell, and it must be language independent. it will get everything it needs to display and use from server, therefore making it language independent.
i tried to find tutorials, but there is nothing.
as far as i understand, silverlight uses xaml for all its data, so just generating it with whatever language i want shouldn't be a problem. but i don't have any silverlight experience or knowledge, so i'm not sure what is the best way to do this. for example, i don't know how will new content be generated, and what kind of structure silverlight requires.
can anyone give me some starting points?
Your requirements are rather demanding. If i can summarise:
silverlight will be the front end (or container)
you don't know what it will be showing
the content may be dynamically generated
everything, including the visual content, will be retrieved from the server
If i have misunderstood then by all means correct me or adjust your question.
Those requirements are not trivial, especially when you have no prior experience in Silverlight. Fetching data from the server is a normal behaviour in Silverlight, but fetching any generated UI content will be a slow and inefficient use of the technology platform. Silverlight is delivered via the browser, and runs on the client. If you are going to have generated UI, then you may want to consider using straight HTML instead (you can generate the contents using ASP.Net or a scripting language such as PHP). Alternatively, you can generate your required UI views from within the Silverlight app itself by either swapping in and out the appropriate pre-built piece of UI (or controls), programmatically adding new controls into the visual tree, or by loading XAML using the XamlReader class.
This answer may or may not help you much, but like i said before - put some more specific details into your question and you will get more specific answers (either add comments under your question, or post a new more specific question if you cannot edit your current one).
Edit: i have just come across this blog article from Jeff Prosise explaining the use of the INavigationContentLoader interface in Silverlight 4 to dynamically load pages from either remotely or locally. It is a detailed write-up, with a lot of code samples, it may be of use to you.
I would suggest you start at http://Silverlight.net
The "Learn" section has lots of videos that can get you started. http://www.silverlight.net/learn/

UC(User component) concept in Win32/.NET Win forms

Couple of year ago I when to work for company as web developer. It has my first Sirius web development job, (ASPx/C#) so it has very exciting and I learned a lot about that world, from the developer point of view.
In that group we had a concept for the pages where loaded in the page UC’s (User controls), I don’t know if it’s the same in every web development team with every language, I’ll assume it is so.
The contract ended and I came back to develop win32 “winForm” application.
But since them I have tried to apply the same principle for my win32 development I learn there, meaning having bunch of UC’s (Visual User controls) that I load in the form.
They are regular visual components, not loaded in the toolbox, code is available in the project, but the component is not developed in the form, they are loaded there.
I would like to know opinions about this approach, what other are doing similar or better to this And improvements that can help us to speed up development and increase code reuse, because that is what this is all about.
If you're using the layout components in Winforms, this might be an acceptable approach although I think the thing that distinguishes the web and Windows Forms (note: NOT WPF!) is that in the former you do a lot of "compositing" which is why the UserControl concept is so useful whereas in the latter you operate on very sophisticated controls (e.g. 3rd party - in my last gig we used an incredible grid control via a small company called Infralution)
The main problem I would see is with layouts since the rendering model is a little different than the web. I know nothing about your application but if it "works" that is what is most important. I assume in this case you use things like the FlowLayoutPanel and the TableLayoutPanel properly.
If you want to go a more canonical route, take a look beyond simply creating components at how you can use the inheritance model to composite your application in a more robust way - having a base Form class that has containers for where your "UserControl" type components go and then using some kind of interface based dependency injection to swap them out while the application is running.
Finally, take a look at some of the open source Windows Forms applications out there to see if you're being too hard on yourself since common UI and reusable components are a goal in every application. Even though I've always thought Microsoft's Patterns & Practices stuff teetered towards being bloated, there are some good ideas and you should study some of the approaches of the Composite UI Application Block they put out.
Okay, not finally, there's one more thing I'd like to add: take a long hard look at WPF which will bring back a lot of the concepts from your web development days and give you that kind of power in a desktop application.

Resources