On 21 Jun 2016, at 17:56, Anders Nylund wrote:
> The whole kotti/pyramid/sqlalchemy stack is completely new to me, but
> it
> looks like a neat system well worth learning.
It is! Welcome and don't hesitate to ask here or on IRC (#kotti on
Freenode).
> First roadblock is that it doesn't look like it's possible to select a
> language, instead you navigate to a language specific part of the
> tree.
> That works fine I suppose, but then the first page of the site is
> always
> some kind of 'select your language' page. Shouldn't it be possible for
> a
> visitor to select his language just once, and only change it if he
> really
> wants to?
Sure, you could add a view (and make it the default view of your root
object) which tries to get the user's preferred language from the
request (request.accept_language /
http://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request.accept_language),
redirect if your site has such a language and otherwise render a "select
language" template.
> Then when you navigate to a language root, the menu will show what's
> one
> level below the language root, but not the language root itself. To
> navigate back to the language root you then need navigate to the first
> page
> and select language again.
In the default templates the site name in the navbar links to the
navigation root, which is "the first page" of the language as soon as
you are "below" a language root (which also is a navigation root).
> Adding a calendar to a document below a language root and translating
> the
> calendar creates a copy on the second language branch, and then events
> can
> be created on both calendars and translated into the other, which
> works
> fine. But the calendar can't be added directly to the language root,
> only
> to a document below it. What if I want the calendar in the main menu?
You need to tell the calendar class, that its instances may be addable
to language roots. Something like this:
Calendar.type_info.addable_to.append('LanguageRoot')
> I found workarounds for most of these, I can modify the calendar addon
> to
> allow adding it directly to a language root, and I managed get the
> first
> page to forward to a selected language root if stored in the session,
> but
> it would be much neater if I could make the modifications as an
> override or
> something and not by modifying the existing code.
>
> So my question is mostly that since I'm new to this, have I
> misunderstood
> completely how to use the kotti_multilingual addon? Any pointers into
> the
> right direction would be appreciated.
No not at all. What you should do is to create a package with the
scaffold Kotti provides and put the customizations mentioned above into
that package. Then use the included ini file to run your application.
HTH,
Andreas