Answers.Body: <p>Your server must support the requested locale (ex: <code>fr_FR.utf8</code>).</p>
  <p>On Debian-based systems, as root (administrator), you can enable it with:</p>
  <pre><code>dpkg-reconfigure locales
  </code></pre>
  <p>and then enable the locale. It does not need to be set as default. It will require restarting Apache or php-fpm.</p>
  <p>To find out more, you can check in <code>CRM/Utils/Date.php</code>, the <code>getFullMonthNames</code> function basically does this:</p>
  <pre><code>  public static function &amp;getFullMonthNames() {
      static $fullMonthNames;
      if (!isset($fullMonthNames)) {
  
        // set LC_TIME and build the arrays from locale-provided names
        CRM_Core_I18n::setLcTime();
        for ($i = 1; $i &lt;= 12; $i++) {
          $fullMonthNames[$i] = strftime('%B', mktime(0, 0, 0, $i, 10, 1970));
        }
      }
      return $fullMonthNames;
    }
  </code></pre>
  <p>and this is what is used to replace the <code>%B</code> or <code>%b</code> placeholders in the date format settings.</p>
  <p>There are two areas where we could definitely improve CiviCRM:</p>
  <ol>
  <li><p>in that function, it would seem fine by me to replace that code with a hardcoded list of months, which would be sent to translation using <code>ts('January')</code>. Many people do not have root access to their hosting.</p>
  </li>
  <li><p>when installing into a specific language, automatically configure those settings because they are the worst possible treasure hunt in the world. There is an issue here, and the worst is mostly done, but just needs a bit of energy to get past the finish line: <a href="https://lab.civicrm.org/dev/translation/-/issues/1" rel="nofollow noreferrer">https://lab.civicrm.org/dev/translation/-/issues/1</a></p>
  </li>
  </ol>
  <p>If you are interested to contribute, please join the <a href="https://chat.civicrm.org/civicrm/channels/translation" rel="nofollow noreferrer">translation channel</a> or the <a href="https://chat.civicrm.org/civicrm/channels/francophone" rel="nofollow noreferrer">francophone channel</a>. You can ping me on there too (@bgm), I also speak French.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-16T14:07:43.200Z
Answers.Text: Thank you, that solved it for me. Though an easier path for most Civi users would likely be appreciated as you outline.
Answers.UserDisplayName: kapn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-16T15:52:10.190Z
Answers.Text: Opened an issue here: https://lab.civicrm.org/dev/translation/-/issues/71
  Pull request: https://github.com/civicrm/civicrm-core/pull/21157
Answers.UserDisplayName: bgm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-10T20:25:45.337Z
Answers.LastActivityDate: 2021-08-10T20:25:45.337Z
Answers.UserDisplayName: bgm
Body: <p>My site is multilingual (English and French) and built on WordPress.
  I have an event page which is translated. I get the right page version when I use lcMessages=(en_CA|fr_CA) in the URL. However, the date is always uses English month and day names regardless of the interface language. How do I fix this? I would have thought that this is something that would happen automatically in the multilingual site.</p>
  <p>Screenshot of French labels and English date:</p>
  <p><a href="https://i.sstatic.net/M4TFD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M4TFD.png" alt="enter image description here" /></a></p>
  <p>UPDATE: I posted some questions in what I thought was the developer area related and was met with silence. I can't believe no one else cares about this. Or maybe only I am having a problem. I'd really like to work on this, so if anyone has any direction on who to talk to to find the module maintainer to offer assistance, I'd appreciate it.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-25T16:33:47.280Z
Comments.Text: A similar problem for receipts came up a few months ago but there was no definitive solution. It seems like it works for some people but not others. https://civicrm.stackexchange.com/questions/34521/date-in-english
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-25T18:48:51.310Z
Comments.Text: Is it a setting in localisation, settings - date?
Comments.UserDisplayName: HanV
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-29T08:08:44.750Z
Comments.Text: I have the same issues on all our CiviCRM sites. It's always mixed: 1 April 2020... I think there's a major improvement to be done in the code to help the internationalization work fine and unfortunately except complaining I can't really help :-/
Comments.UserDisplayName: Guillaume Sorel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-13T17:11:38.807Z
Comments.Text: Your update says you posted somewhere. Where did you post? There's chat.civicrm.org where there's a translation channel, and if you're able to reproduce it on https://dmaster.demo.civicrm.org then you can make a ticket at lab.civicrm.org.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-13T19:27:44.410Z
Comments.Text: Thanks @demerit I'll try that channel. I don't remember exactly where because it was several weeks back. I know I went through a process of wading through the code to find the likely function and I hope I have notes somewhere. I didn't post in translation because the issue was with the date code simply not displaying the correct language. I think I posted in the relevant dev channel on chat as well as in lab, but I'm feeling unclear at this point. I'll try again in translation. Thanks again.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-12T19:22:06.073Z
Comments.Text: I'm looking to get involved in fixing this. 
  I'm presuming that the issue is that the date content is coming from MySQL/MariaDB. It looks like it's possible to set @@lc_time_names for an individual connection without changing the server. I am going to do some local testing to confirm that, and see if I can patch my own code. Then I just have to figure out how to offer a patch.
Comments.UserDisplayName: kapn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-12T19:48:21.473Z
Comments.Text: I have done a little exploring in civicrm/CRM/Core/I18n.php and /civicrm/CRM/Utils/Date.php  and found that the methods seem to be locale aware, but appear to use a more global locale (CiviCRM default, Wordpress default, or maybe System). I think I'll try to fiund the bug-reporting system and codebase to see if I can find a little guidance and maybe propose a patch there.
Comments.UserDisplayName: kapn
Tags: <dates><multilingual>
Title: Date in English even when page is set to french
ThreadText: # Date in English even when page is set to french
  
  (Asked by: username_0 on 2020-04-24)
  
  My site is multilingual (English and French) and built on WordPress.
  I have an event page which is translated. I get the right page version when I use lcMessages=(en\_CA|fr\_CA) in the URL. However, the date is always uses English month and day names regardless of the interface language. How do I fix this? I would have thought that this is something that would happen automatically in the multilingual site.
  
  Screenshot of French labels and English date:
  
  [![enter image description here](https://i.sstatic.net/M4TFD.png)](https://i.sstatic.net/M4TFD.png)
  
  UPDATE: I posted some questions in what I thought was the developer area related and was met with silence. I can't believe no one else cares about this. Or maybe only I am having a problem. I'd really like to work on this, so if anyone has any direction on who to talk to to find the module maintainer to offer assistance, I'd appreciate it.
  
  **Tags:** dates, multilingual
  
  > **Comments:**
  > **username_1**: A similar problem for receipts came up a few months ago but there was no definitive solution. It seems like it works for some people but not others. https://civicrm.stackexchange.com/questions/34521/date-in-english  
  > **username_2**: Is it a setting in localisation, settings - date?  
  > **username_3**: I have the same issues on all our CiviCRM sites. It's always mixed: 1 April 2020... I think there's a major improvement to be done in the code to help the internationalization work fine and unfortunately except complaining I can't really help :-/  
  > **username_0**: I'm looking to get involved in fixing this.  I'm presuming that the issue is that the date content is coming from MySQL/MariaDB. It looks like it's possible to set @@lc_time_names for an individual connection without changing the server. I am going to do some local testing to confirm that, and see if I can patch my own code. Then I just have to figure out how to offer a patch.  
  > **username_0**: I have done a little exploring in civicrm/CRM/Core/I18n.php and /civicrm/CRM/Utils/Date.php  and found that the methods seem to be locale aware, but appear to use a more global locale (CiviCRM default, Wordpress default, or maybe System). I think I'll try to fiund the bug-reporting system and codebase to see if I can find a little guidance and maybe propose a patch there.  
  > **username_1**: Your update says you posted somewhere. Where did you post? There's chat.civicrm.org where there's a translation channel, and if you're able to reproduce it on https://dmaster.demo.civicrm.org then you can make a ticket at lab.civicrm.org.  
  > **username_0**: Thanks @demerit I'll try that channel. I don't remember exactly where because it was several weeks back. I know I went through a process of wading through the code to find the likely function and I hope I have notes somewhere. I didn't post in translation because the issue was with the date code simply not displaying the correct language. I think I posted in the relevant dev channel on chat as well as in lab, but I'm feeling unclear at this point. I'll try again in translation. Thanks again.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2021-08-10. Score: 3 | Accepted answer
  
  Your server must support the requested locale (ex: fr_FR.utf8).
  On Debian-based systems, as root (administrator), you can enable it with:
  dpkg-reconfigure locales
  
  and then enable the locale. It does not need to be set as default. It will require restarting Apache or php-fpm.
  To find out more, you can check in CRM/Utils/Date.php, the getFullMonthNames function basically does this:
    public static function &getFullMonthNames() {
      static $fullMonthNames;
      if (!isset($fullMonthNames)) {
  
        // set LC_TIME and build the arrays from locale-provided names
        CRM_Core_I18n::setLcTime();
        for ($i = 1; $i <= 12; $i++) {
          $fullMonthNames[$i] = strftime('%B', mktime(0, 0, 0, $i, 10, 1970));
        }
      }
      return $fullMonthNames;
    }
  
  and this is what is used to replace the %B or %b placeholders in the date format settings.
  There are two areas where we could definitely improve CiviCRM:
  
  in that function, it would seem fine by me to replace that code with a hardcoded list of months, which would be sent to translation using ts('January'). Many people do not have root access to their hosting.
  
  when installing into a specific language, automatically configure those settings because they are the worst possible treasure hunt in the world. There is an issue here, and the worst is mostly done, but just needs a bit of energy to get past the finish line: https://lab.civicrm.org/dev/translation/-/issues/1
  
  
  If you are interested to contribute, please join the translation channel or the francophone channel. You can ping me on there too (@username_4), I also speak French.
  
  > **Comments:**
  > **username_0**: Thank you, that solved it for me. Though an easier path for most Civi users would likely be appreciated as you outline.  
  > **username_4**: Opened an issue here: https://lab.civicrm.org/dev/translation/-/issues/71 Pull request: https://github.com/civicrm/civicrm-core/pull/21157  
  
  ---
  
  