Before you ask please READ THIS

Multilingual Translation for Photon WordPress Theme [SOLVED]

edited August 2015 in Photon Posts: 2
Hello.

I was trying to translate the Photon theme to fit it with a Multilingual WordPress website.

Photon WP Theme Translate

By regular, in order to translate almost any WP Theme from English to other languages, we need to use a translation editor such as Poedit Software or Loco translation WP Plugin.
(for more information see How to translate Wordpress Theme)

So far... all(most) good

The Photon WP theme has 2 files located in the "languages" folder and in the "languages/admin" folder.
By translating those files, you can get a Multilingual result of a translated version for UI and Admin UI...
Almost.... 100%... but then i found a small problem...

The Problem with lightGallery

The translation editor can solve many things but one thing I couldn't control with the translation editor, it was the JQuery LightGallery, the sliding gallery that shows the media after you click an item on the single album...

image
Inside a single album, by clicking an image or a video single item the file will be displayed using the jQuery lightGallery and under each item there's a small thumbs button that opens a thumb-menu of the album showing the rest of the items.

Now, here is how the problem looks like:
image

As you can see, there is a text label: "All Photos" on the light gallery thumbs menu - which the translation won't effect it.
So... I need to hack this somehow, by going to the directory of the theme I found a few files in the javascript folder.
Here: wp-content/themes/photon-a13/js/light-gallery/js/lightGallery.js

I can see this:

lang: {
allPhotos: 'All photos'
},

And i was hoping this will solve the issue but it looks like the theme is using the light versions of the lightgallery (light-gallery/js/lightGallery.min.js)

My questions:
(I will be happy even with one answer for the second question)

1. How to control which "LightGallery" version is loaded (min / full)? (see answer below)

2. How to Change the "All Photos" to what ever i want to...? (see answer below)
(hack will be fine for me right now)

3. Is there any option to insert the "lang" settings in the ".min" version?
please let me know how... (JavaScript is like English for me... takes too much time to handle it right)

Regards.
Clipboard03.png
153 x 71 - 755B
Clipboard01.jpg
1219 x 744 - 117K
Post edited by David on

Comments

  • edited August 2015 Posts: 2
    OK, I found the answer for my first and second questions:

    By opening the file located here:
    themes/photon-a13/advance/head_scripts_styles.php

    It's possible to change the javascript file which is loading the gallery (light gallery), so to be able to control the settings of the light gallery we need to load the full .js file, just...

    Replace this code:
    //lightGallery lightbox
    wp_register_script( 'a13-lightGallery', A13_TPL_JS . '/light-gallery/js/lightGallery.min.js', array('jquery'), '1.1.4', true);

    with this one:
    //lightGallery lightbox
    wp_register_script( 'a13-lightGallery', A13_TPL_JS . '/light-gallery/js/lightGallery.js', array('jquery'), '1.1.4', true);

    Then, it's possible to change the "All photos" from the file in here:
    wp-content/themes/photon-a13/js/light-gallery/js/lightGallery.js

    Code:
    lang: {
    allPhotos: 'Album media'
    },

    Result:


    Clipboard05.jpg
    161 x 105 - 3K
    Post edited by David on
  • AirAir
    Posts: 10,970
    Hell there:-)

    Firs of all : great posts, I have never seen posts written so clearly here on forum. Well organized !

    I believe I can add this to some configuration of lightGallery so it could be translated through poedit or WPML.
    I will check it soon.

    Thanks for pointing this out!

    Have a great day.
  • AirAir
    Posts: 10,970
    OK, fixed, it will be released in today update. Should be available in few hours on ThemeForest.

    Thanks again.

    With kind regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion