Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
svenflock
Experienced
Topic Author
Posts: 34
Joined: 14 Oct 2019, 14:44

How to name the "images" caption at folders view

12 Jan 2020, 11:51

Hi!

I found a CSS example in your documentation how to rename the overlay caption at the comparison slider. I am curious if there is something for the folders view as well. It shows "images" and I want to translate it to my native language. Is there a CSS class to override?

Thank you.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: How to name the "images" caption at folders view

12 Jan 2020, 22:34

These items are currently hardcoded, but we will definitely make them translateable in a future release.

For now, you would have to use a Javascript-hack (posted here) to convert "images" to another language. Add the following to Settings > Custom > Custom Javascript:
Code
function x3_load_page(){
  var amounts = document.getElementsByClassName('amount');
  if(amounts.length){
    for(var i=0; i<amounts.length; i++){
      var span = amounts[i].children[0];
      var amount = parseInt(span.innerText);
      span.innerText = amount + ' Bilder';
    }
  }
}
 
User avatar
svenflock
Experienced
Topic Author
Posts: 34
Joined: 14 Oct 2019, 14:44

Re: How to name the "images" caption at folders view

13 Jan 2020, 04:20

Hi,

thanks for the hint.

I had to modify it a little bit as object "children" is of size 0, though. That one worked:
Code
/* Translate "images" to "Bilder" */
  var amounts = document.getElementsByClassName('amount');
  
  if(amounts.length){
    for(var i=0; i<amounts.length; i++){
      var desc = amounts[i].innerText;
      var newDesc = desc.replace('images', 'Bilder');
      amounts[i].innerText = newDesc;
    }
  }
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: How to name the "images" caption at folders view

05 Jan 2021, 23:54

I have now added native support for interface languages in X3.30.0. See forum post:
X3 interface translations [BETA] :de::fr::es::it:

PS! After updating, you should remove the custom Javascript code added previously, as it may cause errors.