I have a simple native Visual C++ program that uses .mui files to implement resource localization. If I request fr-fr in SetThreadPreferredUILanguages, Windows finds my prog.exe.mui file in the fr-fr subdirectory, and uses it fine. But if I request just fr (no locale), although Windows sees the resource file (as verified by GetFileMUIPath), it refuses to use it, and goes to the ultimate fallback language. If I request fr-ca, and only have fr available, it refuses to use it.
This happens for "es" as well, and I imagine any "neutral language". It does work for "vi", so it's not a two-letter issue, but I think that's because vi is an actual locale, not a neutral language. This happens under both Windows 7 and Windows 8.
Is there something different I'm supposed to do in preparing the .mui files, the resources, or calling SetThreadPreferredUILanguages than I do for every other 4-letter specification? This is so basic ... what am I missing??
After much painful experimentation, I have come to the conclusion that although Windows will happily accept and report on so-called neutral languages (e.g., "fr"), it does not actually look for them in that way.
If the system is running "fr-ca" but one's program only has available "fr-fr", Windows will do the smart thing and use "fr-fr". But if all it has is a "fr" folder, Windows will not use it. If one explicitly requests "fr" in SetThreadPreferredUILanguages, it will happily accept it, and happily report it back from GetThreadPreferredUILanguages. It will happily list "fr" as available from GetFileMUIPath. But it will not do anything productive with it, not even look for "fr-fr".
Simple answer: do not attempt to use "fr" or "es" or any other "language neutral" nomenclature. You must always fully specify the locale, and by unspoken agreement, things like "fr-fr" are considered neutral.
Related
For the app I am working on I want to give the user the ability to select a different language than their phone is set to.
I have set everything up according to: https://www.c-sharpcorner.com/article/multilingual-implementation-using-xamarin-forms/ and it works great for 'official' languages like French, English, Indonesian, etc. However, since the app is pretty much about any and all spoken (or signed) language, I also want to offer the option to select Klingon, Toki pona, Esperanto, Ido, etc.
When I try to set the language to Esperanto with
CultureInfo language = new CultureInfo("eo");
the app crashes with:
Message (System.Globalization.CultureNotFoundException) "Culture name eo is not supported.\nParameter name: name" string
I have all the strings in resource files, I know exactly what the name of the file is for each language, and I don't need full localisation for these languages, so a way to force the use of 'AppResources.eo.resx' through code (after checking if the user has indeed set this preference) would also work.
Does anyone have ideas on how to do this? I feel like I'm missing something really obvious…
In case it matters, I have:
Visual Studio Community 2019 for Mac
Version 8.10.8 (build 0)
Mac OS X 10.16.0
I'm using Poedit/1.8.11 on Windows 10 to manage translations for a CakePHP project, namely English and Spanish.
For each catalog, I've chosen the translation language from the drop down list so I presume they are correct:
In source *.po they look like this:
"Language: en_GB\n"
"Language: es_AR\n"
Nonetheless, spell checker is checking both translations as Spanish. The program does not seem to recognise the language and I can't find any menu item to pick it manually:
Online help does not even mention spelling. How do you set the spell checking language in Poedit?
This isn’t a programming question, but a “how to use Windows 10” one. In Windows 8+, the spellchecker always uses the language of your keyboard (which is a different thing from its layout!).
See https://superuser.com/questions/480540/how-can-i-change-the-spell-check-and-auto-correction-language-of-ie10-windows8 for detailed instructions.
As Václav Slavík explains, Poedit does not implement its own spell checking solution. Instead, it relies on Windows builtin spell checker.
In any case, Windows spell engine appears to ignore both current input language at OS level:
... and current translation language set in gettext catalogue:
Instead, it appears to merge the dictionaries of all available languages and run a simultaneous check on all of them:
I understand it's a feature aimed at mobile users since it's similar to what Android virtual keyboard does but in this particular case it renders the entire tool useless.
Given that configuring languages is particularly difficult and counter-intuitive, I recommend to just ignore the feature.
I'm utterly stumped, so what I'm looking for is a body of speculation. Or maybe someone actually knows what's going on.
I have a program written in VB6 which has had every user interface element font set to "MS Sans Serif, 7 point", in an effort to create an English/Turkish localization. The localized strings are compiled into the VB6 EXE, and there is custom code to do the hot-switching between languages.
The program reaches through COM to a .NET DLL assembly which carries a "tr" satellite assembly with it, so that is also in the mix.
With a clean test system set with the display language (NOT the non-unicode setting, the other, more general one) to "English" the software runs without problems.
When it is set to Turkish, the .NET Interop system returns "Run-time error '-2147024894 (80070002)' -- Automation error -- The system cannot find the file specified." as soon as (it appears) the .NET DLL is called. (EDIT: This may not be the .NET DLL. I've opened an incident with Microsoft for more information from a deep trace.)
Because this is a clean-system test, there were no diagnostic tools installed, but a trace with Sysinternals ProcMon failed to show me something I could recognize.
The question becomes: Is that the right tool to go tracing my obscure little "file not found" error? Are there better tools? What should I be looking for?
But most fundamentally, does anyone know what changes when the display language changes, that would cause either a VB6 EXE or an Interop DLL to fail?
(EDIT) -- I have now tested this with five different display languages; only Turkish is failing.
I bet you have an I (i) in there!
I don't know how you are loading your DLLs, or if you've changed just the UI Thread or the worker threads' culture to Turkish, so I might be off a little, BUT...
Double check any file loads, any paths, and strings of importance etc. If they have an i, I in them, and you are using case operations (to lower, to upper) it will all go wrong with Turkish language.
We had a similar issue with our .net app and it's a pain to fix and go round using a specific culture for some things, but you can't trust to upper or to lower and the turkish language!
good luck.
I cannot account for the source of this error. Instead, after removing an "AMUS" directive from the installer, the error no longer occurs after installation. According to Microsoft's summary of the problem after I did some testing and couldn't reproduce it any longer:
The theory is there was something wrong with your install package (MSI
packaged using InstallShield). You were using the “REINSTALL=AMUS”
install setting which is a dangerous setting because it allows for
‘file downgrades’. Newer files can be overwritten with older versions.
Likely there was a overwritten file with the wrong version and it
failed to load because the dependency was for a newer version.
So... I'm gonna mark this one as answered with this answer, and add a Windows Installer key to the question. Steer clear of "AMUS" when calling Windows Installer...
OK, so we're writing our MFC application to make use of the built-in localization support with satellite DLL's since MFC 7. Everything seem to be working fine, except that my Windows 7 Enterprise Edition install with MUI support and using a Swedish UI instead of an English UI still displays the English UI in our application.
The application uses Swedish as its default language, with an English localization DLL in the form AppNameENU.dll, so MFC is actually intentionally switching to English language under these circumstances, as if it's not caring for the user choice in the MUI-enabled Windows OS, and only the default shipping language of the Windows install?
From the MSDN page on this (the link above), I read it as MFC should actually take these settings into account though, but I'm not 100% sure. Can someone please clarify?
It's because the MFC support for language selection has a design bug: It will decide to load resources from the exe only if no DLL match user OR system language.
In your case: It sets up its (ordered) list of languages as such:
Swedish (User language)
English (System language)
Then it looks up your DLLs (Bug: only the dlls, not the exe!): No match for Swedish. But there's a match for English!
Solution: Use my CLanguageSupport class. It works fine even in your use case.
Feel free to use it. You'll need only a couple of minutes to incorporate it into your app and it uses the exact same DLL scheme as the one you already implemented. (Hint: Don't forget the step where you must get rid of the CWinApp::InitInstance() call!)
In addition, if you are interested (this is optional), you can get an automatic languages menu to let user pick his own preference in case the default is not what he wants.
And if you're looking for a great tool to help you manage your translations, think appTranslator ;-)
HTH,
When downloading both Firefox and Chrome, I've noticed that the default version I got was in my native tongue of Hebrew. I personally don't like my applications in Hebrew, since I'm used to the English UI conventions embedded in me since long ago by:
The lack of choice: Most programs don't offer interfaces in multiple languages and when they do, those languages are usually English and the developer's native tongue.
Programming languages which are almost completely bound to the English language.
My question then is this:
If you translate your applications, would you limit the UI to the user's native tongue or give them the choice by enabling more than one language pack by default?
Which language would your application default to (which is interesting mostly if you only install one language pack with your application)?
And also generally I'd like to know how much value do you put into translating your applications on a whole.
I've helped develop an application that was used by Dutch, English, Spanish and Portuguese speaking users. Because the application installed from CD we just added all the language packs. Mostly because it saved us a lot of work not having to maintain 4 different versions.
If your application distributed from a website and you have to support more than only 4 languages I can imagine you don't want to let everyone download every language pack. But only distributing the native languages of people downloading the application seems a bit restrictive. Most people I know actually like their software in english. So at least adding the english language to all the versions makes sense.
I've never written an application for use by a large number of people, and never for anyone that didn't use English as their language, but if I did, I would probably take a route that installs all available language packs at install (unless the user did a custom install, where I would allow them to choose language packs) and then switch between languages as an option inside the program. If I had to only choose one language, I would choose English if I was doing all of the work, or the native language of the users if I had a translator.
When writing an application for multilingual use, I use Microsoft's Best Practices for Developing World-Ready Applications, which includes retrieving the current CultureInfo from the OS and using that as the default language pack.
I usually try to ship products with all available sets of localized resources. Upon a user's first launch of the product, the UI is presented in the localization most closely matching the OS on their machine. Once within the app, the user has the option of switching the UI to one of the other available localizations.
I think it is very important to provide localizations that match one's target markets. Most "normal" people (not software developers!) prefer by far to have a UI in their native language.