Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

String

8 sites Security covered
View on drupal.org

This module provides a way to manage and translate strings in Drupal using a "keyword" philosophy. Developers can define keywords with optional default values, which then integrate with Drupal's core translation system for easy translation management.

A Drupal module for managing and translating strings using "Keyword" philosophy.

t('Drupal is great');

t('drupal.great');

In the first method, messages are written in the language of the default locale (English in this case). That message is then used as the "id" when creating translations.

In the second method, messages are actually "keywords" that convey the idea of the message. The keyword message is then used as the "id" for any translations. In this case, translations must be made for the default locale (i.e. to translate drupal.great to Drupal is great).

String enables developers to,

  • define Keyword (i.e. drupal.great)
  • optionally provide a default value Drupal is great
  • integrate with core's translation api so that it works well with t function, locale import/export, editing interface translation, etc.

Documentation

For detailed documentation, please visit our documentation site.

Quick Links

Support

Sample usage

Current (Core) String t('Dashboard') t('dashboard.title') t('My Dashboard') t('user_dashboard.title') t('Welcome @name!', ['@name' => $name]) t('dashboard.welcome_message.title', ['@name' => $name]) format_plural($count, '1 item', '@count items') format_plural($count, 'search_result.item_count', 'search_result.item_count')

Activity

Total releases
6
First release
May 2025
Latest release
9 months ago
Releases (12 mo)
3
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
2.0.1 Stable Oct 8, 2025
2.0.0 Stable Aug 1, 2025
2.x-dev Dev Aug 1, 2025
1.2.0 Stable Jul 11, 2025
1.1.0 Stable May 14, 2025
1.0.0 Stable May 13, 2025