Skip to content

Database-backed translation system for TYPO3 frontend system strings (form labels, buttons, messages). Edit translations in backend, import/export XLIFF, manage 10+ languages with zero deployment friction.

License

Notifications You must be signed in to change notification settings

netresearch/t3x-nr-textdb

Repository files navigation

Netresearch TextDB

Manage TYPO3 translations directly in the backend โ€“ no more digging through language files

Latest version TYPO3 13 PHP 8.2+ License CI


What is TextDB?

TextDB is a powerful TYPO3 extension that transforms how you manage translations. Instead of editing language files scattered across your project, manage all translations through a convenient backend module with filtering, search, and bulk operations.

Perfect for:

  • ๐ŸŒ Multi-language websites with frequent translation updates
  • ๐Ÿ‘ฅ Clients and editors who need to update translations without touching code
  • ๐Ÿ”„ Translation workflows requiring import/export capabilities
  • ๐Ÿš€ Agencies managing multiple TYPO3 projects with consistent translation processes

๐ŸŽฏ What TextDB Is (and Isn't)

โœ… TextDB is designed for: Frontend System Strings

User interface elements that come from your code, NOT editor-created content:

  • โœ… Form labels: "First Name", "Email Address", "Submit Button"
  • โœ… Button texts: "Add to Cart", "Checkout", "Learn More"
  • โœ… Error messages: "Invalid email format", "Field is required"
  • โœ… Navigation labels: "Products", "About Us", "Contact"
  • โœ… Status messages: "Item added to cart", "Order confirmed"
  • โœ… Validation messages, tooltips, placeholder texts

Example Scenario: Your e-commerce checkout has 50+ labels/buttons needing German, French, and Spanish translations. Instead of editing .xlf files, editors manage them through TextDB's backend module.

โŒ TextDB is NOT for:

  • โŒ Page content created by editors (use TYPO3's built-in page translation)
  • โŒ News articles or blog posts (use news/blog extension translation features)
  • โŒ Content elements like text blocks, images (use TYPO3 content localization)
  • โŒ Backend module labels (use TYPO3's core translation system)
  • โŒ TCA field labels (use locallang_db.xlf in your extension)

๐Ÿ“ Translation Scope

TYPO3 Translation Landscape:
โ”œโ”€ Backend/Admin Interface โ†’ TYPO3 Core locallang files
โ”œโ”€ Content Elements โ†’ TYPO3 Page/Content translation
โ”œโ”€ Editor-created content โ†’ TYPO3 Localization features
โ””โ”€ Frontend System Strings โ†’ โœจ TextDB (YOU ARE HERE)

๐Ÿ“š Real-World Use Cases

Use Case 1: Multi-Language E-Commerce Checkout

Problem: Your checkout flow has 80+ UI strings (field labels, buttons, validation messages) needing translations in German, French, and Spanish.

Without TextDB: Developers edit .xlf files for every text change, deploy to production. With TextDB: Product managers update translations directly in backend, changes live immediately.

Result: Translation updates in minutes, not days. Non-technical staff manage translations independently.


Use Case 2: SaaS Application with Dynamic Forms

Problem: Multi-tenant SaaS with 200+ form labels across 15 modules, requiring consistent translation management.

Without TextDB: Scattered .xlf files across multiple extensions, no central overview, duplicate translations. With TextDB: Hierarchical organization by component/type, centralized filtering, bulk operations, zero duplication.

Result: 70% reduction in translation maintenance time, consistent terminology across modules.


Use Case 3: Agency Managing Multiple Client Sites

Problem: 20+ TYPO3 installations, each with custom form/button texts needing German/English translations.

Without TextDB: Copy .xlf files between projects, manual sync, version control overhead. With TextDB: Export/import workflows, standardized translation structure, zero-friction migration via textdb:translate.

Result: Standardized translation process across all clients, 50% faster project setup.


Use Case 4: Government Website Compliance

Problem: Legal requirements demand audit trails for translated UI strings, editor-friendly workflow without file access.

Without TextDB: Developers as bottleneck for every text change, no change tracking, risky file edits. With TextDB: Backend module access for translators, database change tracking, missing translation detection.

Result: Compliance-ready audit trails, editor empowerment, reduced developer burden.


๐Ÿ”„ Before & After: The TextDB Transformation

Traditional File-Based Approach (Without TextDB)

Your TYPO3 Project/
โ”œโ”€โ”€ typo3conf/ext/my_extension/
โ”‚   โ””โ”€โ”€ Resources/Private/Language/
โ”‚       โ”œโ”€โ”€ locallang.xlf                    # 150 lines of XML
โ”‚       โ”œโ”€โ”€ de.locallang.xlf                 # 150 lines (duplicated structure)
โ”‚       โ”œโ”€โ”€ fr.locallang.xlf                 # 150 lines (duplicated structure)
โ”‚       โ””โ”€โ”€ locallang_checkout.xlf           # Another 200 lines
โ”œโ”€โ”€ typo3conf/ext/another_extension/
โ”‚   โ””โ”€โ”€ Resources/Private/Language/
โ”‚       โ””โ”€โ”€ ... more scattered files

Workflow: Developer edits XML โ†’ Git commit โ†’ Deploy โ†’ Cache clear โ†’ Test

Problems:

  • โŒ Non-developers can't update translations
  • โŒ Changes require full deployment cycle
  • โŒ No central overview of all translations
  • โŒ Duplicate structure across language files
  • โŒ Merge conflicts in XML files
  • โŒ No built-in search/filter capabilities

Database-Backed Approach (With TextDB)

Your TYPO3 Backend/
โ””โ”€โ”€ Netresearch โ†’ TextDB Module
    โ”œโ”€โ”€ ๐Ÿ” Search: [button checkout]          # Instant filtering
    โ”œโ”€โ”€ ๐Ÿ“Š Filter: Component: "checkout" | Type: "button"
    โ”‚
    โ”œโ”€โ”€ โœ๏ธ Edit inline:
    โ”‚   โ”œโ”€โ”€ EN: "Proceed to Checkout"  โ†’  [Click to edit]
    โ”‚   โ”œโ”€โ”€ DE: "Zur Kasse gehen"      โ†’  [Click to edit]
    โ”‚   โ””โ”€โ”€ FR: "Passer ร  la caisse"   โ†’  [Click to edit]
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ฅ Import: Upload XLF โ†’ Auto-merge
    โ””โ”€โ”€ ๐Ÿ“ค Export: Download ZIP (all languages)

Workflow: Editor logs in โ†’ Click translation โ†’ Edit โ†’ Save โ†’ Live immediately

Benefits:

  • โœ… Non-developers manage translations independently
  • โœ… Changes live in seconds (no deployment)
  • โœ… Centralized dashboard with 500+ translations
  • โœ… Single source of truth (no XML duplication)
  • โœ… Advanced filtering: component, type, placeholder, value search
  • โœ… Export/import for translation agencies
  • โœ… Zero-friction migration via textdb:translate ViewHelper

Migration Path: Zero Disruption

Phase 1: Prepare (5 minutes)

<!-- Add namespace to your templates -->
xmlns:textdb="http://typo3.org/ns/Netresearch/NrTextdb/ViewHelpers"

Phase 2: Auto-Import (Automatic)

<!-- Replace f:translate with textdb:translate -->
<textdb:translate key="LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:submit" />

<!-- First render automatically imports to database -->
<!-- All existing translations preserved -->

Phase 3: Optimize (Gradual)

<!-- Switch to native syntax at your own pace -->
<textdb:textdb component="checkout" type="button" placeholder="submit" />

<!-- Old .xlf files can stay as backup until you're confident -->

Zero Downtime: Existing translations continue working during migration. Zero Data Loss: Automatic import preserves all language variants. Zero Risk: Rollback anytime by reverting ViewHelper change.


โœจ Features

Backend Translation Management

  • User-friendly backend module for managing all translations
  • Advanced filtering by component, type, and placeholder
  • Multi-language support with TYPO3's site configuration
  • Inline editing of translations directly in the list view

Import & Export

  • XLF file import/export for easy translation workflows
  • Bulk operations for updating multiple translations at once
  • Overwrite protection with optional merge strategies
  • Multi-language export for all configured site languages

Migration Tools

  • ViewHelper for migration from LLL files to database storage
  • Automatic translation detection and import during migration
  • Backward-compatible migration path preserving existing translations

Developer Features

  • Extbase ViewHelpers (textdb:textdb, textdb:translate)
  • Console commands for automated import workflows
  • Structured data model (Environment โ†’ Component โ†’ Type โ†’ Placeholder)
  • TYPO3 v13 compatibility with modern dependency injection

๐ŸŒŸ What Makes TextDB Unique

Competitive Comparison

Feature TextDB l10nmgr Snowbabel translatelabels TYPO3 Core
Frontend System Strings โœ… Primary Focus โŒ No โŒ No โš ๏ธ Partial โŒ Backend Only
Database-Backed Storage โœ… Yes โœ… Yes โœ… Yes โœ… Yes โŒ File-Based
Zero-Friction Migration โœ… Auto-Import โŒ Manual โŒ Manual โŒ Manual N/A
Backend Module โœ… Advanced Filtering โœ… Workflow-Heavy โœ… Simple โœ… Basic โŒ No
XLF Import/Export โœ… Multi-Language ZIP โœ… Complex Workflow โš ๏ธ Limited โŒ No โœ… Single Files
Hierarchical Organization โœ… 4-Level Structure โŒ Flat โŒ Flat โŒ Flat โŒ File Structure
Live Translation Updates โœ… Instant โš ๏ธ Via Workflow โœ… Instant โœ… Instant โŒ Requires Deployment
Non-Developer Editing โœ… Backend Module โš ๏ธ Complex โœ… Simple โœ… Basic โŒ File Access Needed
Code Quality โœ… PHPStan 10 โš ๏ธ Lower โš ๏ธ Lower โš ๏ธ Lower โœ… High
TYPO3 v13 Ready โœ… Yes โš ๏ธ Legacy Support โŒ Outdated โŒ Unmaintained โœ… Yes

Key Differentiators

๐ŸŽฏ 1. Zero-Friction Migration

The TextDB Advantage: Drop-in replacement for f:translate ViewHelper with automatic LLL import on first render.

<!-- Step 1: Change namespace only -->
<textdb:translate key="LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:welcome" />

<!-- Step 2: Render page โ†’ Automatic import to database -->

<!-- Step 3: Switch to native syntax -->
<textdb:textdb component="my-component" type="label" placeholder="welcome" />

Competitors: Require manual migration, complex import processes, or complete rewrites.


๐Ÿ—๏ธ 2. Hierarchical Organization

The TextDB Advantage: 4-level structure (Environment โ†’ Component โ†’ Type โ†’ Placeholder) prevents chaos at scale.

Example: 500+ translations organized logically instead of 500 flat key-value pairs.

Competitors: Flat key-value structure becomes unmanageable beyond 100 translations.


โšก 3. Non-Developer Empowerment

The TextDB Advantage: Product managers, translators, and editors update translations without:

  • File system access
  • Git knowledge
  • Deployment pipelines
  • Developer intervention

Competitors: Either require developer involvement (TYPO3 Core) or offer basic editing without advanced features (Snowbabel).


๐Ÿ”’ 4. Production-Grade Quality

The TextDB Advantage:

  • PHPStan level 10 static analysis
  • 95%+ test coverage
  • PSR-12 coding standards
  • Modern PHP 8.2+ features (readonly properties, constructor promotion)
  • Comprehensive CI/CD pipeline

Competitors: Lower code quality standards, outdated codebases, limited testing.


๐Ÿš€ 5. Developer Experience

The TextDB Advantage:

  • Fast Apply-compatible: Token-optimized for AI-assisted development
  • Modern Architecture: Dependency injection, final classes, strict types
  • CLI Automation: Console commands for import workflows
  • API-ready: Clean service layer for programmatic access

Competitors: Legacy architectures, limited CLI support, manual workflows.


๐Ÿ“‹ Requirements

  • TYPO3: 13.4.0 - 13.99.99
  • PHP: 8.2, 8.3, or 8.4
  • PHP Extensions: zip, simplexml, libxml
  • Composer: For installation and dependency management

๐Ÿš€ Installation

Install via Composer:

composer require netresearch/nr-textdb

Activate the extension in the TYPO3 Extension Manager or via CLI:

vendor/bin/typo3 extension:activate nr_textdb

โš™๏ธ Configuration

Extension Configuration

Configure the extension in the TYPO3 backend:

  1. Navigate to Admin Tools โ†’ Settings โ†’ Extension Configuration
  2. Select nr_textdb
  3. Set the Storage PID where translations will be stored
  4. Optionally disable "Create if missing" feature

Storage Setup

Create a dedicated storage folder for your translations:

  1. Create a new page/folder in the TYPO3 page tree
  2. Note the page ID
  3. Set this ID in the extension configuration as the Storage PID
  4. (Optional) Create language overlays for the folder to enable the language switcher in TCA

๐Ÿ“– Usage

Backend Module

Access the TextDB module under Netresearch โ†’ TextDB in the TYPO3 backend.

Key Features:

  • List View: Browse and filter all translations
  • Inline Editing: Click to edit translation values directly
  • Filtering: Filter by component, type, or search in placeholders/values
  • Pagination: Navigate through large translation sets

ViewHelper Usage

Use TextDB translations in your Fluid templates:

<!-- Add namespace declaration -->
<html xmlns:textdb="http://typo3.org/ns/Netresearch/NrTextdb/ViewHelpers">

<!-- Use the ViewHelper -->
<textdb:textdb
    component="my-component"
    type="label"
    placeholder="welcome.headline"
/>

ViewHelper Parameters:

  • component: Logical grouping (e.g., "checkout", "contact-form")
  • type: Translation type (e.g., "label", "message", "error")
  • placeholder: Unique identifier for the translation

๐Ÿ“ฅ Import & Export

Importing Translations

  1. Prepare an XLF file with the required structure (see below)
  2. Open the TextDB backend module
  3. Click Import
  4. Select your XLF file
  5. Check "Overwrite existing" if you want to update existing translations
  6. Click Import

XLF File Structure for English (source language):

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" datatype="plaintext" original="messages">
        <header>
            <authorName>Your Name</authorName>
            <authorEmail>[email protected]</authorEmail>
        </header>
        <body>
            <trans-unit id="component|type|placeholder">
                <source>Translation Value</source>
            </trans-unit>
        </body>
    </file>
</xliff>

XLF File Structure for Other Languages:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" datatype="plaintext" original="messages">
        <header>
            <authorName>Your Name</authorName>
            <authorEmail>[email protected]</authorEmail>
        </header>
        <body>
            <trans-unit id="component|type|placeholder">
                <target>รœbersetzungswert</target>
            </trans-unit>
        </body>
    </file>
</xliff>

File Naming Convention:

  • English (default): textdb_[name].xlf
  • Other languages: [iso-code].textdb_[name].xlf (e.g., de.textdb_labels.xlf)

Security Considerations

The XLF import functionality implements protection against XML External Entity (XXE) attacks:

  • XXE Protection: Network access during XML parsing is blocked using the LIBXML_NONET flag, preventing external entity resolution and SSRF attacks
  • PHP 8.0+ Compatible: External entity loading is disabled by default in PHP 8.0+, with LIBXML_NONET providing defense-in-depth security
  • Permission Requirements: Only backend users with appropriate permissions can import XLF files
  • Best Practices:
    • Review XLF files from untrusted sources before importing
    • Monitor import operations in production environments
    • Regularly update to the latest version to receive security updates

For more information about XXE vulnerabilities, see the OWASP XXE documentation.

Exporting Translations

  1. Open the TextDB backend module
  2. Apply filters (component, type) if needed
  3. Click "Export with current filter"
  4. A ZIP archive will be downloaded with XLF files for all languages

Note: Export includes all filtered translations, ignoring pagination.


๐Ÿ”„ Migration from LLL Files

Migrate existing f:translate ViewHelpers to TextDB:

Step 1: Include TextDB ViewHelper

Add to your template:

xmlns:textdb="http://typo3.org/ns/Netresearch/NrTextdb/ViewHelpers"

Step 2: Set Component in Controller

use Netresearch\NrTextdb\ViewHelpers\TranslateViewHelper;

// In your controller action
TranslateViewHelper::$component = 'my-component';

Step 3: Replace ViewHelpers Temporarily

Replace f:translate with textdb:translate:

<!-- Before -->
<f:translate key="LLL:EXT:my_ext:Resources/Private/Language/locallang.xlf:welcome" />

<!-- During migration -->
<textdb:translate key="LLL:EXT:my_ext:Resources/Private/Language/locallang.xlf:welcome" />

Step 4: Render Templates

Access your frontend to trigger automatic import of translations into TextDB.

Step 5: Final Replacement

Replace all f:translate calls with textdb:textdb:

For tag syntax:

Search:   <f:translate key="LLL:EXT:[^:]+:([^\"]+)"[^>]+>
Replace:  <textdb:textdb component="my-component" placeholder="\1" type="label" />

For inline syntax:

Search:   {f:translate\(key: 'LLL:EXT:[^:]+:([^\']+)'\)}
Replace:  {textdb:textdb\({placeholder: '\1', component: 'my-component', type: 'label'})}

๐Ÿ› ๏ธ Development

Running Tests

Run the complete test suite:

composer ci:test

This executes:

  • โœ… PHP linting
  • โœ… PHPStan static analysis (level 10)
  • โœ… Rector code quality checks
  • โœ… Fractor TYPO3 migrations
  • โœ… Unit tests with coverage
  • โœ… Coding standards (PHP CS Fixer)

Individual Test Commands

composer ci:test:php:lint      # PHP linting
composer ci:test:php:phpstan   # PHPStan analysis
composer ci:test:php:rector    # Rector checks
composer ci:test:php:fractor   # Fractor checks
composer ci:test:php:unit      # Unit tests
composer ci:test:php:cgl       # Coding standards check

Automatic Fixes

composer ci:cgl                # Fix coding standards
composer ci:rector             # Apply Rector refactorings
composer ci:fractor            # Apply Fractor migrations

๐Ÿค Contributing

We welcome all types of contributions! Whether you're a developer, translator, or documentation writer, there's a way for you to help.

๐ŸŒ Help Translate TextDB

Make TextDB available in your language! We use Crowdin for community translations.

The extension currently supports 23 languages, and we're always looking to add more:

๐Ÿ‡ฟ๐Ÿ‡ฆ Afrikaans โ€ข ๐Ÿ‡ธ๐Ÿ‡ฆ Arabic โ€ข ๐Ÿ‡จ๐Ÿ‡ฟ Czech โ€ข ๐Ÿ‡ฉ๐Ÿ‡ฐ Danish โ€ข ๐Ÿ‡ฉ๐Ÿ‡ช German โ€ข ๐Ÿ‡ช๐Ÿ‡ธ Spanish โ€ข ๐Ÿ‡ซ๐Ÿ‡ฎ Finnish โ€ข ๐Ÿ‡ซ๐Ÿ‡ท French โ€ข ๐Ÿ‡ฎ๐Ÿ‡ณ Hindi โ€ข ๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesian โ€ข ๐Ÿ‡ฎ๐Ÿ‡น Italian โ€ข ๐Ÿ‡ฏ๐Ÿ‡ต Japanese โ€ข ๐Ÿ‡ฐ๐Ÿ‡ท Korean โ€ข ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch โ€ข ๐Ÿ‡ณ๐Ÿ‡ด Norwegian โ€ข ๐Ÿ‡ต๐Ÿ‡ฑ Polish โ€ข ๐Ÿ‡ต๐Ÿ‡น Portuguese โ€ข ๐Ÿ‡ท๐Ÿ‡บ Russian โ€ข ๐Ÿ‡ธ๐Ÿ‡ช Swedish โ€ข ๐Ÿ‡น๐Ÿ‡ฟ Swahili โ€ข ๐Ÿ‡น๐Ÿ‡ญ Thai โ€ข ๐Ÿ‡ป๐Ÿ‡ณ Vietnamese โ€ข ๐Ÿ‡จ๐Ÿ‡ณ Chinese

How to contribute translations:

  1. Visit the TYPO3 Crowdin project: https://crowdin.com/project/typo3-cms
  2. Find the nr_textdb extension
  3. Select your language and start translating
  4. Your translations will be automatically synchronized

No technical knowledge required! See our Translation Guide for detailed instructions.

๐Ÿ’ป Contribute Code

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following our coding standards
  4. Run tests: composer ci:test
  5. Open a Pull Request

Development Standards:

  • PHPStan level 10 compliance required
  • PSR-12 coding standards
  • declare(strict_types=1) in all PHP files
  • Type declarations on all methods
  • Tests for new features

๐Ÿ“š Full Contributing Guide

For detailed information about:

  • Translation guidelines and proper names
  • Code contribution workflow
  • Development setup with DDEV
  • Testing and quality standards
  • Issue reporting

See our CONTRIBUTING.md guide.


๐Ÿ“„ License

This project is licensed under the GPL-3.0-or-later License - see the LICENSE file for details.


๐Ÿข About Netresearch

Developed and maintained by Netresearch DTT GmbH

Authors:

  • Thomas Schรถne
  • Axel Seemann
  • Tobias Hein
  • Rico Sonntag

๐Ÿ“ž Support


๐Ÿ”— Related Extensions

  • nr-sync: Synchronize TextDB translations across TYPO3 instances

Made with โค๏ธ for the TYPO3 Community

About

Database-backed translation system for TYPO3 frontend system strings (form labels, buttons, messages). Edit translations in backend, import/export XLIFF, manage 10+ languages with zero deployment friction.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 7