french translation

66 views
Skip to first unread message

kaesh...@gmail.com

unread,
Dec 18, 2013, 6:58:21 AM12/18/13
to nive...@googlegroups.com
I'm trying to translate nive. I installed babel and lingua then i run python setup.py extract_messages

But it throws me an error :

extracting messages from nive/adminview/index.pt
Aborting due to parse error in /home/web/wilk/repo/nive/nive/nive/adminview/index.pt: not well-formed (invalid token): line 1, column 39

I don't know chameleon but it doesn't seems to be an error in index.pt...

I missed somethings ?

Thanks

Arndt Droullier

unread,
Dec 18, 2013, 10:13:54 AM12/18/13
to nive...@googlegroups.com
I just tried it. Seems the current Babel and lingua versions have a problem to parse the 
templates (I think this is linguas part). Older versions work:

./Babel-0.9.6-py2.7.egg
./lingua-1.3-py2.7.egg 

By the way, if you are working on the translations: I've just updated the translation domains
for nive_cms and nive_userdb packages. Now each of the python package gets it's own translation
file and i18n domain.

Arndt.



2013/12/18 <kaesh...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
----------------------------------------------------------------------------------------------
Arndt Droullier, Nive GmbH, Köln, Germany
Nive Web Application Publishing: < New Prototype > www.nive.co
Nive Open Source Cms: cms.nive.co

kaesh...@gmail.com

unread,
Dec 18, 2013, 4:19:52 PM12/18/13
to nive...@googlegroups.com

I could do
python setup.py extract_messages
python setup.py init_catalog -l fr_FR
python setup.py compile_catalog

in locale/fr_FR it should be nive.po or nive_cms.po ?

In development.ini : pyramid.default_locale_name = fr_FR

but i cannot see the translation... I forget somethings ?

Arndt Droullier

unread,
Dec 20, 2013, 10:22:13 AM12/20/13
to nive...@googlegroups.com
I'm sorry I forgot to include the translation files during pyramid startup. I just updated the files on github to fix it.

Now three separate translation directories are used for a website:

nive/locale
nive_cms/locale
nive_userdb/locale

The translation file has be compiled after each change. So actually you should have the following 
files in each locale directory (with different filenames)

nive_cms.pot                                     <- the one automatically extraced
fr_FR/LC_MESSAGES/nive_cms.po    <- the (text) file to be translated
fr_FR/LC_MESSAGES/nive_cms.mo   <- the compiled translation file

Arndt.


 


2013/12/18 <kaesh...@gmail.com>

kaesh...@gmail.com

unread,
Dec 20, 2013, 12:37:27 PM12/20/13
to nive...@googlegroups.com


Le vendredi 20 décembre 2013 16:22:13 UTC+1, Arndt Droullier a écrit :
I'm sorry I forgot to include the translation files during pyramid startup. I just updated the files on github to fix it.


I think you forgot to push nive_cms or it need more works ?

Arndt Droullier

unread,
Dec 27, 2013, 11:23:18 AM12/27/13
to nive...@googlegroups.com
I'm back again... Ah yes sorry, but now it is updated.

Please note, I've started updating the asset handling of the cms editor functions. A few 
things have changed since the previous version. 
It is mainly related to calls 'view.Assets()' in index templates like (in nive_cms.design.templates.index.pt)

<tal:block tal:condition="cmsview"><span tal:replace="structure cmsview.EditorAssets(ignore=['jquery.js'])"/></tal:block>

Arndt.



2013/12/20 <kaesh...@gmail.com>


Le vendredi 20 décembre 2013 16:22:13 UTC+1, Arndt Droullier a écrit :
I'm sorry I forgot to include the translation files during pyramid startup. I just updated the files on github to fix it.


I think you forgot to push nive_cms or it need more works ?

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kaesh...@gmail.com

unread,
Dec 30, 2013, 10:34:50 AM12/30/13
to nive...@googlegroups.com
Hi,

I don't see where to translate the title 'home' of the root page. pcreate with fr_FR doesn't seems to create the data with the translated string. Don't know if it's a bug or if it must be changed in an other way ?

Arndt Droullier

unread,
Dec 31, 2013, 7:45:51 AM12/31/13
to nive...@googlegroups.com
Hi,
first of all thanks for the translation! 
'Home' was not translated before being rendered. I just fixed it.

All the best, Arndt. 


2013/12/30 <kaesh...@gmail.com>
Hi,

I don't see where to translate the title 'home' of the root page. pcreate with fr_FR doesn't seems to create the data with the translated string. Don't know if it's a bug or if it must be changed in an other way ?

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kaesh...@gmail.com

unread,
Jan 1, 2014, 2:38:28 PM1/1/14
to nive...@googlegroups.com
Hi,

About translation, i found the problem with lingua, and finally some sentences cannot be translated. It's because lingua_xml only accept valid xml files.
I hacked lingua to show the parsing error, do you think it's worth to make them xml valid (&amp;...) ? I can try to do it if you want.

Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/cmsview/index.pt: not well-formed (invalid token): line 1, column 39
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/cmsview/widgets/toolbox.pt: junk after document element: line 18, column 0
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/box.pt: not well-formed (invalid token): line 1, column 83
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/image.pt: not well-formed (invalid token): line 23, column 87
extracting messages from nive_cms/design/templates/index.pt
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/index.pt: not well-formed (invalid token): line 1, column 39
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/media.pt: not well-formed (invalid token): line 3, column 49
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/page.pt: mismatched tag: line 5, column 4
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/design/templates/search.pt: not well-formed (invalid token): line 16, column 88
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/doc/default.pt: junk after document element: line 3, column 0
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/workflow/templates/editorpage.pt: not well-formed (invalid token): line 18, column 69
Error while parsing /home/web/wilk/repo/nive/nive_cms/nive_cms/workflow/templates/widget.pt: not well-formed (invalid token): line 11, column 60

Arndt Droullier

unread,
Jan 2, 2014, 9:48:32 AM1/2/14
to nive...@googlegroups.com
Seems all these files have silently been ignored? 
However, I haven't tried it yet, but the chameleon website docmuents another tool to
extract translations:


Maybe that's a better way? At least all templates are valid Page Templates.

Arndt.


2014/1/1 <kaesh...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kaesh...@gmail.com

unread,
Jan 2, 2014, 10:53:48 AM1/2/14
to nive...@googlegroups.com


Le jeudi 2 janvier 2014 15:48:32 UTC+1, Arndt Droullier a écrit :
Seems all these files have silently been ignored? 

Yes, and it was difficult to see because it skipped only the end of the file.
 
However, I haven't tried it yet, but the chameleon website docmuents another tool to
extract translations:


Maybe that's a better way? At least all templates are valid Page Templates.

 
It's removed in chameleon 2.x, and replaced with lingua. I found that author of lingua want to restrict to pure xml...
I tried with chameleon 1.3, finally there is the same problem.
It's not too much work i think.

Arndt Droullier

unread,
Jan 7, 2014, 6:22:32 AM1/7/14
to nive...@googlegroups.com
I guess it's the only way then to make the templates pass the xml parser.
Yes most errors look easy to fix.

Arndt.


2014/1/2 <kaesh...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nive-cms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nive-cms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kaesh...@gmail.com

unread,
Jan 12, 2014, 1:11:55 PM1/12/14
to nive...@googlegroups.com
Le mardi 7 janvier 2014 12:22:32 UTC+1, Arndt Droullier a écrit :
I guess it's the only way then to make the templates pass the xml parser.
Yes most errors look easy to fix.

Finally i tried but i don't see what to do most of the time... It can be xml fragment for example, or replace string with <>... I think it will need to change in the code i prefer to let you do it.

If you want to try, in lingua/extractors class XmlExtractor or lingua_xml >= 1.5 which will stop on first error

        try:
            self.parser.ParseFile(fileobj)
        except expat.ExpatError as err:

            print >> sys.stderr, 'Error while parsing {0}: {1}'.format(

                fileobj.name, err)

            pass

Sorry !

Jan Phillip Frederic Nahody

unread,
Mar 10, 2014, 5:29:51 AM3/10/14
to nive...@googlegroups.com
The "error" happens cause your document ist not valid xml document. To use HTML5 documents with lingua, you must close all inline tags like here: <img src="myimage.jpg" />. Don't forget to remove the closing after you have parse the document for heaving a valid html5 doc.

Hope this help you.

Arndt Droullier

unread,
Aug 26, 2014, 6:17:29 AM8/26/14
to nive...@googlegroups.com
Good news: The new lingua release 3 supports html 5 tags and is less strict.
I've updated the templates and now they all pass the translation parser.

Arndt. 
Reply all
Reply to author
Forward
0 new messages