odyaka341 / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Language-specific content does not load in admin #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have installed a fresh instance of django-page-cms from trunk.  I have
the following settings enabled:

...
LANGUAGE_CODE = 'en-us'
...
PAGE_LANGUAGES = (
    ('en-us', gettext_noop('English')),
)
...

I can create a new page in the admin, populating all of the values for
English, save the page, and view the content on the site.  When I go back
into the admin and click on the page title, resulting in the URL
http://127.0.0.1:8000/admin/pages/page/1/, the page loads but none of the
fields are populated.  If I go back to the admin and click on the page's
language, resulting in the URL
http://127.0.0.1:8000/admin/pages/page/1/?language=en-us, the page loads
with the fields populated.

I then dropped my database and changed my settings to:

...
LANGUAGE_CODE = 'en-us'
...
PAGE_LANGUAGES = (
    ('en', gettext_noop('English')),
)
...

I create another page in English and view the page on the site.  I then go
back into the admin and click on the page title, resulting in the URL
http://127.0.0.1:8000/admin/pages/page/1/, and the page detail admin loads
with the fields populated.  If I go back to the listing page and click on
the language, the resulting URL
http://127.0.0.1:8000/admin/pages/page/1/?language=en loads and displays
the values as well.  I'm guessing your populating the default language with
a hard coded 'en' and that is not loading when I am using the 'en-us' values.

Original issue reported on code.google.com by tjurew...@gmail.com on 5 Mar 2009 at 3:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for the detailed report.

Languages described with more than 2 characters are not really working now. 
Will see
today if I can found a solution for this.

Original comment by batiste....@gmail.com on 5 Mar 2009 at 9:52

GoogleCodeExporter commented 9 years ago
The revision 392 should fix quite everything:

http://code.google.com/p/django-page-cms/source/detail?r=392

Can you test it?

Original comment by batiste....@gmail.com on 7 Mar 2009 at 11:32

GoogleCodeExporter commented 9 years ago
I have tested with a fresh install and I am still seeing the same behavior.  
Again, I
am using the following settings:

...
LANGUAGE_CODE = 'en-us'
...
PAGE_LANGUAGES = (
    ('en-us', gettext_noop('English')),
)
...

Please let me know if I should not be using the 'en-us' value for 
PAGE_LANGUAGES. 
When I use just 'en', the bug goes away, but I thought the functionality was 
there to
support 5 character values.

When I go to create a new page, I can populate all of the values and save the 
page. 
But when I click on the page title in the listing, I see the page detail with 
none of
the values populated (I have attached a screenshot called "no-values.png").  

Then, if I go back to the listing and click on the page language under 
translations
("en-us"), I go to a page detail with the values populated (I have attached a
screenshot called "with-values.png").  Notice the URL when I click on the 
translation
is http://127.0.0.1:8000/admin/pages/page/1/?language=en-us, which includes the
explicit language "en-us".

My theory is that whatever JS you are using to populate the values in the page 
detail
in the admin is limited to the 2 character language code "en" and defaults to 
that
value when you click on the title.  But if I click on the translation, the JS 
code
uses the passed URL parameter to display the values.

I do not have time to debug the JS or admin at this time, but I can look into 
it 
late next week if you have not been able to recreate this issue or debug.

Original comment by tjurew...@gmail.com on 7 Mar 2009 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
What is the value of your LANGUAGES setting?

Original comment by batiste....@gmail.com on 8 Jun 2009 at 2:16