Search…

X3 Photo Gallery Support Forums

Search…
 
trpgforum
Experienced
Topic Author
Posts: 105
Joined: 05 Jul 2019, 03:40

Questions to date format and translation

29 Jul 2019, 02:27

Hello Karl

Since two weeks I'm at work on my website https://www.thomas-ruf.ch.

And what I can say: I'm very happy with Photo Gallery X3: Beautiful, fast and easy to work with! The best solution for me - thanks for this great work!

 But as it happens at work, some questions arise every now and then:
  1. In my  Blog https://www.thomas-ruf.ch/blog/ I hav ethe date format eg 2019-07-16. But in Switzerland, Germany and Austria that's the wrong Format. Here it must be shown 16.07.2019 (dd.mm.yyyy). Where can I change this format?
  2. In the main page of my galleries https://www.thomas-ruf.ch/fotogalerien/ is listened the count of images per Gallery. But the word Images is in english. Where can I translate, so that is standing here eg 105 Bilder or 105 Fotos?
Thans für help!

Kind regards
Thomas
THOMAS RUF PHOTOGRAPHY
Landscape - Nature - Macro
4132 Muttenz
Switzerland
www.thomas-ruf.ch
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

29 Jul 2019, 13:10

Hi Thomas, and thanks!
trpgforum wrote:In my  Blog https://www.thomas-ruf.ch/blog/ I hav ethe date format eg 2019-07-16. But in Switzerland, Germany and Austria that's the wrong Format. Here it must be shown 16.07.2019 (dd.mm.yyyy). Where can I change this format?
I am assuming you already changed the date format from Settings > Advanced > Date format?
Image

I assume it's now set to Y-m-d? You should be able to manually enter your own format after deleting the existing entry. To achieve 16.07.2019, you can just use d.m.Y:
Image
trpgforum wrote:In the main page of my galleries https://www.thomas-ruf.ch/fotogalerien/ is listened the count of images per Gallery. But the word Images is in english. Where can I translate, so that is standing here eg 105 Bilder or 105 Fotos?
It is not yet possible to easily translate the text like "images" in X3, because it is currently hardcoded. Until translations are included, you could use this Javascript fix. Add the following code into 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';
    }
  }
}
Just replace "Bilder" with the word you want to use.
 
trpgforum
Experienced
Topic Author
Posts: 105
Joined: 05 Jul 2019, 03:40

Re: Questions to date format and translation

30 Jul 2019, 02:19

Thank you so much Karl! 

That's unbelievably good, your support! Since big companies should learn from you ;-)

Joking aside: Could solve easily now both problems with your informations! 
The date format, however, I have now used d.m.20y, so I get 4-digit years displayed.

Best greetings from Switzerland
Thomas
THOMAS RUF PHOTOGRAPHY
Landscape - Nature - Macro
4132 Muttenz
Switzerland
www.thomas-ruf.ch
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

30 Jul 2019, 04:26

trpgforum wrote:The date format, however, I have now used d.m.20y, so I get 4-digit years displayed.
d.m.Y = 30.07.2019
d.m.y = 30.07.19

It should already output four-digit year when using UPPERCASE Y, while lowercase y represents two-digit year. Of course, your solution 20y should work also, but then you will need to change it when we get to the year 3000 :smile:
 
trpgforum
Experienced
Topic Author
Posts: 105
Joined: 05 Jul 2019, 03:40

Re: Questions to date format and translation

30 Jul 2019, 04:36

:joy:  :joy:  :joy:
THOMAS RUF PHOTOGRAPHY
Landscape - Nature - Macro
4132 Muttenz
Switzerland
www.thomas-ruf.ch
 
peterpan_0983
Posts: 4
Joined: 14 Aug 2020, 05:33

Re: Questions to date format and translation

14 Aug 2020, 05:46

trpgforum wrote:In the main page of my galleries https://www.thomas-ruf.ch/fotogalerien/ is listened the count of images per Gallery. But the word Images is in english. Where can I translate, so that is standing here eg 105 Bilder or 105 Fotos?
It is not yet possible to easily translate the text like "images" in X3, because it is currently hardcoded. Until translations are included, you could use this Javascript fix. Add the following code into 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';
    }
  }
}
Just replace "Bilder" with the word you want to use.
I'm experiencing the same topic here, would like to replace "images" with "Bilder" - but the workaround provided above doesn't seem to work for the menu items in a smart top bar menu/carousel, right? 
Or did I just mess something up (just copied/added the snippet as suggested above...), did something change vs. the time of this initial thread?

Looked into the code (with only very basic HTML/JS-skills), and the amount of images doesn't seem to be wrapped in an individual class here, so no clue if this can be fixed by JS at all?!

Anyway, this "images" looks pretty odd at this prominent place in an otherwise German page ;-) 
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

14 Aug 2020, 06:13

peterpan_0983 wrote:I'm experiencing the same topic here, would like to replace "images" with "Bilder" - but the workaround provided above doesn't seem to work for the menu items in a smart top bar menu/carousel, right?
I actually updated my answer in a different post:
viewtopic.php?f=14&t=10017#p45975

However, this would only cover "images" and "folders" in the main page content. As I understand, you want to translate the text in the topbar menu carousel? I would have to create a new snippet.
 
peterpan_0983
Posts: 4
Joined: 14 Aug 2020, 05:33

Re: Questions to date format and translation

03 Oct 2020, 17:39

Oh sorry, I got carried away from my testing by other stuff... but now I'm back on it ;-)

Thanks a lot for the quick reply, I updated the code snippet on my site with the one you linked above, and yes, this works (also) fine - but unfortunately doesn't hit the nail I'm hanging on: 

You understood it correctly, I try to tweak the topbar menu carousel. So I'm afraid this would require another snippet. I played around a little bit, modifying the one above, but don't get any further...
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

04 Oct 2020, 00:18

You removed the carousel from the menu?
 
peterpan_0983
Posts: 4
Joined: 14 Aug 2020, 05:33

Re: Questions to date format and translation

17 Oct 2020, 17:36

Hm, no, it should still be there...?! At least I see it under
http://root.steinrot.de/www/frontfokus/
Not sure what you were looking at?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

18 Oct 2020, 00:58

peterpan_0983 wrote:Not sure what you were looking at?
I don't know now, and I can't remember seeing that link. Anyway, instead of offering javascript hacks, I have decided to add basic language support in next X3 release. It should be available in 2-3 weeks!
 
peterpan_0983
Posts: 4
Joined: 14 Aug 2020, 05:33

Re: Questions to date format and translation

21 Oct 2020, 06:42

That sounds awesome  :blush:
Very much looking forward to it!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Questions to date format and translation

05 Jan 2021, 23:56

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 any custom Javascript code added previously, as it may cause errors.