overdue-scratch

Author Topic: Revisit Chameleon's package builder  (Read 144360 times)

0 Members and 1 Guest are viewing this topic.

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #255 on: January 22, 2012, 11:01:36 PM »
Nice Idea Black!

So would be better a "complete" template????

also the "fileld" like Developer: Thanks to: an so on... are different for each language...
And yes the templates are the better and fast way for maintenance... is not the same edit and commit 1 or 2 files instead of "92"...
:P

Let me know if I can help.. me too I have little time at moment... but better than nothing ..
Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #256 on: January 23, 2012, 02:45:21 PM »
So would be better a "complete" template????
I think so, yes.

also the "fileld" like Developer: Thanks to: an so on... are different for each language...
Good spot. They should be added too then.

And yes the templates are the better and fast way for maintenance... is not the same edit and commit 1 or 2 files instead of "92"...
:P
Exactly.

Let me know if I can help.. me too I have little time at moment... but better than nothing ..
Okay. I don't know when I'll even start at looking at this, but when I do, I'll let you know.

I'm going to start looking at the text written to the install log first to see if I can improve the feedback to the user since JrCs' changes. Thing is, JrCs is a clever chap and he enhanced/rewrote many parts including the perl and javascript code which I now have to try to understand  :P
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #257 on: February 17, 2012, 08:53:28 AM »
Hi all,

i have little time too. But if you want some informations or want to discuss about the installer, don't hesitate  ;)

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #258 on: February 28, 2012, 01:50:57 PM »
Hi Fabio / JrCs

I've finally managed to put together an alternative method for managing the package installer resources. I've updated my branch to work this new way and although it's still a work in progress and not thoroughly tested I would like to communicate what I am trying to do.

The idea is this:
1) Have a single common document which contains all the text for all the files. This file is a Google doc spreadsheet and it's a published file so the data can be downloaded.
2) The chameleon svn will no longer host the individual resources folders and files, instead will host only templates for these files - same as JrCs did for the scripts.
3) The buildpkg.sh script calls a perl script 'ConvertResourcesTextFile.pl' which downloads the data from the Google spreadsheet and then processes it in to a script friendly list format (sort of YAML).
4) The buildpkg.sh script then continues by reading the new list file and populates the templates - building the Resources folder to the correct location for the final package.

You can view a readonly version of the Google doc spreadsheet here:
https://docs.google.com/spreadsheet/ccc?key=0Aj0jJ2rdmK_sdFdNbm45NlpNYU1PcjRmOHVXX0FNa3c

I'm still updating the spreadsheet at the moment so you'll notice it's not yet complete. I've still got to add the LocalizationStrings for the Italian language and onwards. Plus make all the recent changes, additions that you Fabio did yesterday.. Lol.   
@Fabio - If you would like to help me complete/update the spreadsheet then I could give you write access?

Which brings me on to the question of how to manage the spreadsheet - I don't know if I should make it a public doc so anybody can update it? or only let registered users update it? The plus side of opening it up to everyone would mean it would be up to date quicker and kept accurate, but doing that would mean we also have to trust that nobody messed with it.

This idea is not perfect and I've discovered that the textutil command used in the buildpkg.sh script for converting the unicode markup gives different results in Snow Leopard to what it does in Lion. I need to find out why, but what that means is for now, building the package in Snow Leopard gives the wrong text conversion results.

So for now, that's what I'm working on. Is this a good direction to go in? Have you any suggestions of how this could be improved or changed?

Regards
blackosx
« Last Edit: February 28, 2012, 02:03:18 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #259 on: February 28, 2012, 02:34:19 PM »
Amazing!

I will happy to help you.

Q. (From a very quick tour on google) Can this "database" live exclusively on google?
Or they can be accommodated in our SVN (or Chameleon Application svn)?

Other idea... can this "database" merge into a large .plist document? (it support UTF-16 encoding...)

However, tonight I read deeper into your post to understand better the process of resources creation...

Fabio
« Last Edit: February 28, 2012, 03:05:05 PM by ErmaC »
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #260 on: February 28, 2012, 05:40:08 PM »
Thanks for the feedback Fabio.

The advantage to using a Google doc is that it's instantly available to anyone (providing they have a Google account) and a script can pull the data from it which makes it ideal for this purpose.  However, as you've pointed out it means we will rely on Google hosting the master file.

I don't know if the file can be hosted on a non-Google server. We could maybe use an openoffice or MS excel spreadsheet instead and host that at the svn, then save/export a tabbed delimited text file for the scripts to read but it's more cumbersome.

The main resource file could be in a .plist format. I thought of that originally, along with an xml file but wanted a simpler file for reading and editing, that's why I chose to use a spreadsheet. The structured list file that the perl script generates goes someway to answer this and keeps the format in a simple manner like a YAML file. And from my reading, UTF-8 supports everything we need for this.

You can look at the list file the perl script generates by doing the following:
cd to branch /package/Resources.source
./ConvertResourcesTextFile.pl path filename of where you want to save the file to.

So for example:
Code: [Select]
./ConvertResourcesTextFile.pl ~/Desktop ResourcesSourceFile.txt

Feel free to throw ideas around here so this can hopefully progress to some useful completion.
« Last Edit: February 28, 2012, 05:47:44 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #261 on: February 29, 2012, 04:43:43 AM »
OK!

I help you to complete the "master" Resource Database.
(PM's me how).

Can you point me about how "mod" the .pl script for try in "local" mode the ResourcesSourceFile.txt instead of online google version? Because in the future this is how the scripts will work.

Also I will do a little change for the Welcome Template:
@W_Cp@ instead of Copyright this word also have a translation.

and %CPRYEAR% instead of the static 2009-2012 for the sostitution tacked from CREDITS file.

I think I will take the missed/new data from my modules sub-branch. The Localizable.strings files are more complete.

Anyway very good job Blackosx
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #262 on: February 29, 2012, 10:00:07 AM »
Hi all,

i look for the big work you made blackosx. This is what i'm thinking about. It's only my hymble opinion:
* I think that downloading file from the internet is not a really good solution: we need to have access to internet to work, and the file is never versioned, so we can properly follow it's history.
* I think your file is too complex, we juste need an id and a translation for each language.
* I think you are trying to reinvent the .pot/.po files that are used in any linux to make translation of programs (http://en.wikipedia.org/wiki/Gettext)

There are programs to manage pot file on OSX like http://www.macupdate.com/app/mac/22905/poedit

Look at this url: http://translate.org.za/blogs/dwayne/en/content/localizing-mac-os-x-strings-files-using-open-source-po-editors , it's a program to convert strings to pot file and then convert back to strings. So we only have to create a pot file from the english strings file (with the prop2po program), let the translator add their translations (they don't have to translate all strings) and then convert back each translate pot file to a localized string file (with po2prop program).

As i have said before it's my humble opinion.

JrCs

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #263 on: February 29, 2012, 10:45:01 AM »
Hi JrCs

Thanks for the feedback and the pointer to a different way of looking at this. Your opinion is valid and that's why I asked for it.

I agree the solution I have been working on has become quite complex but that's how I saw the solution at that time. Now, though I am happy to look further in to .pot/.po and the links you supplied to see if a simpler solution can be applied. Simple is always best.

I help you to complete the "master" Resource Database.
Thanks for taking a look at this Fabio and your offer to help. However, going by JrCs suggestions I think it's wise to stop for now and look at a different method. But yes, we can include 'Copyright' and the date in the future solution.

I'm happy to continue discussions. But for now.. it's finding time for more research.

 ;D
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #264 on: February 29, 2012, 10:46:34 AM »
Hi all i test the conversion of the strings -> po -> strings and it work very well.
In attachment the files that have used and created.

I convert the english localization file from en.lproj to en.pot file with the command:
Code: [Select]
prop2po --encoding=UTF-16LE -P Localizable.strings en.potthen  i copy the en.pot file to fr.po
Code: [Select]
cp en.pot fr.pothen i open the fr.po with an editor and i've translated in french the first 4 messages.
To finish i convert the fr.po file to a  Localizable.fr.strings that can be used in the fr.lproj with the command:
Code: [Select]
po2prop -t Localizable.strings fr.po Localizable.fr.strings
Everything can be automated with a script. The translators are only to edit the lang.po files.

JrCs

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #265 on: February 29, 2012, 10:50:36 AM »
It's me again. We can use Pottle: http://translate.sourceforge.net/wiki/pootle/index to do web translation directly. So anyone can make the translation of the project without retreiving the svn project.

Example of the pootle project: http://pootle.locamotion.org/

JrCs

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Revisit Chameleon's package builder
« Reply #266 on: February 29, 2012, 10:51:35 AM »
Brilliant.. Thanks for the trials JrCs. - So easy when you know how  :lol:
I'm at work right now so I'll have a look at this tonight. Thanks
« Last Edit: February 29, 2012, 10:55:31 AM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #267 on: February 29, 2012, 12:01:09 PM »
The only problem is that we need the translate-toolkit on OSX. Actually i do the conversion from a linux.
As the toolkit is wrote in python i think it will be easy to port on OSX.

JrCs

JrCs

  • VoodooLabs
  • Posts: 49
Re: Revisit Chameleon's package builder
« Reply #268 on: February 29, 2012, 12:47:02 PM »
The only problem is that we need the translate-toolkit on OSX. Actually i do the conversion from a linux.
As the toolkit is wrote in python i think it will be easy to port on OSX.

JrCs
It's easy has download the package, extract it and installing it
Code: [Select]
cd /tmp
wget "http://sourceforge.net/projects/translate/files/Translate%20Toolkit/1.9.0/translate-toolkit-1.9.0.tar.bz2/download" -O translate-toolkit-1.9.0.tar.bz2
tar xvjf translate-toolkit-1.9.0.tar.bz2
cd translate-toolkit-1.9.0
sudo ./setup.py install --prefix=/opt/local

I'm using the --prefix=/opt/local option because i have macports installed on my hack.

After that you can download poedit for OSX: http://prdownloads.sourceforge.net/poedit/poedit-1.4.6.2.dmg
and start to translate the files  ;)

JrCs
« Last Edit: February 29, 2012, 12:51:26 PM by JrCs »

ErmaC

  • Resident
  • Posts: 134
Re: Revisit Chameleon's package builder
« Reply #269 on: February 29, 2012, 01:37:28 PM »
Thx JrCs!

follow your steps...



Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240