Jump to content


Photo

Foreca plugin EN and PL

E2 Plugins

  • Please log in to reply
119 replies to this topic

#1 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 26 October 2011 - 08:11

I've noticed in the Dutch section (and then in the feed) nice weather plugin Foreca, unfortunately it's all in (beautiful ;)) Dutch language, hence it's little difficult to use it...
moreover, the oryginal plugin is in German, and I can't find anywhere English version,
so, I made an EN version of it for all and a Polish one (PL) for Poles ;), hope it's not too much of a good thing...
//and the best solution would be to create a multilingual plugin (based on EN?), but I do not know how how to integrate locale (po) into the plugin

both my versions are based on 1.7 version from the feed, tested and seems to install and work fine (although it was at night so you know, maybe I overlooked something...)
of course City.cfg everybody should adjust to his needs
have fun!
//btw. I am not so sure whether it was necessary pushing version up to 1.7, when the original 1.7 will be released, it may cause some confusion /?/

Attached Files


True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #2 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 26 October 2011 - 09:20

ouch :D ,
just realized that if /?/ above versions would be placed on the server, then after an online update, everybody will end up with the Polish version... (and half of the Netherlands will curse 'this f**n @blzr' ;))
so, attached renamed versions, I think it should be safer now /?/

Attached Files


True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #3 theparasol

  • Senior Member
  • 4,157 posts

+198
Excellent

Posted 26 October 2011 - 16:09

Thanks for translating!

Please use it for now by installing it manual.

If I have more sparetime I'll do some major rewriting (the code is very crappy and redundant) and from that moment we can use localization the same way it is used by other more mature plugins.

@Camping: ZGemma H.2S, Technisat Multytenne 4-in-1 @Home: Edision Mini 4K, Wave Frontier T55, EMP Centauri EMP DiSEqC 8/1 switch, 4x Inverto Ultra Black single LNB


Re: Foreca plugin EN and PL #4 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 26 October 2011 - 16:58

ok, it'd be great :)
regarding complete localization (in one plugin) - it won't be /?/ as easy as it seemed (at least to me), I'm afraid...
- language of strings fetched directly from the foreca site (eg. overcast, precip chance, etc.) depends of what page was pre-defined in plugin.py
- converting diacritics for different languages have to be considered (for now it's filter.sh (sed) I don't know if it's the best/only way?)
good luck!

Edited by blzr, 26 October 2011 - 16:59.

True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #5 theparasol

  • Senior Member
  • 4,157 posts

+198
Excellent

Posted 26 October 2011 - 17:00

Thats one reason why a complete overhaul of the plugin code is necessary.

@Camping: ZGemma H.2S, Technisat Multytenne 4-in-1 @Home: Edision Mini 4K, Wave Frontier T55, EMP Centauri EMP DiSEqC 8/1 switch, 4x Inverto Ultra Black single LNB


Re: Foreca plugin EN and PL #6 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 26 October 2011 - 17:51

ok, so I'll be waiting
//if you need some help, with Polish translations/diacritics especially, just let me know

***
and btw. some explanations for @all, regarding my above PL/EN Foreca versions:
- versions from the first post (1.7EN or 1.7PL) can be installed ON the version from the feed (1.7)
(it turned out that they won't be on the feed you can install them safely...)
- if you'd like to install versions from the second post (-en_1.7 or -pl_1.7you have to uninstall previously installed version of the plugin first

Edited by blzr, 26 October 2011 - 17:52.

True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #7 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 27 October 2011 - 12:05

and one suggestion for future versions (I know this was discussed in Dutch section) - the easiest way to avoid overwriting existing City.cfg (probably every user adjusts it to his needs) is to add to the package preinstall and postinstall scripts
//don't know whether it's most 'proper' way, but it works ;)

Attached Files


True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #8 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 27 October 2011 - 13:33

NO! Please don't add pre/post install scripts!
Real musicians never die - they just decompose

Re: Foreca plugin EN and PL #9 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 27 October 2011 - 13:40

The proper way to tell opkg that a file is user-configurable is to just add the to the config files list of the package. This is also way smarter: It will compare your version against what was in the old package (using a hash), and will upgrade it when you haven't touched it.
For examples, see the cccam and oscam packages, which install config files.

The trouble with pre/post install scripts is that once you add them to a package, you can never (really) get rid of them, and all future versions will have pre/post install scripts too even though they may be empty and obsolete by then. The problem with moving files around in pre/post scripts is that the package manager has no knowledge about them (and complains about this when you uninstall it).
Real musicians never die - they just decompose

Re: Foreca plugin EN and PL #10 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 27 October 2011 - 13:40

NO!

well, it turned out that this is definitely not a proper way... :P
rgds
True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #11 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 27 October 2011 - 14:46

thanks @MiLo for your detailed explanation :)
just overlooked your second post...
so it should be 'conffiles' file added to the package with something like:
/etc/Foreca/City.cfg
+ possibly startservice.cfg fav1.cfg fav2.cfg (examples)

//assuming that /etc/... is a better place for config files than plugin folder...
True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #12 theparasol

  • Senior Member
  • 4,157 posts

+198
Excellent

Posted 27 October 2011 - 19:42

All of the user config files will be moved to etc/enigma2
Also initial fetching country/city from foreca page will be implemented, that's much better than a static city config file with XXXX countries/places that someone has to maintain
or edit before use!

At startup the plugin will fetch countries, users selects a country, then it will fetch cities within that country-> user makes a choice.
After that startpage city is stored in config for future reference.

Everybody happy I think :)

