seaside - gettext - how to export a .po file ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

seaside - gettext - how to export a .po file ?

Cédric Ternon
Hi,


I'm trying to use the gettexts packages for seaSide.

I finally achieve to create a .pot file, translate it with poedit and make the website translated.

But now, I'm trying to create a .po file, that is a .pot file with the strings already translated and the strings remaining to translate.

(a .pot file beeing an empty template to begin without any translations)


We followed this tutorial :

The versions used are :
Seaside-Gettext-Core-NorbertHartl.10
Seaside-Pharo-Gettext-Core-pmm.1
Name: Gettext-HilaireFernandes.22

When I simply try :

GetTextExporter new exportTranslator: NaturalLanguageTranslator current.

I got :


I've got the same result with any GetTextTranslator

I have tryed to look for an implementors of the method "translations" but no one is implementing it, is a pkged missing?

I've also tryed to replace it with 'class translators' but this sound wrong and give me another unrelated error.

Thanks in advance for your help,

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside - gettext - how to export a .po file ?

Philippe Marschall
2011/11/24 Cédric Ternon <[hidden email]>:

> Hi,
>
> I'm trying to use the gettexts packages for seaSide.
> I finally achieve to create a .pot file, translate it with poedit and make
> the website translated.
> But now, I'm trying to create a .po file, that is a .pot file with the
> strings already translated and the strings remaining to translate.
> (a .pot file beeing an empty template to begin without any translations)
>
> We followed this tutorial :
> http://code.google.com/p/seaside/wiki/Gettext
> The versions used are :
> Seaside-Gettext-Core-NorbertHartl.10
> Seaside-Pharo-Gettext-Core-pmm.1
> Name: Gettext-HilaireFernandes.22
> When I simply try :
> GetTextExporter new exportTranslator: NaturalLanguageTranslator current.
> I got :
> http://pix.toile-libre.org/?img=1322152172.jpg
> I've got the same result with any GetTextTranslator
> I have tryed to look for an implementors of the method "translations" but no
> one is implementing it, is a pkged missing?
> I've also tryed to replace it with 'class translators' but this sound wrong
> and give me another unrelated error.

It looks like you're using GetTextExporter instead of
WAGetTextExporter. Can you load Seaside-Gettext-Examples and evaluate

WAGettextExample export

and see if that works?

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside - gettext - how to export a .po file ?

Cédric Ternon
Hello,


Thanks to help.

It works fine but it creates a .pot file.

My goal is to create a .po file : when a site is already half translated, I'd like to create a .po file a translator can use in poedit.

So the translator only has to translate the half not yet translated (and maybe bring some little corrections to the half already translated.)


WAGettextExample export
calls
WAGetTextExporter new exportTemplate

wich calls
self exportTranslator: nil

and we go there
exportTranslator: translator
    "Export translation files. the file extention is 'po', or 'pot' if translator is nil "


when the translator is nil, everything works well.

when I try with a translator it breaks here :

translationFor: aKey in: translator
    translator ifNil: [^''].
    translator translations at: aKey ifPresent: [:s | ^s].
    "If we have old camelCase translations, make space-separated words"
    translator translations at: aKey toCamelCase ifPresent: [:s |
        (s includes: Character space) ifTrue: [^s].
        ^s fromCamelCase].
    ^''






On 26 November 2011 12:51, Philippe Marschall <[hidden email]> wrote:
2011/11/24 Cédric Ternon <[hidden email]>:
> Hi,
>
> I'm trying to use the gettexts packages for seaSide.
> I finally achieve to create a .pot file, translate it with poedit and make
> the website translated.
> But now, I'm trying to create a .po file, that is a .pot file with the
> strings already translated and the strings remaining to translate.
> (a .pot file beeing an empty template to begin without any translations)
>
> We followed this tutorial :
> http://code.google.com/p/seaside/wiki/Gettext
> The versions used are :
> Seaside-Gettext-Core-NorbertHartl.10
> Seaside-Pharo-Gettext-Core-pmm.1
> Name: Gettext-HilaireFernandes.22
> When I simply try :
> GetTextExporter new exportTranslator: NaturalLanguageTranslator current.
> I got :
> http://pix.toile-libre.org/?img=1322152172.jpg
> I've got the same result with any GetTextTranslator
> I have tryed to look for an implementors of the method "translations" but no
> one is implementing it, is a pkged missing?
> I've also tryed to replace it with 'class translators' but this sound wrong
> and give me another unrelated error.

It looks like you're using GetTextExporter instead of
WAGetTextExporter. Can you load Seaside-Gettext-Examples and evaluate

WAGettextExample export

and see if that works?

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside - gettext - how to export a .po file ?

Philippe Marschall
2011/11/26 Cédric Ternon <[hidden email]>:

> Hello,
>
>
> Thanks to help.
>
> It works fine but it creates a .pot file.
>
> My goal is to create a .po file : when a site is already half translated,
> I'd like to create a .po file a translator can use in poedit.
>
> So the translator only has to translate the half not yet translated (and
> maybe bring some little corrections to the half already translated.)
>
>
> WAGettextExample export
> calls
> WAGetTextExporter new exportTemplate
>
> wich calls
> self exportTranslator: nil
>
> and we go there
> exportTranslator: translator
>     "Export translation files. the file extention is 'po', or 'pot' if
> translator is nil "
>
>
> when the translator is nil, everything works well.
>
> when I try with a translator it breaks here :
>
> translationFor: aKey in: translator
>     translator ifNil: [^''].
>     translator translations at: aKey ifPresent: [:s | ^s].
>     "If we have old camelCase translations, make space-separated words"
>     translator translations at: aKey toCamelCase ifPresent: [:s |
>         (s includes: Character space) ifTrue: [^s].
>         ^s fromCamelCase].
>     ^''

It's probably best to ask Hilaire on pharo-dev.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside