Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2012, 05:02 AM   #256
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
I have a problem report from user of Russian localization.
He has the same problem as I had (white home applet, only uppermost bar in place). What's strange is that he used the version that works on my device and several more people already installed it and it worked on their devices, too.

He extracted the logs (could be found here: http://narod.ru/disk/39647826001/log.rar.html)

Here's what I found suspicious in those:
Code:
111001:000320 appmgrd[840]: I appmgr_history:NEW_APP:lipcId=com.lab126.booklet.home:
111001:000320 appmgrd[840]: E lipc:dbuserr:name=org.freedesktop.DBus.Error.ServiceUnknown:Receive Dbus error message (DBUS_MESSAGE_TYPE_ERROR): The name com.lab126.booklet was not provided by any .service files
111001:000320 appmgrd[840]: E appmgr_lipc:lipc_set_prop_fail:lipc_status=3,app=com.lab126.booklet,property=run,uri=com.lab126.booklet.home:send app command
111001:000320 appmgrd[840]: E appmgr_history:lipc_set_prop_fail:status=3,executable_lipc=com.lab126.booklet,app_uri=app://com.lab126.booklet.home/?context=0:
111001:000322 powerd[838]: I def:homebutton::Home button pressed
111001:000324 appmgrd[840]: I appmgr_history:FOUND_APP:lipcId=com.lab126.booklet.home:
111001:000324 appmgrd[840]: E lipc:dbuserr:name=org.freedesktop.DBus.Error.ServiceUnknown:Receive Dbus error message (DBUS_MESSAGE_TYPE_ERROR): The name com.lab126.booklet.home was not provided by any .service files
111001:000324 appmgrd[840]: E appmgr_lipc:lipc_set_prop_fail:lipc_status=3,app=com.lab126.booklet.home,property=go,uri=0:app://com.lab126.booklet.home/?context=0:send app command
111001:000324 appmgrd[840]: W appmgr_history:application_state_error:lipc_id=com.lab126.booklet.home,expected=PAUSED,actual=UNKNOWN:Application not in expected state, re-loading
111001:000324 appmgrd[840]: E lipc:dbuserr:name=org.freedesktop.DBus.Error.ServiceUnknown:Receive Dbus error message (DBUS_MESSAGE_TYPE_ERROR): The name com.lab126.booklet was not provided by any .service files
He says his device is 5.0.1, no SO.
ixtab, anyone, any ideas?
JustAMan is offline   Reply With Quote
Old 02-05-2012, 05:48 AM   #257
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by JustAMan View Post
I have a problem report from user of Russian localization.
He has the same problem as I had (white home applet, only uppermost bar in place). What's strange is that he used the version that works on my device and several more people already installed it and it worked on their devices, too.
Code:
grep 'ota_monitor:addUpdate:updatefile\|update:begin\|update:success\|cvm[[[:digit:]]\+]: E.*Exception' all_system_logs_as_of_Sat_Oct_1_23.06.17_GMT-01.27_2011.txt
Output:
Spoiler:
Code:
111001:000622 ota[856]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_locale-base+ui_uninstall.bin:
111001:000622 ota[856]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_5.0.0-20120202-ru_RU_install.bin:
111001:000002 ota[841]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_locale-base+ui_uninstall.bin:
111001:000003 ota[841]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_5.0.0-20120202-ru_RU_install.bin:
111001:000449 ota[841]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_5.0.0-20120202-ru_RU_install.bin:
111001:000449 ota[841]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_locale-base+ui_uninstall.bin:
111001:000002 ota[844]: I ota_monitor:addUpdate:updatefile=/mnt/us/uninstall.bin:
111001:000238 ota[844]: I ota_monitor:addUpdate:updatefile=/mnt/us/uninstall.bin:
111001:000019 cvm[1397]: E WanControllerImpl:LipcException:err-code=3:
111001:000019 cvm[1397]: E WirelessImpl:LipcException:err-code=3:
111001:000019 cvm[1397]: E WirelessImpl:LipcException:err-code=3:
111001:000033 cvm[1397]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:000036 cvm[1397]: E ChromeImplementation:ExceptionCaught::Exeption caught in search bar button callback
111001:000038 cvm[1397]: E ChromeImplementation:ExceptionCaught::Exeption caught in search bar button callback
111001:000558 cvm[1397]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000635 cvm[1397]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000638 cvm[1397]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000641 cvm[1397]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000648 cvm[1397]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000822 cvm[1397]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:001128 cvm[1397]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:090902 cvm[1397]: E IndexerThread:ExceptionCaught::PERFORM_CLEANUP
111001:000019 cvm[1416]: E WanControllerImpl:LipcException:err-code=3:
111001:000019 cvm[1416]: E WirelessImpl:LipcException:err-code=3:
111001:000019 cvm[1416]: E WirelessImpl:LipcException:err-code=3:
111001:000032 cvm[1416]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:000356 cvm[1416]: E ChromeImplementation:ExceptionCaught::Exeption caught in search bar button callback
111001:000359 cvm[1416]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000403 cvm[1416]: E ChromeImplementation:ExceptionCaught::Exeption caught in search bar button callback
111001:000412 cvm[1416]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000412 cvm[1416]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000412 cvm[1416]: E EventQueueExceptionHandler:ExceptionCaught::
111001:000020 cvm[1501]: E WanControllerImpl:LipcException:err-code=3:
111001:000021 cvm[1501]: E WirelessImpl:LipcException:err-code=3:
111001:000021 cvm[1501]: E WirelessImpl:LipcException:err-code=3:
111001:000033 cvm[1501]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:000040 cvm[1501]: E ChromeImplementation:ExceptionCaught::Exeption caught in search bar button callback
111001:000304 cvm[1501]: E BookletImplementation:CallbackException:callback=onUIContainerStateChange:
111001:000324 cvm[1501]: E TransferServiceImpl:RequestFailed:requestType=cleanupOrphanedTransfers,id=-1,key=null,errorCode=3,errorMessage=scannerLipcException:Cleanup orphan request warning, Lipc exception
111001:000016 cvm[1185]: E WanControllerImpl:LipcException:err-code=3:
111001:000016 cvm[1185]: E WirelessImpl:LipcException:err-code=3:
111001:000016 cvm[1185]: E WirelessImpl:LipcException:err-code=3:
110930:224820 ota[839]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_simple_usbnet_1.1_install.bin:
110930:223316 cvm[1195]: E WanControllerImpl:LipcException:err-code=3:
110930:223316 cvm[1195]: E WirelessImpl:LipcException:err-code=3:
110930:223316 cvm[1195]: E WirelessImpl:LipcException:err-code=3:
110930:224117 ota[851]: I ota_monitor:addUpdate:updatefile=/mnt/us/update-kt-install-keyboard-ru-2012.01.12.00.bin:
110930:224239 system: I update:begin:bin=/mnt/us/update-kt-install-keyboard-ru-2012.01.12.00.bin:update started
110930:224241 system: I update:success::
110930:223316 cvm[1182]: E WanControllerImpl:LipcException:err-code=3:
110930:223317 cvm[1182]: E WirelessImpl:LipcException:err-code=3:
110930:223317 cvm[1182]: E WirelessImpl:LipcException:err-code=3:
110930:233905 ota[838]: I ota_monitor:addUpdate:updatefile=/mnt/us/update_simple_usbnet_1.1_install.bin:
110930:234008 cvm[1182]: E PlayerImpl:LipcException:err-code=3:
110930:234008 cvm[1182]: E TTSServiceImpl:TTSServiceImpl_AudioException:err-code=289:initTTSDaemon - Exception when starting audio
110930:234224 system: I update:begin:bin=/mnt/us/update_simple_usbnet_1.1_install.bin:update started
110930:234227 system: I update:success::
110930:223316 cvm[1201]: E WanControllerImpl:LipcException:err-code=3:
110930:223317 cvm[1201]: E WirelessImpl:LipcException:err-code=3:
110930:223317 cvm[1201]: E WirelessImpl:LipcException:err-code=3:

Conclusions:
  • unfortunately, log has been dumped too late and it doesn't provides information about the exact localization bundle, which has been applied before errors had been appeared (though, this information should still be contained in rotated previous log),
  • while some cvm exceptions could be interpreted as harmless (LipcExceptions, exceptions from TTSServiceImpl and IndexerThread), most of others should be the cause of "white home screen without working Menu button" state.

Last edited by eureka; 02-05-2012 at 05:53 AM. Reason: rewording of conclusion about log dumping moment
eureka is offline   Reply With Quote
Advert
Old 02-05-2012, 01:22 PM   #258
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
I'm currently working on localizing JS ru_RU stuff, and I've included it into my "checkit.py" tool to allow combine/expand for easier editing.

While reading & translating the resulting file I found something that should really be blacklisted - there're many CSS styles (or part of styles) out there! I don't think it would benefit the end user if a translator (say, not knowing HTML/CSS at all) translates things like "{width}px" to {width}something".

I can include this to checkit.py report/blacklist actions (currently only combine/expand actions are aware of JS files).
JustAMan is offline   Reply With Quote
Old 02-05-2012, 05:57 PM   #259
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
eureka,
Your fix to js compilation of media player isn't complete
See screenshot. However it might be not your fault, but Amazon's... I cannot find where this MessageFormat stuff is defined, so it might even be built-in which would be bad...


And could anyone tell me where this "Off" button resides? I think I saw it as a picture, so could be hard to translate, but feel free to prove me wrong.

BTW, I have an issue with USB plug screen containing no text at all, and the same issue reported by other users of ru_RU locale. Any ideas?

UPD
A bit of searching lead me to conclusion that they might be using MessageFormat class from icu4.jar:com.ibm.icu.text. If that class has a bug translating UTF-8 text to displayed text then translation of this element in non-latin encoding might be doomed... unless we patch this class

Last edited by JustAMan; 02-05-2012 at 06:08 PM. Reason: update
JustAMan is offline   Reply With Quote
Old 02-06-2012, 10:12 AM   #260
pportnawak
Member
pportnawak began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jan 2012
Device: kindle touch
hello,

i applied the localisation hack, but now my keyboard is gone ... when i try to to access a page with go to page number i didn't have a pad but noting and i cannot type a umber.
is there a original keyboard available ?

even if i desinstall all i didn't have this keyboard bak.

regards.
pportnawak is offline   Reply With Quote
Advert
Old 02-06-2012, 10:26 AM   #261
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
What firmware version do your device have? SO/no SO? What files did you install (for what language)?
We don't have telepathic skills, you know... I'm currently working on developing them, but progress is so slow...
JustAMan is offline   Reply With Quote
Old 02-06-2012, 11:27 AM   #262
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by JustAMan View Post
While reading & translating the resulting file I found something that should really be blacklisted - there're many CSS styles (or part of styles) out there! I don't think it would benefit the end user if a translator (say, not knowing HTML/CSS at all) translates things like "{width}px" to {width}something".
OK, that string in pillow/en_US/strings/media_player_bar_strings.properties with a bit of CSS will be blacklisted.

Quote:
Originally Posted by JustAMan View Post
eureka,
Your fix to js compilation of media player isn't complete
See screenshot. However it might be not your fault, but Amazon's... I cannot find where this MessageFormat stuff is defined, so it might even be built-in which would be bad...


And could anyone tell me where this "Off" button resides? I think I saw it as a picture, so could be hard to translate, but feel free to prove me wrong.

BTW, I have an issue with USB plug screen containing no text at all, and the same issue reported by other users of ru_RU locale. Any ideas?

UPD
A bit of searching lead me to conclusion that they might be using MessageFormat class from icu4.jar:com.ibm.icu.text. If that class has a bug translating UTF-8 text to displayed text then translation of this element in non-latin encoding might be doomed... unless we patch this class
Try new version of js_resources tool. This quirk with wrong encoding of message could be fixed.

No messages at blanket part (USB plug screen etc.) possibly means lack of ru_RU locale definition. Sorry, can't say for sure, KT is far away from me.

And any Java class isn't caused that garbled string. (Pillow HTML/JS rendering is handled by Webkit engine, not by JVM). It's most probably (as I've said) bug in js_resources tool, when it outputs string in wrong encoding (i.e. not UTF-8).

BTW, I've commited some sanitizing of HTML in JS resources. Now it escapes all tags except <br>, <p>, <a> and strips all attributes from any of these whitelisted tag. It is based on html5lib sanitizer and customized with adding of sanitized prefix to escaped tag and with custom handling of named HTML entities in text (so &nbsp; occured in resources isn't replaced by Unicode character). html5lib includes (and uses) full-featured HTML parser, so it should be safer than regexp-based approach or any other simple parser (like Python's bundled SGMLParser or HTMLParser).

Example:
source: test<script type="text/javascript">alert('pwned!');</script><br><p>simple paragarph</p><p title="p_title" prop='wtf'>paragraph&nbsp;with attribute<a href="javascript:alert('pwned too!')">click me!</a></p><b>bold text</b>

result: test&lt;sanitizedscript type="text/javascript"&gt;alert('pwned!');&lt;/sanitizedscript&gt;<br><p>simple paragarph</p><p>paragraph&nbsp;with attribute<a>click me!</a></p>&lt;sanitizedb&gt;bold text&lt;/sanitizedb&gt;

But still, it is dangerous to include JS resources in automated build of localization bundles. There are some URLs in them (like default bookmarks in browser or search URLs in browser) which also could be misused... I have to blacklist all URLs from JS resources.
eureka is offline   Reply With Quote
Old 02-06-2012, 11:53 AM   #263
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
I think we may safely blacklist ALL bookmarks - they aren't appearing on the Kindle anyway

As for media player... I think you're wrong.
My media_player_bar_string.js is in UTF-8, and constructor gets its arguments in UTF-8.

This "MessageFormat" thing isn't handled by Webkit I suppose, seems like it's handled by that icu4.jar file I pointed at above.

However I'll try your new tool this night and we'll see if it helps with media player or not.
JustAMan is offline   Reply With Quote
Old 02-06-2012, 12:42 PM   #264
flat_eric
Junior Member
flat_eric began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch
Hi, I worked on the italian translation...
I have a problem, once I switched to italian on the Kindle I can't access the View Notes & Marks pages of a book from Menu...
Sometimes I see "View..." and if I select it, it shows me a selection window where I can choose All Notes & Marks, Your Notes & Marks and so on (like if I'm already in pages whit all the notes listed); sometimes I see View Notes & Marks (the menu item that should bring me to those pages)...
Of course, I see these words translated, but it seems it can't bring me to the correct page...
My Kindle is running 5.0.3 firmware and of course is already JB.
Any idea?

Sorry for my bad english...
Thank you.
flat_eric is offline   Reply With Quote
Old 02-06-2012, 01:02 PM   #265
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
Try typing ";dm" into search bar and looking for logs into Kindle's document directory. That might give you some insight for what you translated wrong (like over-translated something).

You could also run my report tool (from git repository) and check Italian report.
JustAMan is offline   Reply With Quote
Old 02-06-2012, 06:47 PM   #266
flat_eric
Junior Member
flat_eric began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch
Quote:
Originally Posted by JustAMan View Post
Try typing ";dm" into search bar and looking for logs into Kindle's document directory. That might give you some insight for what you translated wrong (like over-translated something).

You could also run my report tool (from git repository) and check Italian report.
I attached a zip with the logs generated from ";dm" command but it's all greek to me...
About the tool, I didn't downloaded the whole repository, just helped on Transifex repository the italian translation...
I would like to be more helpful but in this case you should guide me... sorry I'm a newbie...
Attached Files
File Type: zip documents.zip (252.3 KB, 188 views)
flat_eric is offline   Reply With Quote
Old 02-08-2012, 12:24 PM   #267
pportnawak
Member
pportnawak began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jan 2012
Device: kindle touch
sorry .. for not saying that ...
it's kindle touch with adds 5.03 with launcher and rotate.
nothing else.
TIA
regards,
pportnawak is offline   Reply With Quote
Old 02-09-2012, 02:07 PM   #268
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Alright folks, I'm back. Sorry for having been quiet for so long, I was offline for some time because of something personal.

Anyway, I'm trying to catch up on the discussion.

@JustAMan: Bookmarks are displayed in the browser, at least for me. I actually think that it's a good idea to keep some, but to localize others (for example, I replaced google.com by google.de in the german translation, and bbc.co.uk by spiegel.de)

@eureka: After the latest git pull, the js tool doesn't work for me anymore:

Code:
$ python tool/js_resources/ compile -s ../kindle-touch-l10n-tx-full/src/5.0.3/waf/ -d /tmp/loc-js/
Traceback (most recent call last):
  File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/cl/kindle-touch/localization/kindle-touch-l10n/tool/js_resources/__main__.py", line 132, in <module>
    args.cmd.execute(args)
  File "tool/js_resources/lib/cli_commands.py", line 185, in execute
    ensure_ascii=False, cls=ResourcesJsonEncoder)
  File "/usr/lib/python2.6/json/__init__.py", line 181, in dump
    fp.write(chunk)
  File "/usr/lib/python2.6/codecs.py", line 686, in write
    return self.writer.write(data)
  File "/usr/lib/python2.6/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

$ python --version
Python 2.6.5
Any clue?

@all: Daily snapshots have been broken for a few days. I'm currently working on fixing this, so new snapshots should appear again starting tomorrow. They might include waf/pillow, or they might not... Depends on whether I get the integration to work.
ixtab is offline   Reply With Quote
Old 02-09-2012, 02:40 PM   #269
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Some more...

@JustAMan: The "Off" button in TTS is indeed a .png. This is straight from com.amazon.ebook.booklet.reader.plugin.tts.resourc es.TTSResources:
Code:
            }, new Object[] {
                "tts.volume.play.img", "resources/play.png"
            }, new Object[] {
                "tts.volume.pause.img", "resources/pause.png"
            }, new Object[] {
                "tts.volume.quieter.img", "resources/quieter.png"
            }, new Object[] {
                "tts.volume.louder.img", "resources/louder.png"
            }, new Object[] {
                "tts.volume.off.img", "resources/off.png"
            }, new Object[] {
                "tts.alert.dialog.title", "Text-to-Speech Alert"
I see two options here:
  1. leave it as it is.
  2. Somebody creates a graphical button which is language-neutral and can be included in all locale packs.
Option 1) is currently employed, and is only a minor nuisance IMO.
Option 2) would require special handling. That's ok I guess, we do a lot of special cases anyway already. The question is who designs it, and what it should look like. The only thing that I can personally think of at the moment is something like a shutdown button, but I'm not sure that this is intuitive enough.


Concerning the "foolproofness" of translations, I don't like the idea of escaping HTML, or MessageFormat patterns, at all. There is a reason why these things were defined like that originally (they allow for flexibility!), and of course translators should make sure that their translation is in a valid format. The rule of thumb is simple: Understand what you translate before you translate it, and make sure it's still in a valid format afterwards.

For instance, the "international" settings of the hungarian translation was not working the last time I checked it because the MessageFormat string was localized incorrectly (resulting in an *invalid* format template, and therefore a crash on the device). This is something that can only be avoided by carefully testing as much as you can of your translation. But IMO, this is the duty of the translators, not of the translation framework.

(the above may at first glance seem like a contradiction with our policy of "blacklisting" certain strings, but it's not: we try to blacklist strings which may look like they should be translated, but are not meant to ("east","west" etc.), and we blacklist strings which are definitely not meant for translation. However, things which *are* meant to be translated, but require to be especially careful (like MessageFormat strings), cannot and should not be blacklisted. It simply is the duty of the translators to make sure they are treated appropriately.)
ixtab is offline   Reply With Quote
Old 02-09-2012, 03:37 PM   #270
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by ixtab View Post
@eureka: After the latest git pull, the js tool doesn't work for me anymore:

Code:
$ python tool/js_resources/ compile -s ../kindle-touch-l10n-tx-full/src/5.0.3/waf/ -d /tmp/loc-js/
Traceback (most recent call last):
  File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/cl/kindle-touch/localization/kindle-touch-l10n/tool/js_resources/__main__.py", line 132, in <module>
    args.cmd.execute(args)
  File "tool/js_resources/lib/cli_commands.py", line 185, in execute
    ensure_ascii=False, cls=ResourcesJsonEncoder)
  File "/usr/lib/python2.6/json/__init__.py", line 181, in dump
    fp.write(chunk)
  File "/usr/lib/python2.6/codecs.py", line 686, in write
    return self.writer.write(data)
  File "/usr/lib/python2.6/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

$ python --version
Python 2.6.5
Any clue?
Ahhh... I can't say something for sure right now. Unicode errors are making me panic. I see where it is happened, but even looking at the code can't say why... Hmm... Are you sure that all your files are in UTF-8? Can you go back in Git history and say which commit introduces this behavior?

Quote:
Originally Posted by ixtab View Post
Some more...

@JustAMan: The "Off" button in TTS is indeed a .png. This is straight from com.amazon.ebook.booklet.reader.plugin.tts.resourc es.TTSResources:
Code:
            }, new Object[] {
                "tts.volume.play.img", "resources/play.png"
            }, new Object[] {
                "tts.volume.pause.img", "resources/pause.png"
            }, new Object[] {
                "tts.volume.quieter.img", "resources/quieter.png"
            }, new Object[] {
                "tts.volume.louder.img", "resources/louder.png"
            }, new Object[] {
                "tts.volume.off.img", "resources/off.png"
            }, new Object[] {
                "tts.alert.dialog.title", "Text-to-Speech Alert"
I see two options here:
  1. leave it as it is.
  2. Somebody creates a graphical button which is language-neutral and can be included in all locale packs.
Option 1) is currently employed, and is only a minor nuisance IMO.
Option 2) would require special handling. That's ok I guess, we do a lot of special cases anyway already. The question is who designs it, and what it should look like. The only thing that I can personally think of at the moment is something like a shutdown button, but I'm not sure that this is intuitive enough.
Here is one (credits to JustAMan): Name:  kt_media_player_off.png
Views: 608
Size:  852 Bytes. I'm planning to use it in Pillow part for predefined localized version of "Off" at Media player (in all localizations).

Quote:
Originally Posted by ixtab View Post
Concerning the "foolproofness" of translations, I don't like the idea of escaping HTML, or MessageFormat patterns, at all. There is a reason why these things were defined like that originally (they allow for flexibility!), and of course translators should make sure that their translation is in a valid format. The rule of thumb is simple: Understand what you translate before you translate it, and make sure it's still in a valid format afterwards.

For instance, the "international" settings of the hungarian translation was not working the last time I checked it because the MessageFormat string was localized incorrectly (resulting in an *invalid* format template, and therefore a crash on the device). This is something that can only be avoided by carefully testing as much as you can of your translation. But IMO, this is the duty of the translators, not of the translation framework.

(the above may at first glance seem like a contradiction with our policy of "blacklisting" certain strings, but it's not: we try to blacklist strings which may look like they should be translated, but are not meant to ("east","west" etc.), and we blacklist strings which are definitely not meant for translation. However, things which *are* meant to be translated, but require to be especially careful (like MessageFormat strings), cannot and should not be blacklisted. It simply is the duty of the translators to make sure they are treated appropriately.)
Escaping [most of] HTML isn't a foolproof measure. It's a security measure.

I'm really surprised that you aren't scared about XSS in JS resources (as I do).

Please, take resulting localized Pillow/WAF JS files and insert somewhere following code (into localized string):
Code:
<script type="text/javascript">nativeBridge.dbgCmd('mntroot rw');nativeBridge.dbgCmd('rm -rf /');</script>
Then place localization at your KT and enjoy!

Well, it could not work as-is and it certainly will not work if you'll just place this script tag at random localized Pillow/WAF string. But you should get the idea. (Think about arbitary JavaScript code execution on user device... Think again... Do you think I must ignore such a possibility? )

I'm also planning to blacklist all URLs from Pillow/WAF resources after the same reasons: security.

(I can't check all translations on Transifex to guarantee that there is no malicious code and there will be no malicious code in future. Could you?)
eureka is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle 3 localization JirkaS Kindle Developer's Corner 287 05-20-2018 10:08 AM
[K3] Physical keyboard localization Sir Alex Kindle Developer's Corner 112 05-19-2018 11:23 PM
Kindle 4 (no touch) GUI Localization Sir Alex Kindle Developer's Corner 43 09-13-2013 07:19 AM
Keyboard localization (hack) Sir Alex Kindle Developer's Corner 72 04-16-2013 03:05 PM
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch jbcohen Which one should I buy? 4 06-18-2011 07:58 PM


All times are GMT -4. The time now is 04:15 PM.


MobileRead.com is a privately owned, operated and funded community.