Hi everyone - I have a partially translated to english version of the 3.7.4 translation files, as well as some newly acquired knowledge on how to best translate them - with some quirks still to be ironed out.. ;) I'd like to share.
I'm writing in english because - well basically my spanish is very limited and mostly acquired by looking at those translation files... ;)
First the (partially) translated files (for use with Android traductor (Xposed Framework required)) -
strings.xml:
http://pastebin.com/f74zP3ua
arrays.xml:
http://pastebin.com/Z4FBKVhW
-
What I learned so far translating them.
Basically, what you want is to isolate the actual text from the <item> brackets, to put it in an automated translation engine (those have sign limits) - and then back into the actual file structure as quickly as possible - so you can spend more time improving the translation, and checking if the auto translation has messed up the regex in some of the text strings. The last part is maybe the most important, as the auto translation engines out there tend to mess them up - resulting in a file that will ultimately not work (I had strange outcomes, from the translation file not taking at all - to loading album lists not working (and only loading album lists not working) - so you have to be thorough with this).
That said, the "separating the text from the brackets (< >) part" is actually quite easy.
Open your favorite text editor -
- search replace < with cryptic symbol and < (f.e. ö< )
- search replace > with > and cryptic symbol (f.e. >ö )
- search replace öö with ö
- save as .csv (doesnt matter, but its one of the formats google doc supports as an import format for spreadsheets)
- import csv into a google spreadsheet, custom seperation sign - then enter ö there. No other fancy reformat options enabled.
- Add a column on the left of all columns in the spreadsheet - give the top left cell a designation with a number (f.e. item 0001), than drag/autofill that up to the last line - now all rows are "consecutively numbered" in the spread sheet as well.
- for the strings.xml - Sort by the row with the bracket item (f.e. <string name="aa">) left of the first text colum), sort by A-Z, then look for lines with no bracket items (not all lines start with a bracket item) and copy them to the right. Make sure that you also copy the closing bracket item in the row right of the text to the right, if that row has one (some rows that dont start with a bracket item, have one one the end - basically make sure you dont loose that, while coping them to the right). The reason why you want to copy those lines to the right i to have all "text items" in the same column.
- Sort the spreadsheet by the leftmost column (item 0001- item xxxx) > A-Z again, to get the original order of the lines in the spreadsheet back. Double check if you have done this correctly.
- do your translation work (copy/paste to auto translation service, double check that the regex items in the text fields remain the same as before) -- the spreadsheet achitecture is great for this as well - do this on a separate sheet, have the original translation on the left, and the auto translation on the right, then go through them line by line)
- when you are finished, copy the translations in the one column structure in the first sheet.
- export as tabulator seperated file (.tsv)
- open in your favourite text editor
- search replace the empty tab space with nothing
- search replace the numbering designation (item 0001) using a regex (item \d*) with nothing
> which should give you the original file structure back.
In theory.
Because even one little error you made can mess up the integrity of the file. So the next step is to take a working version of strings.xml - and start replacing "a couple of lines" with your translated lines at a time (I recommend about 200-400 at a time). Transfer them to the android device, force kill netease - restart netease, check if it still works and your translations are "taking". Remember to also check if albums are loading correctly from time to time - because as I have said before - I have seen strange behavior there - just because of a mishap in translation (one wrong regex).
If the translation file breaks - try to pin it down to a smaller segment of 60-80 lines, by trial and error replacing with a known good translation file, then go through those lines once more .
Have fun doing this for 2700 lines of code.. ;) (I did 350, then just search replaced the remaining "first page" items for every category - because, time - and hey - as for the rest, learning spanish seems to be easier than replacing 2300 more lines of code.. ;) )
If there is a more straight forward process and I havent found it, please share - also some thoughts on how you could automate this between version changes would be interesting - because the team at neteae seems to love to rescramble and obfuscate, to make this process more difficult than it should be, between two of their releases.
edit: You can respond in spanish, btw. bing (what? ;) ) translate was good enough for me to follow this thread up to this point, so I'm confident, that Ill be able to understand you.