QLocale Get real language nameCoding in Other (Spoken) LanguagesHow to use localization in C#QLocale, what is the scope of the global QLocale::setDefault()?Get the current language in deviceAndroid: how to get the current day of the week (Monday, etc…) in the user's language?manual language selection in an iOS-App (iPhone and iPad)Country and language code detectingGetting country code for QLocale::CountryHow to find current QLocale in Qt/PyQt/PySide?Qt get langauge name in it's native form

How do campaign rallies gain candidates votes?

Why did NASA use U.S customary units?

Is it legal for private citizens to "impound" e-scooters?

How can I stop myself from micromanaging other PCs' actions?

What is the difference between $path and $PATH (lowercase versus uppercase) with zsh?

High income, sudden windfall

Inadvertently nuked my disk permission structure - why?

What was the rationale behind 36 bit computer architectures?

Memory capability and powers of 2

What is the meaning of "you has the wind of me"?

Why do websites not use the HaveIBeenPwned API to warn users about exposed passwords?

How were the LM astronauts supported during the moon landing and ascent? What were the max G's on them during these phases?

Invert Some Switches on a Switchboard

What to do when you reach a conclusion and find out later on that someone else already did?

How can I create a shape in Illustrator which follows a path in descending order size?

Keeping an "hot eyeball planet" wet

Moving files accidentally to an not existing directory erases files?

Can two figures have the same area, perimeter, and same number of segments have different shape?

USA: Can a witness take the 5th to avoid perjury?

No-cloning theorem does not seem precise

Why do people say "I am broke" instead of "I am broken"?

Are gangsters hired to attack people at a train station classified as a terrorist attack?

What is the purpose of the fuel shutoff valve?

Do I need another Schengen Visa



QLocale Get real language name


Coding in Other (Spoken) LanguagesHow to use localization in C#QLocale, what is the scope of the global QLocale::setDefault()?Get the current language in deviceAndroid: how to get the current day of the week (Monday, etc…) in the user's language?manual language selection in an iOS-App (iPhone and iPad)Country and language code detectingGetting country code for QLocale::CountryHow to find current QLocale in Qt/PyQt/PySide?Qt get langauge name in it's native form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a language code like fr_fr, fr_be.
I would like to get French and Belgium using QLocale, but I can't find how to do it.
I did:



QLocale locale("fr_fr"); // or fr_be
QString l = locale.languageToString(locale.language()); //returns French in both cases









share|improve this question






















  • French is a language, Belgium is a country. That is a very important distinction to make.

    – fonZ
    Mar 27 at 14:08

















0















I have a language code like fr_fr, fr_be.
I would like to get French and Belgium using QLocale, but I can't find how to do it.
I did:



QLocale locale("fr_fr"); // or fr_be
QString l = locale.languageToString(locale.language()); //returns French in both cases









share|improve this question






















  • French is a language, Belgium is a country. That is a very important distinction to make.

    – fonZ
    Mar 27 at 14:08













0












0








0








I have a language code like fr_fr, fr_be.
I would like to get French and Belgium using QLocale, but I can't find how to do it.
I did:



QLocale locale("fr_fr"); // or fr_be
QString l = locale.languageToString(locale.language()); //returns French in both cases









share|improve this question














I have a language code like fr_fr, fr_be.
I would like to get French and Belgium using QLocale, but I can't find how to do it.
I did:



QLocale locale("fr_fr"); // or fr_be
QString l = locale.languageToString(locale.language()); //returns French in both cases






qt localization translation qlocale






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 16:08









SteveTJSSteveTJS

2667 silver badges24 bronze badges




2667 silver badges24 bronze badges












  • French is a language, Belgium is a country. That is a very important distinction to make.

    – fonZ
    Mar 27 at 14:08

















  • French is a language, Belgium is a country. That is a very important distinction to make.

    – fonZ
    Mar 27 at 14:08
















French is a language, Belgium is a country. That is a very important distinction to make.

– fonZ
Mar 27 at 14:08





French is a language, Belgium is a country. That is a very important distinction to make.

– fonZ
Mar 27 at 14:08












1 Answer
1






active

oldest

votes


















3














Your are querying the language name, that is French in both cases. Maybe you want to get the country name like this:



QLocale locale("fr_be");
QString l = locale.countryToString(locale.country());


Read here for more information.






share|improve this answer























  • It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

    – SteveTJS
    Mar 27 at 8:17






  • 2





    @SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

    – Gabriella Giordano
    Mar 27 at 10:54










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361592%2fqlocale-get-real-language-name%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Your are querying the language name, that is French in both cases. Maybe you want to get the country name like this:



QLocale locale("fr_be");
QString l = locale.countryToString(locale.country());


Read here for more information.






share|improve this answer























  • It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

    – SteveTJS
    Mar 27 at 8:17






  • 2





    @SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

    – Gabriella Giordano
    Mar 27 at 10:54















3














Your are querying the language name, that is French in both cases. Maybe you want to get the country name like this:



QLocale locale("fr_be");
QString l = locale.countryToString(locale.country());


Read here for more information.






share|improve this answer























  • It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

    – SteveTJS
    Mar 27 at 8:17






  • 2





    @SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

    – Gabriella Giordano
    Mar 27 at 10:54













3












3








3







Your are querying the language name, that is French in both cases. Maybe you want to get the country name like this:



QLocale locale("fr_be");
QString l = locale.countryToString(locale.country());


Read here for more information.






share|improve this answer













Your are querying the language name, that is French in both cases. Maybe you want to get the country name like this:



QLocale locale("fr_be");
QString l = locale.countryToString(locale.country());


Read here for more information.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 17:17









Gabriella GiordanoGabriella Giordano

8604 silver badges9 bronze badges




8604 silver badges9 bronze badges












  • It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

    – SteveTJS
    Mar 27 at 8:17






  • 2





    @SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

    – Gabriella Giordano
    Mar 27 at 10:54

















  • It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

    – SteveTJS
    Mar 27 at 8:17






  • 2





    @SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

    – Gabriella Giordano
    Mar 27 at 10:54
















It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

– SteveTJS
Mar 27 at 8:17





It gives good results in cases like fr_fr, fr_be, France and Belgium even if I would prefer French and Belgian. But with ca_es and es_es, I get Spain for both but I would expect Catalan and Spanish.

– SteveTJS
Mar 27 at 8:17




2




2





@SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

– Gabriella Giordano
Mar 27 at 10:54





@SteveTJS I see. The problem is that some countries like Belgium have several official languages (French, German and Dutch) but none of them is "native" for that area. Others like Spain have more than one "native" language, like Spain where they have both Catalan and Spanish. So, many times you will not have a unique binding between a country and a language. My suggestion is to use both the name of the language and the name of the country provided by the QLocale class in order to resolve any ambiguity.

– Gabriella Giordano
Mar 27 at 10:54








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361592%2fqlocale-get-real-language-name%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript