Recent

Author Topic: Online Package Manager  (Read 840155 times)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #360 on: November 30, 2016, 04:52:39 am »
You're from Spain? From your mail address I guess..

Here in south america is late too.

Attached a new version:
- corrected executable file name: now it generates only a single .po file for all platforms
- corrected memory leak
- corrected LazFileUtils position to use their functions instead of FileUtils ones
- translated into spanish

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #361 on: November 30, 2016, 05:40:29 am »
@minesadorada
Quote
BTW, what about scaleability?  Is it practical for OPM to offer 200 packages for example?  If not - what would be a practical maximum?
I tested with 500+ packages(reused the same ones, multiple times). Works well.

Quote
Is the DownloadURL  fully formed? i.e. does the DownloadURL field contain the full zipfile name?
Yes it should contain the full zipfile name.

@lainz
Quote
It does not output a pretty print version, but it works.
Code: Pascal  [Select][+][-]
  1. ...
  2. Streamer.Options := Streamer.Options + [jsoUseFormatString];
  3. ...
The JSON structure will change, but your demo is good and helps a lot. Thanks!

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #362 on: November 30, 2016, 01:18:47 pm »
You're from Spain? From your mail address I guess..

Here in south america is late too.

Attached a new version:
- corrected executable file name: now it generates only a single .po file for all platforms
- corrected memory leak
- corrected LazFileUtils position to use their functions instead of FileUtils ones
- translated into spanish
Thanks.  The \locale folder wasn't in the zip - could you attach it so we can keep synchronised please?
- Added optional popup help (that's why I need the .po files)
- Added 'About' dialog
- Added [...] to fetch update zipfile name
- ToDo: Improve validation
- Improving error-checking

I have some time today in sunny Tenerife to fiddle about :)
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

cryptkeeper

  • Newbie
  • Posts: 2
Re: Online Package Manager
« Reply #363 on: November 30, 2016, 01:23:29 pm »
hello folks, very nice job with Online Package Manager, thank you.
I have a small suggestion:  including line or two description what is in the package will be usefull for the user.
now we have to know, what we want to download/install with OPM.
e.g. package name callite. is category information Date/Time but it's visual components or only library of routing for dealing with date/time?
it would be usefull especially with category Other

thank you

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #364 on: November 30, 2016, 02:45:33 pm »
Code: Pascal  [Select][+][-]
  1. ...
  2. Streamer.Options := Streamer.Options + [jsoUseFormatString];
  3. ...
  4. The JSON structure will change, but your demo is good and helps a lot. Thanks!

Thanks! Yes that's the power of the streamer, is really easy to use.

Sorry I missed the .po files, here it is again with them.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #365 on: November 30, 2016, 06:37:06 pm »
@cryptkeeper
Just expand the *.lpk node(callight_pkg.lpk in your case) then check the description. It's set by the package maintainer, we cannot modify it.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #366 on: November 30, 2016, 07:17:34 pm »
@lainz
Did a bit more today.  The app is much too fancy for its purpose, but it was an interesting exercise for me.

More/changed resourcestrings, so the .es.po file is now out of whack (I still need to tidy them up so hold off translation for now)

I changed DefaultTranslator to LCLTranslator so the app could deal with languages in a more interactive way. Another reason was the DefaultTranslator chooses 'es' on my system, despite an English-language system.  It's probably fooled by my Spanish keyboard.

- Better interactive error-checking on inputs
- Language menu (only English/Español as yet)
- Hint system that runs on first use
- cfg file to store options
- 'About' dialog that uses app VersionInfo
- ..and other stuff
- I expect it could be refactored, but it seems to work in a user-friendly way and the code is maintainable.

Attached: current version 0.1.3.0

@GetMem I'm not sure anything needs to be added to the JSON - it seems enough for its purpose and it will be quick to download.
I have uploaded a test update JSON for you to test 'live'
https://sourceforge.net/projects/lazautoupdate/files/otherpackages/update_cryptini.json
and https://sourceforge.net/projects/lazautoupdate/files/otherpackages/update_cryptini_force.json  (force update)
(A good protocol is that update JSONs must always have a filename which is distinct from regular OPM-generated JSONs. You could use a custom name-protocol for update JSONs such as 'update_<packagename>.json' - this avoids filename clashes with package JSON files created by OPM and stored in the same folder)
« Last Edit: November 30, 2016, 08:09:59 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #367 on: November 30, 2016, 08:33:02 pm »
I like the new error messages, these are good to upload the json with no errors.

I need to read the code, but it works as far as I tested.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #368 on: November 30, 2016, 09:46:07 pm »
I like the new error messages, these are good to upload the json with no errors.

I need to read the code, but it works as far as I tested.
here's something I'd like you to look at:
If I am in 'en' mode and execute
Code: Pascal  [Select][+][-]
  1. SetDefaultLang('es', 'locale', TRUE);
It correctly switches to Spanish.

If I am in 'es' mode, and execute
Code: Pascal  [Select][+][-]
  1.   SetDefaultLang('en', 'locale', TRUE);
It doesn't switch back to English until the app is restarted (when the SetDefaultLang('en', 'locale', TRUE) is executed in Form.Create().)  Why so?

I have the jsoneditor.es.po and the jsoneditor.en.po in the appropriate /locale folder.
 
« Last Edit: November 30, 2016, 09:47:49 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #369 on: November 30, 2016, 10:18:47 pm »
I don't know exactly, but maybe once the translation is set you need to restart the application.

Lazarus needs a restart. You can force a restart with:

Code: Pascal  [Select][+][-]
  1. OpenURL(ProgramDirectory + Application.ExeName);
  2. Application.Terminate;

I think once you change the constant strings from english to something else then the translator doesn't know anymore how to translate?

Like:

Open -> Abrir: this translates open to abrir
Abrir -> ?: doesn't know how to translate Abrir to something else, because the .po are in english to something else, not in spanish to something else.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
OPM update JSON Editor
« Reply #370 on: December 01, 2016, 11:06:17 am »
@lainz I think we have an alpha (attached V0.1.5.0)  Please review.
I would really appreciate it if you would revisit the Spanish translation and bring it up to date.

Switching Spanish -> English: It might work better with an .en.po file that matches the es.po in all entries
« Last Edit: December 01, 2016, 11:43:49 am by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #371 on: December 01, 2016, 01:58:09 pm »
Here it is the updated translation.

I see some bugs:
- Remove: it removes the last item not the selected one
- Change language: it always display 'es' as language changed no matter what language I select (so no matter what I click I can't get back to english, even with a restart)

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #372 on: December 01, 2016, 03:16:19 pm »
Here it is the updated translation.

I see some bugs:
- Remove: it removes the last item not the selected one
- Change language: it always display 'es' as language changed no matter what language I select (so no matter what I click I can't get back to english, even with a restart)
Bugs:
1.  I haven't changed the original remove code.  I'll have a look at it.
2. Spanish -> English works for me after a restart of the app. (Testing in Linux 64-bit)
2a. Does your cfg file have an entry 'Language=en'?  Does your /locale folder have jsoneditor.en.po (renamed from jsoneditor.po)?
2b If  Spanish -> English doesn't work in a Spanish system. then we can produce multiple distributions with different Project/options/Version Info/Language Options settings.

Thanks a million for the translation and review.  My Spanish still isn't good enough to do the job :)
Are you OK with GPL license?  Your (excellent) code is the core of the app, so you call the license.

I've done a bit more refactoring.  V0.1.6.0 to follow...
« Last Edit: December 01, 2016, 03:44:20 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #373 on: December 01, 2016, 04:16:04 pm »
Quote
1.  I haven't changed the original remove code.  I'll have a look at it.

I know. The thing is that I created it to remove the last item, but the translation says that it removes the selected item.

Quote
2a. Does your cfg file have an entry 'Language=en'?  Does your /locale folder have jsoneditor.en.po (renamed from jsoneditor.po)?

No, I don't have one. But since the default translation is in english, why don't use the default po? That can be done?

Quote
Are you OK with GPL license?  Your (excellent) code is the core of the app, so you call the license.

Sure, GPL is OK.

We need to wait for GetMem, he said that maybe the external JSON structure changes, so we must wait for it.

Then upload it to sourceforge or github, or where you want, is the same for me.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #374 on: December 01, 2016, 06:38:54 pm »
Hi, this is the Spanish translation for the OPM
http://bugs.freepascal.org/view.php?id=31047

Please test and add to the Lazarus svn.

 

TinyPortal © 2005-2018