Search found 78 matches
- Sun Feb 09, 2020 8:09 pm
- Forum: C++ Development
- Topic: How to change language at runtime
- Replies: 8
- Views: 889
How to change language at runtime
My application can change language at runtime. You can use the interface in English, then you can click the English flag and select German, and continue to use the interface in German. You can switch back and forth between languages at runtime like that. The way my application is currently coded, th...
- Sun Feb 09, 2020 4:52 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
- Sat Feb 08, 2020 8:47 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Re: Read from input iterator (wxResourceTranslationsLoader)
The conversion from in-memory data to wxMsgCatalog looks a little complicated. The member function "CreateFromData" takes a wxScopedCharBuffer. Later when I'm sitting at a PC, I'll take a closer look at this: https://docs.wxwidgets.org/3.0/classwx_scoped_char_type_buffer.html It looks like I'll be ...
- Sat Feb 08, 2020 6:15 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Re: Read from input iterator (wxResourceTranslationsLoader)
I'm also working on a Makefile that will automatically process all your ".mo" files into char arrays before your application is compiled. So if you ever change a translation catalogue, you just need to hit "make" and it will automatically re-process all your ".mo" files into char arrays before your ...
- Sat Feb 08, 2020 6:11 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Re: Read from input iterator (wxResourceTranslationsLoader)
Note that you can get this to read from any kind of input stream by using "std::istream_iterator". Here's how you'd get it to read from standard input: wxTranslationsLoader *const p = new wxInputIteratorTranslationsLoader< std::istream_iterator<char unsigned> >; p->MakeCatalogueVisible( wxT("de"), i...
- Sat Feb 08, 2020 5:47 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Re: Read from input iterator (wxResourceTranslationsLoader)
I did this on my smartphone in a coffee shop so don't go too hard on me. I haven't tried to compile it. Here is the beginnings of wxInputIteratorTranslationsLoader: #include <vector> #include <tuple> #include <iterator> template<typename InputIterator> class wxInputIteratorTranslationsLoader : publi...
- Sat Feb 08, 2020 4:48 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Re: Read from input iterator (wxResourceTranslationsLoader)
Here's the code from wxResourceTranslationsLoader that I will be adapting: wxMsgCatalog *wxResourceTranslationsLoader::LoadCatalog(const wxString& domain, const wxString& lang) { const void *mo_data = NULL; size_t mo_size = 0; const wxString resname = wxString::Format("%s_%s", domain, lang); if ( !w...
- Sat Feb 08, 2020 3:01 pm
- Forum: C++ Development
- Topic: Read from input iterator (wxResourceTranslationsLoader)
- Replies: 8
- Views: 737
Read from input iterator (wxResourceTranslationsLoader)
I want to be able to embed my translation catalog (.mo) files in my binary executable by having the .mo files as global byte arrays like this: char unsigned const g_catalog_german[] = {0x01,0x02,0x03,0x04}; The command line program "xxd" can be used to easily turn a binary file into a sequence of he...
- Fri Feb 07, 2020 9:05 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
Re: Multilingual application (without locales or internationalisation)
I will distribute my application as one executable file that does not need to be installed
- Fri Feb 07, 2020 7:41 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
Re: Multilingual application (without locales or internationalisation)
The language discussion aside... I still do not get why you wish to abandon the true and tried way of storing translations catalogues, i.e., in the expected folder with folders for individual languages (btw, the domain is not a language ). It works as expected out of the box and can be used without...
- Fri Feb 07, 2020 6:18 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
- Fri Feb 07, 2020 4:43 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
Re: Multilingual application (without locales or internationalisation)
Hi, And Mexican with Spanis? Did you consider the language differences? One word can have a different meaning in different dialects... Thank you. There is no limit to how far you can go with that. People who live on one street in a housing estate might use different words to people who live across ...
- Fri Feb 07, 2020 3:59 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
Re: Multilingual application (without locales or internationalisation)
Just remember that "de_DE" will contain German German translations and "de_SWITZERLAND" (sorry don't know the country code on top of my head) will contain German Swiss translations. How will you program will differentiate between them? The German-speaking Swiss will make do with "de". There won't b...
- Fri Feb 07, 2020 3:57 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213
Re: Multilingual application (without locales or internationalisation)
And finally - the number presentation. How do you read the number "123.560"? I would "One hundred twenty three and fifty six hundredth". But in some other country it can be read as "One hundred thousands twenty three Five hundred sixty". Guess what - you program will produce faulty results, brcause...
- Fri Feb 07, 2020 3:36 pm
- Forum: C++ Development
- Topic: Multilingual application (without locales or internationalisation)
- Replies: 30
- Views: 2213