PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 31, 2022

[FIXED] How can I translate the days and months with Poedit?

 August 31, 2022     php, poedit     No comments   

Issue

I use Poedit to translate my website but I am stuck on how to translate the days of the week and the months if I display them with php like this:

$day_of_week_in_words->format("l")


Solution

If your server has the LC language library you can simply use php functions without any poedit interactions You can find the details here strftime simple examples:

setlocale(LC_TIME, "fi_FI");
echo strftime(" in Finnish is %A,"); //%A means A full textual representation of the day    Sunday through Saturday
setlocale(LC_TIME, "fr_FR");
echo strftime(" in French %A and");
setlocale(LC_TIME, "de_DE");
echo strftime(" in German %A.\n");


Answered By - Santa's helper
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing