Detect device language

Get help using Construct 2

Post » Tue Jul 21, 2015 9:53 am

@Edelplastic: Make sure to put all string text between quotes ( "" ).
In your first screenshot you need to check for the value "en-US" not en-US.

Also, instead of "Compare two values: Browser.Language = Browser.language" you can have the action in a "On start of layout" system condition instead.
Comparing if 0 is 0 every frame is not a good habit to take honestly. See how events work.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Fri Feb 12, 2016 12:50 am

I´m back on this. Now i have start a new project and have use this auto-detection again, but now the language not change

Global Variable "language" - Type = text - Initial value = "" (empty)
System -> set variable "language" to Browser.Language
System go to Layout .....

Next Layout:

Variable "language" = "en-US" -> Set animation to frame "0"
Else
Variable "language" = "de-DE" -> Set animation to frame "1"

But it not change the animation frame "0" to "1" (0 is a english picture - 1 is german a german picture)

It also not work when i insert the Variable directly in the Layout where the language "de-DE" is requested. It also not work with "Texts" - What i´m doing wrong?


EDIT:

So, now i have test to use the "en-US" for the german pictures and when i say "variable "language" = "en-US" then the picture frame change to the german texts. I think Node Webkit do not detect the Language-Codes...
B
8
S
2
Posts: 53
Reputation: 687

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests