Introduction
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
Authorization & Authentication
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:
- Setting the current language
- Getting the current language
- Resetting to default language
- Loading language configuration files
Basic Usage
Set the language:
$this->$language->set_language('fr');
Get the current language:
$lang= this->$$language->get_language();
Reset to default:
$this->$language->reset_language();
How It Works
The current language is resolved using a simple priority system:
- Session value
- Cookie value
- Application constant (
APP_LANG) - Default fallback
No hidden behaviour. No surprises.