[Plugin] Translation

Post your completed addons to share with the community

Post » Mon Aug 19, 2013 4:52 pm

[Plugin] Translation

1.overview

provide simple translation text from JSON

[HTML5 website] [android, blackberry10, ios, wp8, windows8] [crodova cli] [xdk] [phonegap build service]

Translation.Add from JSON string
then use local language text like this according to selected language: Translation.Text("home_title")

2.download

download

3.function

Add texts from JSON
Language is: Check language code
Language is detected: Language code is detected
Change language: Change language code

Text: expression to get text according to the language.
Language: expression to get language code

JSON string format:
"{
""en"":{
""home_title"":""Block Puzzle"",
""play"":""Play""
},
""ko"":{
""home_title"":""블록 퍼즐"",
""play"":""놀이""
}
}"
Last edited by cranberrygame on Fri Nov 27, 2015 6:51 am, edited 17 times in total.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Tue Aug 20, 2013 6:57 pm

Don't you think you could Implement I10n functions? node-webkit wont work standard browser language, it doesn't get value OS language, it returns en_US as static and default.
B
98
S
35
G
29
Posts: 3,139
Reputation: 28,396

Post » Tue Aug 20, 2013 11:05 pm

Coool :) Thanks for it :)
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

Post » Wed Aug 21, 2013 2:31 am

Joannesalfa, can you give me a peace of advice to get language information in node-webkit?
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Aug 21, 2013 4:16 am

[QUOTE=cranberrygame] Joannesalfa, can you give me a peace of advice to get language information in node-webkit?[/QUOTE]

http://www.scirra.com/forum/nodewebkit-browser-language_topic68718.html
B
98
S
35
G
29
Posts: 3,139
Reputation: 28,396

Post » Wed Aug 21, 2013 12:48 pm

Well, I'm afraid you've reinvented the wheel.
The official browser plugin has had a "Langage" expression for almost forever.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Wed Aug 21, 2013 6:03 pm

Kyatric,
yes, this seems to duplication with Browser Plugin's Language.

but Browser Plugin's Language uses only navigator.language.

so doesn't support bada, blackberry blackberry, windows-phone-8, windows-phone-7, IE ,windows8.

i couldn't give up these other platforms.

probably, official Browser Plugin's Language's support for all platforms will be best solution.

thanks your reply.
cranberrygame2013-08-21 18:04:28
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Aug 21, 2013 6:21 pm

Joannesalfa,

i saw your post.

in node-webkit navigator.language only returns en language code (english).

roughly say, it seems that the function calls c++ lib and the library are called l10n.

i think the best way will be the author's modification or additionn of that library.

i looked for an alternative way and found following. (updated this plugin)

if in node webkit, show "change language menu". (manually change language)

i hope this help you.

thanks
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Thu Aug 22, 2013 6:41 am

Joannesalfa,

updated from "System Is on platform node-wekbit" to BrowserLanguage Is supported if not node-wekbit and pokki(html5website)

thanks
cranberrygame2013-08-23 02:46:58
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Fri Aug 23, 2013 5:53 am

Thanks!

I will check that.
B
98
S
35
G
29
Posts: 3,139
Reputation: 28,396

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests