Guidance needed to write a module to multilingualize URLs
gopu
Joined: 2009-08-28
Posts: 137 |
Posted: Thu, 2009-12-03 12:39 |
Hello, I would like to develop (or enhance the existing multilang) module that will enable user to have multilingual URLs for items, with rewrite module enabled. Quote:
http://mysite.com/galería/v/rosa/hermosa_rosa.html Can somebody please give me some pointer to go about to implement it? Any vague idea also will help me... thanks ------------- |
|
Posts: 137
Hello,
Finally, I could enhance the multilang module to implement the above feature.
Check out:
But I needed some very minor changes in Rewrite and Core module. See point (2) and (6) below...
May be its possible to avoid theses changes in these module... I would need help in doing so.
This is what I did to implement it:
1. Added one column pathComponent to the MultiLangItemMap table
2. Made changes in RewriteSimpleHelper::loadItemIdFromPath to get the ID from path using MultilangExtHelper::fetchItemIdByPath instead of GalleryCoreApi::fetchItemIdByPath
3. MultilangExtHelper::fetchItemIdByPath is same as GalleryCoreApi::fetchItemIdByPath, except that it uses MultilangExtHelper::fetchChildIdByPathComponent to get the ID when GalleryCoreApi::fetchChildIdByPathComponent fails as below:
MultilangExtHelper::fetchChildIdByPathComponent fetches the ID from the[ b]MultiLangItemMap[/b] table
4. Changed multilang GalleryOnLoadHandler handler to set the pathComponent, besides title, summary and description when the view is not core.DownloadItem
5. Corresponding UI changes
6. Needed to comment out the following code in DownloadItemView::renderImmediate
This is because the filename in request variable and the filename that we get through multilang is different for different languages.
If you have thorough knowledge of gallery2 I request please let me know if these changes can be avoided in rewrite and core module, if yes how?
---------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God