Trongate PHP Framework Docs
Introduction
Quick Start
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Form Validation
Working With Files
Image Manipulation
Working With Dates & Times
Language Control
Security
Tips And Best Practices

The Language Module

Trongate v2 provides a simple, powerful way to manage application language preferences.

No middleware. No service containers. No abstraction layers.

Just Native PHP.


What It Does

The Language module answers one question:

"What language is the user currently using?"

The module contains four methods that are designed to assist with the following tasks:

  1. Setting the current language
  2. Getting the current language
  3. Resetting to default language
  4. Loading language configuration files

Basic Usage

Set the language:

Get the current language:

Reset to default:


How It Works

The current language is resolved using a simple priority system:

  1. Session value
  2. Cookie value
  3. Application constant (APP_LANG)
  4. Default fallback

No hidden behaviour. No surprises.

We're continually improving the Trongate documentation. If anything is incorrect, unclear, incomplete, or could be better, we'd genuinely appreciate your input.

Share your thoughts in the Documentation Feedback.

Leave Feedback About This Page