Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
/ language Public archive

A simple language abstraction to simply keep copy out of your code.

License

Notifications You must be signed in to change notification settings

jaeger-app/language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jaeger Language Object

Build Status Scrutinizer Code Quality Author GitHub license

A simple language abstraction to simply keep copy out of your code. This is NOT a translation library.

Installation

Add jaeger-app/language as a requirement to your composer.json:

$ composer require jaeger-app/language

Simple Usage

To get started with JaegerApp\Language you pass system paths to directories containing language files which are used for a simple replacement.

$lang = new Language;
$lang_path = '/path/to/language/files';
$lang->init($lang_path);

echo $lang->__('backup_success_message');

You can also pass an array of paths to the constructor to bulk load language files

$paths = array(
	'/path/to/language1',
	'/path/to/language2',
	'/path/to/language3'
);
$lang = new Language($paths);

Language File Format

The language files are a simple key => value array called $lang

$lang = array(
	'backup_success_message' => 'Backup Complete!',
	'backup_fail_message' => 'Backup Failed...',
);

You can store multiple language files in the same directory as well as add multiple directories so keeping content organized shouldn't hurt too much.

About

A simple language abstraction to simply keep copy out of your code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages