Search…

X3 Photo Gallery Support Forums

Search…
 
NatashaN
Topic Author
Posts: 5
Joined: 22 Feb 2017, 07:45

How to translate the word(s) : Album(s)

19 Mar 2017, 14:03

Hello, Karl!
I want to replace/and/translate the word "Album" (folders_amount).
I've opened the file: module.folders.html and module.context.html (inside templates/partial) and found 'Album', 'Albums' which I replaced with the relative word in greek.
[module.folders.html, line: 103, line 189, line 210 and module.context.html, line: 47 and line 108].
However, in my gallery, the word "Albums" still appears.

Any suggestion, please?
Thank you in advance!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: How to translate the word(s) : Album(s)

20 Mar 2017, 01:15

Sorry, you can't just edit templates like that any more, since templates are now pre-rendered.

Here is a temporary fix until we add proper language support. Add to settings -> custom -> javascript:
Code
function x3_load_page(){
  var el = $('#content').find('.folder_amount > span');
  el.text(el.text().replace('albums', 'XX').replace('album', 'X'));
}
We will add basic language support some time soon.
 
NatashaN
Topic Author
Posts: 5
Joined: 22 Feb 2017, 07:45

Re: How to translate the word(s) : Album(s)

20 Mar 2017, 03:23

Thank you, Karl!
It works like a charm!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: How to translate the word(s) : Album(s)

20 Mar 2017, 10:13

Sorry, I see now the above code is not entirely correct if there are multiple texts to replace. Use this instead:
Code
function x3_load_page(){
  var elements = $('#content').find('.folder_amount > span');
  elements.each(function() {
    var el = $(this);
    el.text(el.text().replace('albums', 'XX').replace('album', 'X'));
  });
}
 
NatashaN
Topic Author
Posts: 5
Joined: 22 Feb 2017, 07:45

Re: How to translate the word(s) : Album(s)

20 Mar 2017, 10:47

It's perfect! Thank you!