webOS Nation Forums >  webOS developer forums >  JDF Software > puchk
puchk

  Reply
 
LinkBack Thread Tools Display Modes
Old 05/30/2010, 12:16 PM   #21 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

There is a minor problem, but it is not your fault and I don't know, if it can be fixed:

3 of our apps have localized app names. But Mojo.Controller.appInfo.title always gives the english app name, so that is what's being displayed in the update dialog.
sidamos is offline   Reply With Quote
Old 05/31/2010, 10:35 AM   #22 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

Do you have separate appinfo.json files for each localization, ala https://developer.palm.com/distribut...t=5802&start=0

If you do that, does it still always show English?
jdforsythe is offline   Reply With Quote
Old 05/31/2010, 10:36 AM   #23 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default prefix

Quote:
Originally Posted by sidamos View Post
The interval for checking is a very good idea! But I would prefer to prefix ALL puchk global vars with "puchk". This is not the case for this.interval.
nice catch. will fix this in the next commit.
jdforsythe is offline   Reply With Quote
Old 05/31/2010, 10:45 AM   #24 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

Quote:
Originally Posted by jdforsythe View Post
Do you have separate appinfo.json files for each localization, ala https://developer.palm.com/distribut...t=5802&start=0

If you do that, does it still always show English?
Yes, it seems to be a bug in webOS.
sidamos is offline   Reply With Quote
Old 05/31/2010, 10:12 PM   #25 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

I'll have to mess around with it and see what I can do. Thanks for bringing it to my attention. BTW, I committed a new version that fixes the this.interval issue.
jdforsythe is offline   Reply With Quote
Old 05/31/2010, 11:52 PM   #26 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

Quote:
Originally Posted by jdforsythe View Post
I'll have to mess around with it and see what I can do. Thanks for bringing it to my attention. BTW, I committed a new version that fixes the this.interval issue.
Thanks!
sidamos is offline   Reply With Quote
Old 06/01/2010, 02:56 PM   #27 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default localization problem

I have verified that this is a bug in webOS and have submitted it to Palm.

I am thinking about how to work around it in the meantime.
jdforsythe is offline   Reply With Quote
Old 06/01/2010, 03:37 PM   #28 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

Ok, here's a simple solution. I'm not happy with it, and I wish the Mojo call worked, but this will work for the time being. I will commit this update later.

In your strings.json file for each localization, you'll have to manually enter the localized title in place of #{title} in the update dialog string. Here's a sample Spanish translation strings.json:

Quote:
{
"Update Available": "Actualización Disponible",
"#{title} v#{version} is available. Would you like to update?": "muestra de puchk v#{version} disponible. ¿Desea actualizar?",
"Download Update": "Descargar la Actualización",
"Cancel": "Cancelar"
}
Notice that in the #[title} v#{version} string the title part is replaced with the localized app name. This will have to do for now.
jdforsythe is offline   Reply With Quote
Old 06/03/2010, 04:38 PM   #29 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

Okay, another commit today. This one brings better localization.

I decided that since it was confirmed by unwiredben that Mojo.Controller.appInfo.title always returns the English app title, it would be wise to localize the title globally within the app. So I localized it separately from the message string.

I also decided to use keys for the localization files, prepended with puchk_ so that's in the commit, as well.
jdforsythe is offline   Reply With Quote
Old 06/21/2010, 09:59 PM   #30 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

Fixed an issue with app updates failing to install (bug with webOS that causes install failures when the older version is still open). More info in this article:

puchk updated to v0.6.1
jdforsythe is offline   Reply With Quote
Old 06/22/2010, 11:50 AM   #31 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

Could you please bring this to Palm's attention? They are searching for the cause of failed app installs.
sidamos is offline   Reply With Quote
Old 06/30/2010, 09:20 PM   #32 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default

I have posted twice about it on the dev forums. No responses from Palm.
jdforsythe is offline   Reply With Quote
Old 09/20/2010, 12:10 PM   #33 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

window.close() does not quit my app anymore (when pressing the update button to launch the App Catalog).

Either it's webOS 1.4.5 or the fact that my app is now a multi-stage app.
sidamos is offline   Reply With Quote
Old 09/20/2010, 12:26 PM   #34 (permalink)
Member

 
Join Date: Jun 2009
Posts: 608
Likes Received: 7
Thanks: 25
Thanked 90 Times in 59 Posts
Default

The cause was multi-stage and Mojo.Controller.getAppController().closeAllStages();
works.
sidamos is offline   Reply With Quote
Old 12/06/2010, 11:08 PM   #35 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default Good to know

Good to know. Thanks, sidamos
jdforsythe is offline   Reply With Quote
Old 12/14/2010, 01:18 PM   #36 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default puchk updated to v1.0.0

Good news and bad news!

Bad news - you're going to have to edit your code, but only once

Good news - puchk is updated!

In this update:

I made this -much- easier to add to your apps, and to update puchk in the future.
There is now a "never ask me again" functionality built-in

http://www.jdf-software.com/software...k/puchk.tar.gz
or
http://www.jdf-software.com/software...k/puchk.tar.gz

-----

Instead of copying + pasting the code into your assistant file, puchk is now a separate file, puchk.js. You can put this anywhere in your directory structure (I chose app_folder/js/puchk.js)

1) include the file in index.html
<script type="text/javascript" src="js/puchk.js"></script>

2) in your first scene's setup() method (or wherever you want the check to happen - make sure it's a scene the user will be on long enough for the check to occur!)
var update = new puchk(hours, this);
update.check();

where "hours" is the MINIMUM number of hours between update checks, and "this" is just "this"


It's as simple as that, now! You can delete all the old code that's clogging up your assistant! And now if puchk gets updated, it'll be as simple as replacing the puchk.js file with the new copy.
jdforsythe is offline   Reply With Quote
Old 12/22/2010, 06:21 PM   #37 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default 1.0.1

MINOR update.

There was a spelling error - in the code for the update dialog, one of the keys ways spelled wrong - "nevel" instead of "never". It doesn't affect the text displayed in the dialog, but if you are using the key with localization files, you'll want to correct the error or your other languages won't show there.

Plus I did a little tidying of the code to make it run a bit faster.

The github repo is updated now.
jdforsythe is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0