Saturday, May 03, 2008

cross language via URL

I finished one small project, where I had to add possibility to change language. I did not find the best solution/way how to do it in Internet. So, I did it how I wanted :)
In my case I had documents in database (=> HTML pages) with content. So, I added in every document (HTML's page) new fields with different content (for different language). I put content in different fields: content_en, content_it, content_ru... For opening document in every language I used next approach, look at these URL:
http://host/db.nsf/EN/F593D4CBD7E802FFC125742500638A22?opendocument
http://host/db.nsf/RU/F593D4CBD7E802FFC125742500638A22?opendocument
http://host/db.nsf/IT/F593D4CBD7E802FFC125742500638A22?opendocument

Then I added agent on QO event, and checked the name of "view" (EU/RU/IT), then took it and used it when I received content => "content_" & language.

No comments :