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

  1. Gallery 2.1 or Gallery 2.26 or above. It should work in lower version also but I have not tested it.
  2. Rewrite installed and enabled

Steps

  1. Download the multilangurl patch Gallery 2.6 above or for multilangurl patch Gallery 2.1
  2. Start your bash shell
  3. Run following command one by one
  4.    cd [G2 Install directory]
       patch -p1 < [patch path]multilangurl.patch
  5. 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.

  6. 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

2 Responses to “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”

  1. sascha Says:

    great, thank you, will try it

  2. Srini Says:

    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.

Leave a Reply