03-04-2014 09:05 PM
Looking for way to populate a dropdown with all the language locales. Dropdown would be similar to the one found on the Language and Input setting screen.
Any pointers is appreciated
03-06-2014 10:37 AM
03-06-2014 10:16 PM - edited 03-06-2014 10:16 PM
Don't need it for translation I need the ability for the user to select the language representation related to a data entry which will reside in the local DB. So each entry can be for a different languages, thus why the language selection dropdown comes in handy.
Since BB must have the core languages table stored in the OS, it would be nice if I can fetch these language directly from the OS. Want to avoid maintaning my own langage DB.
03-08-2014 03:42 AM
I've been searching on and off for an answer to this since you posted and the best I've found so far is to scan the locale folder or use the defines, I haven't been able to find any OS api for this.
03-08-2014 09:01 AM
03-10-2014 06:39 AM
After doing a little more searching mainly in the header files it looks like QLocale.h contains a comprehensive list and some functions to access string literals as well...
Do you intend to offer the list in the current locale language?
Seems like a lot of work to me, hope it's worth it.
03-10-2014 07:51 PM
My app is only offered in english @ this point. Maybe in the future but for now, I would go with one language.
I'm a C# developper from background. For enums, via C# I usually loop through the set of enum values and use reflection to extract the value and text representation. Is there a similar fonctionality with C++ ? (Still learning C++)
Ideally, the dropdown would be constructed using Country Name has the Option text and it's value would contain the Language Code (ie: en_us, en_ca)
I just look @ the reference class quickly, but I haven't seen any method / property that spits out the Language Code, will need to further investigation later this week.
Thanks for the pointer... you rock BBSJev
03-11-2014 07:02 AM
03-11-2014 02:23 PM
NP, might not have a complete solution, but at least the concept is a start. I will be digging into this later, I'll put that data field on hold for now, it's not a show stopper. If I can come up with some sort of solution, might be a good control to push on GitHub.