I am new to Drupal world and creating a site in Urdu language in Drupal 8. I have enabled its multilingual support and set default language to Urdu (in fact, this is the only language of the site).

I have created a content type and enabled to show Display author and date information. I have also added some contents for this content type. When I go to view some content, its author and date information is displayed as below.

Submitted by mabilalmirza on Fri, 02/09/2018 - 23:33

I know I can translate the string using translation interface but I want the day name to be shown in Urdu. I want to translate month names as well for long date format.

Can anyone guide me to accomplish this?


You can translate Interface strings through Configuration > Regional and language > User interface translation (/admin/config/regional/translate).

Enter "Submitted by" into the "String contains" search field. It's important to enter correct capitalization of letters or your string won't be found (don't enter "submitted by").

Your search will find this string to translate:

Submitted by @author_name on @date

As you can see you can translate part of the message that doesn't contain tokens for data (you need to copy @author_name and @date into your translation so the text makes sense, don't translate "author_name" or "date", leave them in English as they are!).

Dates are special formats in Drupal, with special translation options.

You can translate Date formats by going to Configuration > Regional and language > Date and time formats (/admin/config/regional/date-time).

The one being used for "Submitted by" text is "Default medium date". Choose Translate in the drop-down next to Edit button.

Here you only configure how dates are usually structured in your language (maybe something like D, d/m/Y - H:i in your case for the Default medium format, to have the day before the month).

Month and Day name translations will probably already be available from Drupal Localization project, but if you see they aren't translated you can translate them yourself through the User interface translation page.

If you don't see some of the options mentioned here, make sure you have enabled all translation modules, including "Configuration translation".

  • It didn't work for me.I did all the same earlier, translated the Submitted By ... string keeping the tokens intact, Updated date formats from configuration translations, and translated day and month names from User interface translations (these were not translated for Urdu in Drupal Localization Project). And yes, all translation related modules are installed. Jun 18 '18 at 7:18
  • What is your Languages configuration? What is the chosen interface language you're visiting a page with? What Language is the page set in? Is the "Submitted by" string the only thing that isn't showing up as translated?
    – prkos
    Jun 18 '18 at 17:04
  • Site's only language is Urdu, so every interface page I visit is in urdu language as most of the labels are in Urdu, and site direction is RTL. Submitted by... string is translated to Urdu except the value shown by @date token. Jun 19 '18 at 20:55
  • I created a new site just to play around and added French. Site is correctly showing day names in french. After adding Urdu in same site and with same steps, day names are not shown translated. Jun 19 '18 at 20:58
  • I tried changing the date format for Urdu, it gets reflected but day names are still shown in English. Jun 19 '18 at 21:04

To translate month labels (in Drupal 9 at least) search for the next string on /admin/config/regional/translate page:

January: January February: February March: March April: April May: May June: June July: July August: August September: September October: October November: November December: December

and translate it like English_January_month_name: translated_month_name ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.