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;
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
add a comment |
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
French is a language, Belgium is a country. That is a very important distinction to make.
– fonZ
Mar 27 at 14:08
add a comment |
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
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
qt localization translation qlocale
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
French is a language, Belgium is a country. That is a very important distinction to make.
– fonZ
Mar 27 at 14:08