• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dual language website with data from db

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have decided to try to convert my personal website into a multilanguage website using a database for storing the content. I will display the content in norwegian and english and currently the selection of language is done with a session value.

The session value is set to english if it doesn't exit (default english).

When a user changes the language the appropriate content should be displayed.




The problem; Consider this scenario:

I have a jsp that handles changing language (setting session variable to preferred language), when someone clicks on "change language" that jsp is run and control is returned to the referring page (which now displays the content in a different language).


Why it could fail:
* A search engine decides to spider one of my pages.
* The session for the spider is initiated with english as the default language.
* When spidering a page, it stumbles upon a link for changing language.
* It stores that link with the other links on that page that it will spider
later.
* When the page has been spidered, the spider continues with the other links .
* One of these links is the "change language"-link.
* The spider tries to spider the page which changes selected language.
* This page changes language and returns control to the referring page sending the spider to the referring page.
* The spider does not spider this page again, since it has already been done, causing the alternative language content not to become indexed.


Do you see the problem?

In short -> A search engine will at most index my pages using only one language per page.

Using separate .jsp files for each language is not an option.


Any ideas anyone?
 
Kristian Breifossmo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since I didn't want to have separate .jsp files for each language I decided
to pass the change of language to the calling page itself.

Such as this:

page.jsp?language=en


The spider will (hopefully) treat the pages "page.jsp?language=en", "page.jsp" and "page.jsp?language=no" as different pages and thus indexing all of them.

I'm not a webspider expert so I wouldn't know for sure. I remember reading something about some spiders not indexing urls with "?" and "&"


Any comments on this approach?
 
reply
    Bookmark Topic Watch Topic
  • New Topic