x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Can I get Country Code?? like US, DE ...

I want get country code( like us, de, jp, kr ...). so I try using FInternationalization function.

run below codes.

 FString GetName = FInternationalization::Get().GetCurrentCulture()->GetName();
 FString NativeRegion = FInternationalization::Get().GetCurrentCulture()->GetNativeRegion();
 FString NativeName = FInternationalization::Get().GetCurrentCulture()->GetNativeName();
 FString EnglishName = FInternationalization::Get().GetCurrentCulture()->GetEnglishName();
 FString Region = FInternationalization::Get().GetCurrentCulture()->GetRegion();
 UE_LOG(LogTemp, Warning, TEXT( " :.. [%s, %s, %s, %s, %s ]"), *GetName, *NativeRegion, *NativeName, *EnglishName, *Region);

result

 mobile (iOS , Android)
 :.. [en, , English, English,  ]
 
 Mac UE-Editor
 :.. ko-KR 대한민국 한국어(대한민국) Korean (South Korea) KR

I can't get country code with FInternationalization::Get().GetCurrentCulture()->GetRegion(); on mobile device.

Is there any way to get country code? (with UE Cpp, without Native Code(java, obj-c))...

Product Version: UE 4.11
Tags:
more ▼

asked Jul 14 '16 at 12:21 PM in C++ Programming

avatar image

sangpan On 에픽
37 6 14 18

avatar image sangpan On 에픽 Jan 05 '17 at 09:05 AM

Anybody dosen't know that..

so I try to add JNI, etc.. get country code myself.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first
 #if PLATFORM_IOS
     FIOSPlatformMisc::GetDefaultLocale();
 #elif PLATFORM_ANDROID
     FAndroidMisc::GetDefaultLocale();
 #else
     FGenericPlatformMisc::GetDefaultLocale();
 #endif


GetDefaultLocale API provide Language & Region Code.

Like en-US

more ▼

answered Mar 10 '17 at 08:12 AM

avatar image

sangpan On 에픽
37 6 14 18

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question