@Camping: ZGemma H.2S, Technisat Multytenne 4-in-1 @Home: Edision Mini 4K, Wave Frontier T55, EMP Centauri EMP DiSEqC 8/1 switch, 4x Inverto Ultra Black single LNB


Re: Foreca plugin EN and PL #13 hemertje

  • Forum Moderator
    PLi® Core member
  • 33,503 posts

+118
Excellent

Posted 27 October 2011 - 19:55

nice thoughts!

on the Glassfibre 1GB DVB-C...


Re: Foreca plugin EN and PL #14 Bag58

  • Senior Member
  • 437 posts

+23
Neutral

Posted 27 October 2011 - 20:36

When I built the ipk file for the Ducth 1.7 version from the original 1.6 version, I noticed that there was a file called postrm in the CONTROL folder. I presume that is exactly such a post install script. In that case it will have to be removed in an upcoming version.

Re: Foreca plugin EN and PL #15 smile20

  • Member
  • 33 posts

0
Neutral

Posted 28 October 2011 - 15:34

I have some problem with this app. It doesnt metter which city i choose, datas about weather doesnt change. Also when i click "Menu" button and choose some option theres problem with resolution, i see half of the green text above map. Another problem, maybe not with app but with setup... how can i change favortie city 1/2, and how can city on startup(which city loads first after turning on plugin).
Btw I've downloaded plugin from second post, polish version. // Dm800se; Pli img

Edited by smile20, 28 October 2011 - 15:35.


Re: Foreca plugin EN and PL #16 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 28 October 2011 - 17:12

It doesnt metter which city i choose, datas about weather doesnt change.

oops,
sorry, but seems that I screwed up both PL versions...
attached corrected plugin.py (unpack first) for manual replacement
and/or whole corrected package too if you'd like to upgrade...
hope it works fine this time :)
and to choose startpage, fav1 or fav2 - go to cities list with [OK] and then use color buttons

//@mods - is it possible to remove Polish versions attached to first two posts to avoid confusion? TIA

Attached Files


True sarcasm doesn't need green font...

Re: Foreca plugin EN and PL #17 Bag58

  • Senior Member
  • 437 posts

+23
Neutral

Posted 6 November 2011 - 12:57

This morning I uploaded a new version of the plugin containing the following changes:[list]
[*]The plugin is now completely in the English language, with added translations in Dutch and German. With that a basis for an international version has been laid.
[*]The configuration files (the file City.cfg which is a standard part of the plugin, and the files fav1.cfg, fav2.cfg and startpagina.cfg as created by the users themselves) are now placed in /etc/enigma2/Foreca
[*]City.cfg is marked as a configuration file, and will not be overwritten by future updates
[*]In the standard version of City.cfg in various countries cities have been added. There are now at least some cities in all countries that appear in the Europe menu.
[*]City.cfg has been sorted alfabetically on country, and within that on city (English names). On the other hand, the Netherlands are still at the top, but everyone can change that according to their own taste.
[/list]
Instructions to start using this new version:

For those who do not yet use the plugin it is very simple: just download and install the current version and restart Enigma2. After that you can start using it.

For those who are already using an earlier version of the plugin, a little more has to be done, i.e.[list]
[*]Through Telnet create the directory Foreca in /etc/enigma2. Take care: the spelling of the name must be exactly as written down here, so using a capital F.
[*]Copy (when yoy want to keep your current versions) the files City.cfg, fav1.cfg, fav2.cfg and startpagina.cfg from the plugin directory to the new directory.
[*]Next de-install the old version of the plugin, and restart Enigma2.
[*]Download and install the new version of the plugin and restart Enigma2.
[*]The new version is now ready for use
[/list]
As said, in its present form the plugin works in English, German and Dutch. When others make locale files for other languages, plase place them here (both the files Foreca.po and Foreca.mo), so others can dowload and use them oif they want it, and they can also be added to the IPKs of upcoming versions.

The example user_skin.xml posted before contains a few texts in Dutch. For now anyone who wnats it will have to translate these themselves. Hopefully these texts can be delivered in the correct language from the plugin in a future version. Some work must remain to be done, of course!
The new version can be downloaded here: http://openpli.org/f...post__p__229288

Re: Foreca plugin EN and PL #18 Frogman

  • Senior Member
  • 389 posts

+68
Good

Posted 6 November 2011 - 13:47

Hi Bag58

thank you for this new version. I've slightly reworked your german translation, find attached the new Foreca.po for your next update.

bye

Attached Files


Most problems can be solved simply by a closer look.

Re: Foreca plugin EN and PL #19 Bag58

  • Senior Member
  • 437 posts

+23
Neutral

Posted 6 November 2011 - 15:32

Thaks for your corrections. I have corrected one remaining type I discovered and updated my sources with it. When I publish a next version that will contain your corrections. Attached you find the new German Foreca.po and Foreca.mo files. If you put those in the correct place you can start using the corrected texts right away, after an Enigma2 restart.

Attached Files



Re: Foreca plugin EN and PL #20 Frogman

  • Senior Member
  • 389 posts

+68
Good

Posted 6 November 2011 - 15:44

ups, i've found one more... sorry :)

Attached Files


Most problems can be solved simply by a closer look.


4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users