Page 1 of 1

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

Posted: 19 Mar 2017, 14:03
by NatashaN
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!

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

Posted: 20 Mar 2017, 01:15
by mjau-mjau
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.

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

Posted: 20 Mar 2017, 03:23
by NatashaN
Thank you, Karl!
It works like a charm!

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

Posted: 20 Mar 2017, 10:13
by mjau-mjau
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'));
  });
}

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

Posted: 20 Mar 2017, 10:47
by NatashaN
It's perfect! Thank you!