Re: FlatPage and Internationalization

2007-11-27 Thread Marcin Kaszynski

On Nov 27, 11:10 am, Tim <[EMAIL PROTECTED]> wrote:
> For multilingual sites, is it not easier to maintain and keep all the
> translations in .po files? The idea of splitting up the required
> translations would mean that translators must use two different
> interfaces.

Well, those are two different sets of translators :)

It is the difference between code and content.  The .po files, just
like template files and all texts hardcoded in models and views and,
are 'code' and flatpages are usually the 'content' of your site.  The
latter are supposed to differ for separate installations of your app,
safer, changeable without modifications to the application code,
without risking breaking anything and thus editable by a larger group
of people.  This difference should be passed on to translations as
well.

I realize this line may be blurry in some cases, but a good way of
discovering where it goes is to think about using your app or project
as a base for two different sites.

As for the original question, there is at least one app that gives you
flatpages with translations, based on django.contrib.flatpages and
midified to use django-multilingual (http://code.google.com/p/django-
multilingual/issues/detail?id=30); I did not have the time to add it
to the multilingual library yet (unfortunately, this is where the "as
time permits" part kicks in), but hope to do so soon.  Should be
simple to install and try out and I would be happy to have some
feedback on what and how it does :)

-mk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FlatPage and Internationalization

2007-11-27 Thread Tim

For multilingual sites, is it not easier to maintain and keep all the
translations in .po files? The idea of splitting up the required
translations would mean that translators must use two different
interfaces. There are frameworks for translating .po files that keep
revisions, suggestions etc. These would not be available. Do you think
it would be possible to have the contents of flatpages parsed by the
template parser before being displayed? If the scripts that generate
the .po files could also parse these, translations could be maintained
at a single point. I have never looked at the django code before so I
don't know what's viable.

On second thoughts it seems what I'm proposing is to store flat pages
as templates in a database so they are easily editable. Hmmm, maybe
that's not such a good idea after all.

What are your opinions on this?

Cheers,
Tim

On Nov 9, 3:19 pm, DvD <[EMAIL PROTECTED]> wrote:
> That's what i am about to do, but if guys from the development team
> agree we could implement it in the official django code
>
> On Nov 9, 3:34 pm, Eugene Morozov <[EMAIL PROTECTED]> wrote:
>
> > I've implemented similar system. Only I have used MyFlatPage and
> > MyFlatPageTranslation models, because it makes easier to locate and
> > translate pages in the admin interface.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FlatPage and Internationalization

2007-11-09 Thread DvD

That's what i am about to do, but if guys from the development team
agree we could implement it in the official django code

On Nov 9, 3:34 pm, Eugene Morozov <[EMAIL PROTECTED]> wrote:
> I've implemented similar system. Only I have used MyFlatPage and
> MyFlatPageTranslation models, because it makes easier to locate and
> translate pages in the admin interface.
>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FlatPage and Internationalization

2007-11-09 Thread Eugene Morozov

I've implemented similar system. Only I have used MyFlatPage and
MyFlatPageTranslation models, because it makes easier to locate and
translate pages in the admin interface.

On 9 нояб, 15:25, DvD <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> lately i was trying to internationalize a wesite which had flatpages,
> but i also needed to translate those pages so i came up with this idea
> to get site specific AND language specific flatpages.
>
> I put on the FlatPage class this attribute:
>
> 
> language= models.CharField(maxlength= 7, choices= settings.LANGUAGES)
> 
>
> and in the view i modified this line
>
> 
> f = get_object_or_404(MyFlatPage, url__exact=url,
> sites__id__exact=settings.SITE_ID)
> 
>
> to look like this
>
> 
> if = get_object_or_404(MyFlatPage, url__exact=url,
> sites__id__exact=settings.SITE_ID, language= request.LANGUAGE_CODE)
> 
>
> What do you think? With this changes, you'll be able to retrieve site
> specific and language specific flatpages.
>
> While i was thinking about, it 've been wondering why no one else ever
> thought about it and I thought it'd been a good idea to share this
> code.
>
> What do you think? Could it be an upgrade for django flatpages module?
> Did I miss something or someone else already thought about it?
> Let me know.
>
> Cheers,
> David


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: FlatPage and Internationalization

2007-11-09 Thread DvD

Sorry, that shouldn't be MyFlatPage but just FlatPage...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---