Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

String

9 sites Security covered Drupal 10–11 String ecosystem
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')

Depends on

Dependencies of the latest stable release

  • locale Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Dec 2024
Latest release
10 months ago
Releases (12 mo)
1 ▼ from 6
Maintenance
Slowing

Release Timeline

Releases

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