Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HELP! How to code ActionScript 3.0 replace text using system language

Explorer ,
Oct 11, 2022 Oct 11, 2022

<superfluous screenshot remove-kglad>

for example :

 

stage.addEventListener(Event.ENTER_FRAME, usingSystemLanguage)
function usingSystemLanguage(event:Event):void
{
	if(*Current Windows/Mac System Language*)
	{
		textExampler.text = "This text using your system language (id)";
	}
	else
	{
		textExampler.text = "This text using your system language (en)";
	}
}

 

TOPICS
ActionScript , Code
780
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

LEGEND , Oct 13, 2022 Oct 13, 2022

This article shows how to use Capabilites.language:

https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html#languages

Here is an example from that page:

var lang:String = Capabilities.language;
   switch (lang) {
     case "en":
          myTextField.text = greetingEnglish;
          break;
     case "de":
          myTextField.text = greetingGerman;
          break;
     case "fr":
          myTextField.text = greetingFrench;
          break;
     case
...
Translate
Explorer , Oct 14, 2022 Oct 14, 2022

my current language is "id" (indonesia), can you find a way to make?

Translate
Community Expert ,
Oct 11, 2022 Oct 11, 2022

what kind of as3 project?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 12, 2022 Oct 12, 2022

Adobe AIR

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2022 Oct 13, 2022

This article shows how to use Capabilites.language:

https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html#l...

Here is an example from that page:

var lang:String = Capabilities.language;
   switch (lang) {
     case "en":
          myTextField.text = greetingEnglish;
          break;
     case "de":
          myTextField.text = greetingGerman;
          break;
     case "fr":
          myTextField.text = greetingFrench;
          break;
     case "es":
          myTextField.text = greetingSpanish;
          break;
          default:
          myTextField.text = "Sorry your system's language is not supported at this time.";               
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 14, 2022 Oct 14, 2022

my current language is "id" (indonesia), can you find a way to make?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 14, 2022 Oct 14, 2022

'id' is the country code for Indonesia. 'in' is the language code for Indonesian. You could try those, but I am pretty sure it's not included.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 14, 2022 Oct 14, 2022

when i code :

var thisIsMyLanguage:String = Capabilities.language;
trace (thisIsMyLanguage);

and pressing "Test", the output is "xu". Please watch this picture

itz_faizalarsh_0-1665796432301.pngexpand imageitz_faizalarsh_3-1665796489252.pngexpand image

itz_faizalarsh_4-1665796572418.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 14, 2022 Oct 14, 2022

and?  do you have a question?  did you check the link i posted that explains what that (and much more) means?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 15, 2022 Oct 15, 2022
LATEST

As you will see at the link kglad gave, 'xu' is the code for all languages that are not known.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 14, 2022 Oct 14, 2022
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines