What's the best way to translate your strings?

Get help using Construct 2

Post » Fri Jun 30, 2017 1:14 am

My project is adapted for translations, however I have no idea what's the best way to allow someone to translate my project and then add the translated strings into my project..
B
18
S
6
Posts: 137
Reputation: 1,641

Post » Fri Jun 30, 2017 7:59 am

My suggestion would be:
1) Create a spreadsheet with all of your strings, one column for each language.
2) Copy those strings into a json array file or save the spreadsheet as csv and use a converter tool such as this: http://www.convertcsv.com/csv-to-json.htm , using the "CSV to JSON array" option.
3) If you use the converter you will need to modify the output file slightly so that it's suitable for C2:

{
"c2array":true,
"size":[2,3,1],
"data":[

[ ["english0"], ["french0"], ["german0" ] ],

[ [ "english1"], ["french1" ], ["german1" ] ],

]
}

In this example each row is a new string and each column is a different language.

4) Save this text file as *.json and add it to your project by right clicking on the files icon in the Projects bar and selecting "import files".
5) Add an array object and the AJAX object to your project.
6) Import your json data into the array object by using the AJAX object:

On start of layout: AJAX | Request yourArray.json (tag "yourArray")
AJAX | On "yourArray" completed: Array | Load from JSON string AJAX.LastData

7) All of your strings should now be in the C2 array.
8) You can now set the correct language string by calling it from the array e.g.:

Set text1 to array.At(stringNo,language)
B
16
S
7
G
3
Posts: 395
Reputation: 3,693

Post » Fri Jun 30, 2017 7:11 pm

I will take this method into consideration, thanks. By the way, I don't know what does 'spreadsheet mean, could you explain this to me? 0_0
B
18
S
6
Posts: 137
Reputation: 1,641

Post » Sat Jul 01, 2017 7:46 am

Like Excel or Google sheets.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests