Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Show date in a local language

  • elissa
  • elissa's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228008 by elissa
Show date in a local language was created by elissa
Please help us help you and fill where relevant:
Your LimeSurvey version: [3.28.9+]
Own server or LimeSurvey hosting: own
Survey theme/template: fruity
==================
I need to insert a dynamic date to the question text and I can do it using the "date" function. But I need the date to show in Polish.
The example in English is: "During the last week, i.e. since {date("l, d-m-Y",strtotime("now")-604800)}", which today is shown as: "During the last week, i.e. since Wednesday, 27-04-2022". Instead "Wednesday" I need Polish translation (środa). I need to do the same with months: "During last year i.e. since {date("F Y",strtotime("now")-31104000)}".

Even if the language of the survey is Polish the dates are shown in English.
If you think that a sample .lss may help, I'll attach it. Thank you.
Elzbieta

Elzbieta Lesinska
LS voluntary Polish translator and supervisor

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228014 by holch
Replied by holch on topic Show date in a local language
Not an expert, but here they seem to discuss exactly what you need:

stackoverflow.com/questions/18068785/pol...s-in-date-formatting

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: elissa

Please Log in to join the conversation.

More
1 year 11 months ago #228036 by jelo
Replied by jelo on topic Show date in a local language
This is a missing feature. There were threads before about the missing languages in the date/time display.
forums.limesurvey.org/forum/can-i-do-thi...er-selected-language

LimeSurvey would need to expose the PHP function intldateformatter.
www.php.net/manual/en/intldateformatter.format.php

The whole exposing of PHP functions take place in em_core_helpes. Not sure if LS3 would receive new features.
But a look in the code illustrate that exposing functions often are only a few lines of code.
github.com/LimeSurvey/LimeSurvey/blob/97...s/em_core_helper.php

A workaround for one language would be to translate the 12 months and 7 days via Expressionscript. A lot of code

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: elissa

Please Log in to join the conversation.

  • elissa
  • elissa's Avatar Topic Author
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #228039 by elissa
Replied by elissa on topic Show date in a local language
Thank you both for the answers. I don't think I am able do the coding myself, so I will need to live without the names of days and months and stay only with numbers :-).

Elzbieta Lesinska
LS voluntary Polish translator and supervisor

Please Log in to join the conversation.

More
1 year 11 months ago #228040 by jelo
Replied by jelo on topic Show date in a local language
A feature request would be fine. Exposing PHP functions is mostly a passing through. The amount of code seems to be low to get this done. No GUI needed. No external libs. Just PHP towards ExpressionScript.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose