How to add a translation of a document in the HST (7.8.0)

258 views
Skip to first unread message

James

unread,
Apr 29, 2013, 6:52:55 PM4/29/13
to hippo-c...@googlegroups.com
Ok, so I followed the instructions in the following link for adding a document. 

http://www.onehippo.org/7_8/library/concepts/component-development/hstcomponent-persistable-annotation-and-workflow.html

This works great and I can now programmatically add a document. The site is configured to have English and French, and I can go into the CMS editor and manually add a translation of the document that I added. However, I want this to also be done programmatically in the HST when I first add the document.

Basically when I add a new document (English) in the HST, I would like the translation node (French) to be created at the same time, just as it was done manually in the CMS.

Any ideas or pointers?

Thanks

Bert Leunis

unread,
May 2, 2013, 10:54:45 AM5/2/13
to hippo-c...@googlegroups.com
Two nodes that are translations of each other have the same value in the hippotranslation:id property. The hippotranslation:locale properties will be different for each node of course. The node should have the hippotranslation:translated mxin added. The value of the hippotranslation:id property can be any string. As long as you make sure that they are unique within your repository you can set it yourself.

I don't know if there is any code inside Hippo to support your work here.

If you are working with translations in your site, you might be interested in the new way translations are handled from 7.8.1, see [1].



Hope this helps! Regards, Bert
 

Thanks

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
Most Hippo developers are active here and/or follow the Stackoverflow [hippo-cms] tag.
 
The old Nabble archive can be found here: http://hippo.2275632.n2.nabble.com/Hippo-CMS-7-f2274273.html
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ard Schrijvers

unread,
May 3, 2013, 3:26:10 AM5/3/13
to hippo-c...@googlegroups.com
On Thu, May 2, 2013 at 4:54 PM, Bert Leunis <b.le...@onehippo.com> wrote:
>
> On Tue, Apr 30, 2013 at 12:52 AM, James <james....@ec.gc.ca> wrote:
>>
>> Ok, so I followed the instructions in the following link for adding a
>> document.
>>
>>
>> http://www.onehippo.org/7_8/library/concepts/component-development/hstcomponent-persistable-annotation-and-workflow.html
>>
>> This works great and I can now programmatically add a document. The site
>> is configured to have English and French, and I can go into the CMS editor
>> and manually add a translation of the document that I added. However, I want
>> this to also be done programmatically in the HST when I first add the
>> document.
>>
>> Basically when I add a new document (English) in the HST, I would like the
>> translation node (French) to be created at the same time, just as it was
>> done manually in the CMS.
>>
>> Any ideas or pointers?
>
>
> Two nodes that are translations of each other have the same value in the
> hippotranslation:id property. The hippotranslation:locale properties will be
> different for each node of course. The node should have the
> hippotranslation:translated mxin added. The value of the hippotranslation:id
> property can be any string. As long as you make sure that they are unique
> within your repository you can set it yourself.

But this should not be needed if he can use the same workflow
operation as the cms uses for creating a translation. So I guess he
needs to know which workflow to use from the HST pov.

Does anybody know which workflow the cms uses for this?

Regards Ard
--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Frank van Lankvelt

unread,
May 3, 2013, 4:04:56 AM5/3/13
to hippo-c...@googlegroups.com
for documents, that would be the TranslationWorkflow in the
'translation' category. Folders use the same workflow interface, but
then in the 'folder-translations' category.

cheers, Frank
Reply all
Reply to author
Forward
0 new messages