View Single Post
Old 04-05-2010, 10:19 AM   #1
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Change Language with firmware v.1.4.0.23260 and modified PRS+

  1. this is based on kartu’s (and his ancestors) excellent work, Code version form March 14, r32a8553af7 (http://code.google.com/p/prs-plus/)
  2. this is done for academic and educational purpose only
  3. Starting an new thread to not disturb “Enhanced firmware for PRS 505, Books by Folder, Sudoku & more“ at https://www.mobileread.com/forums/showthread.php?t=64510
  4. accordingly patched applicationStart.xml and main.xml files have to be prepared and integrated in the firmware to use this addon
  5. limited to none support is granted

Surprisingly enough only two small changes in code are necessary to enable PSR+ fully on a non 1.1.0.18040 version.

First thing is, that it is not save to write to the title property of an cloned ContainerNode object.
So I introduced a new property _mytitle1, which is solely used in ChangeLang.js and can otherwise be omitted.

core_ui.js had to be patched at line
Code:
135   if (arg.hasOwnProperty("title")) {obj.title = arg.title;}
to	if (arg.hasOwnProperty("title")) {obj._mytitle1 = arg.title;} //for v1.4
The other reference is in BrowseFolders.js
Code:
269  this.title = this.name;
changed to 
     this._mytitle1 = this.name; // changed for v1.4
This done I was looking for a way to enable the “build in” language selection.

Thus I came to the following addon:
ChangLang.js (see attachment)
which allows to change the language of the UI on the fly between the tree build in languages, Enlish, French and German.

Things to mention:
  1. German “Umlaute” for the UI have to be escaped to UTF-8 and to be decoded with decodeURI()
    [Edit 2010-04-10] This is not true! But you have to make sure, that your code-editor saves in UTF-8!
    Mine used "Windows 1252: Western European", leading me to the above solution, to get it displayed right on the PRS 505 screen.
    With a correct configured editor, you can simply type in the symbols. [/Edit]
  2. kbook.root.nodes[i].title’s are translated after kbook.model.container.changeLanguage(lang) call but the kbook.root.nodes[i].name property which is obviously use to display the menu entries isn’t. So it had to be changed by code. And there is where _mytitel1 for PRS+ entities comes handy.
  3. by adding <kbookLanguage> entrys to main.xml and supplying the according "kbookLanguageAssets_??-??.xml" files additional languges are possible to integrate.
    [Edit 2010-04-10] Proofed by adding a Spanish translation, derived from the spanish PRS+ translation by surquizu and VICTORSJG. Hope this is OK for you guys.
    Hint: Double check the xml file for syntax, flashing a missformated file bricks your reader, even if the language isn't ever used!
    [/Edit]
Attached Thumbnails
Click image for larger version

Name:	2010-4-5.jpg
Views:	822
Size:	58.9 KB
ID:	49230   Click image for larger version

Name:	2010-4-5_0.jpg
Views:	718
Size:	61.5 KB
ID:	49231   Click image for larger version

Name:	2010-4-10.jpg
Views:	638
Size:	58.7 KB
ID:	49588   Click image for larger version

Name:	2010-4-10_0.jpg
Views:	803
Size:	59.1 KB
ID:	49589  
Attached Files
File Type: rar ChangeLang.rar (1.1 KB, 623 views)
File Type: xml kbookLanguageAssets_es-ES.xml (12.3 KB, 582 views)

Last edited by Mark Nord; 04-10-2010 at 10:40 AM.
Mark Nord is offline   Reply With Quote