devel_generate_localized
Devel Generate Localized fills the dummy content created by Devel Generate with placeholder text in each entity's own language instead of Latin lorem ipsum, so your demos and tests look like your real site.
Devel's Devel Generate feature is great for quickly filling a site with sample nodes, users, taxonomy terms and more. But it writes everything in Latin "lorem ipsum" text. On sites in languages that do not use the Latin alphabet — Chinese, Japanese and Korean in particular — that text looks nothing like real content: the characters, character widths and line breaking are all wrong, which makes it hard to trust layout checks, search indexing and tokenizer testing. This module fixes that by generating the placeholder text in the language of the entity being created.
Features
Once enabled, the module automatically rewrites the labels and text fields of entities generated by Devel Generate, using dummy text built from the words of the target language. The text is still meaningless — like lorem ipsum — but its script and vocabulary match real content, so it behaves realistically for layout and text analysis.
- Works with all Devel Generate entity types: Content (nodes, including their comments), Block content, Media, Menus (including menu links), Taxonomy terms and vocabularies, and Users (localized person names).
- Text follows the language of each generated entity; entities saved without a specific language use the site's default language.
- Adds a Localize the generated text checkbox to every generation form (enabled by default). Uncheck it to keep the stock lorem ipsum text for that run.
- Adds a Language of the dummy text selector to the user, vocabulary and menu forms, which have no language choice of their own.
- Machine-readable values (machine names, usernames' email addresses, etc.) are kept ASCII.
Use it whenever you need realistic-looking sample content in a non-English language: building theme demos, checking multilingual layouts, populating a site for a client review, or generating input to test search indexing and language-specific tokenizers.
Post-Installation
There is nothing to configure. Once the module is enabled, generate entities as usual at /admin/config/development/generate — the generated text is localized automatically.
- The language selected in a generation form determines the language of the generated text.
- On the user, vocabulary and menu forms, choose the language from the Language of the dummy text selector (it defaults to the language your interface is displayed in).
- Uncheck Localize the generated text on any form to fall back to the standard lorem ipsum output for that run.
- With Drush, the native
--languagesoption (available on thecontent,terms,block-contentandmediacommands) selects the language. To force one language for any command, set theDEVEL_GENERATE_LOCALEenvironment variable, e.g.DEVEL_GENERATE_LOCALE=ja drush devel-generate:users 20.
Entities in a language for which FakerPHP ships no text data are left with the stock Devel Generate text.
Note: like Devel itself, this is a development module. Do not enable it on production sites.
Additional Requirements
- Devel (^5.5), with the Devel Generate submodule enabled.
- The FakerPHP library (^1.23), installed automatically when you require the module with Composer.
- Drupal 11.1 or later, or 12; PHP 8.3 or higher.
Recommended modules/libraries
- Core Language and Content Translation modules, so you can generate content in — and translate it into — several languages.
- Any Search API-based search stack or language-specific tokenizer, which benefits from realistic localized sample content when tuning indexing and relevance.
Supporting this Module
Development is supported by Studio Umi, Inc. Issues and merge requests are welcome on the project's issue queue.
Community Documentation
Additional usage notes are available in the module's README. Walkthroughs and demo links will be added here over time.