How to multilingualize or localize URL in Gallery2 – enhancement of multilang module to create multilingual URLs, Multi-language URL for SEO with Multi Language Module
Now you can make your Gallery2 URLs multi-language…
How to do it?
This you can do by enhancing gallery2 multlang module. After that you will have the edit photo multlang screen appear as below. Through the highlighted URL field you can enter pathComponent for the chosen language.
Prerequisites
- Gallery 2.1 or Gallery 2.26 or above. It should work in lower version also but I have not tested it.
- Rewrite installed and enabled
Steps
- Download the multilangurl patch Gallery 2.6 above or for multilangurl patch Gallery 2.1
- Start your bash shell
- Run following command one by one
-
cd [G2 Install directory] patch -p1 < [patch path]multilangurl.patch
- Run the following SQL in phpMyAdmin(or any other) for your Gallery2 Database
ALTER TABLE `DB_TABLE_PREFIXMultiLangItemMap` ADD `DB_COLUMN_PREFIXpathComponent` VARCHAR( 128 )
note: DB_TABLE_PREFIX and DB_COLUMN_PREFIX, are the prefix for table and column that you have specified. If you are not sure about it, open the config.php file under the gallery2 install directory and look for $storeConfig['tablePrefix'] and $storeConfig['columnPrefix'] value for it.
- Deactivate and then activate your multilang module once. This is to update Schema table.
That’s all…
To verify your changes (Assuming that you have configured for multiple languages)
- Click on Edit photo for a photo
- Go to multlang tab
- Enter values to fields including URL field
- Change your preference to the language you have entered values
- Now the photos link should have the URL value that you entered
Now if you want to update the pathComponent (i.e. URL value) for all the existing items then you can run the following SQL command. This command sets the pathComponent same as title, replacing the spaces with a underscores (_) and appending it with ‘.jpg’:
UPDATE DB_TABLE_PREFIXMultiLangItemMap SET DB_COLUMN_PREFIXpathComponent = CONCAT(REPLACE(DB_COLUMN_PREFIXtitle, ' ', '_'), '.jpg')
For any problem or questions, you can place a comment on this post. I will answer it ASAP.
Recent Entries
- zFeeder – Making PHP 5.3 + compatible, solving ‘Function ereg_replace() is deprecated’
- How to multilingualize or localize URL in Gallery2 – enhancement of multilang module to create multilingual URLs, Multi-language URL for SEO with Multi Language Module
- Fix for mergelog, fails with error “abort due to a problem” for dummy records of apache access logs
- Shepherds life in mountain
- The modern marriage culture among mate
- Do you know that barter system still exists in most villages in uttarakhand, may be true for many other parts of India also
- How to catch copy paste from explorer using shell extension? ICopyHook alternative for files and folder
- How to convert ASCII/UNICODE string to hex string? Function/API to convert to hex string
- How to solve ‘ReadFile hangs’ for named pipe client/server – sample working code for named pipe
- Finally on 19th day at 8pm we reached Badrinath
December 25th, 2009 at 7:43 am
great, thank you, will try it
December 26th, 2009 at 7:01 am
A bug not related to your gallery2 but please see the top most search button in your home page, there is no search/go button.