PHPackages                             molajo/language - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. molajo/language

ActiveMolajo-package[Localization &amp; i18n](/categories/localization)

molajo/language
===============

Molajo Language Services for PHP Applications

v0.4(12y ago)0435MITPHPPHP &gt;=5.4

Since Jan 3Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Molajo/Language)[ Packagist](https://packagist.org/packages/molajo/language)[ Docs](http://github.com/Molajo/Language)[ RSS](/packages/molajo-language/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

======= Language Package
========================

[](#language-package)

[![Build Status](https://camo.githubusercontent.com/6fac52ba55e5aa440ea010a20559875e98585757d65bcb863e5c90381b66f552/68747470733a2f2f7472617669732d63692e6f72672f4d6f6c616a6f2f4c616e67756167652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Molajo/Language)

Language Services supporting translations for the User Interface for PHP applications using Adapters for different implementation types.

### How to specify Language

[](#how-to-specify-language)

Language strings are loaded in startup for language determined in this order (and installed):

1. Injected value during class instantiation
2. Session
3. User Data
4. Client Language
5. Application Configuration
6. Defaults to en-GB

Instantiation
-------------

[](#instantiation)

To instantiate the Language Class:

```
   $language = new Language($language);
```

Once instantiated, all calls to the class can be made using the $language instance.

Language Properties
-------------------

[](#language-properties)

To retrieve the key value (ex. 'en-GB') for the language which is loaded:

```
   $language->get('language');
```

### Retrieve Language Strings

[](#retrieve-language-strings)

To retrieve all language strings and translations for the loaded language:

```
   $language->get('strings');
```

### Retrieve List of all installed Languages

[](#retrieve-list-of-all-installed-languages)

To retrieve a list of all languages installed in this application:

```
   $language->get('installed');
```

### Retrieve Language Attribute

[](#retrieve-language-attribute)

To retrieve a registry attribute value (id, name, rtl, local, first\_day) for the loaded language:

```
   $language->get('name-of-attribute');
```

### Retrieve all Language Attributes

[](#retrieve-all-language-attributes)

To retrieve all registry attribute values as an array for the loaded language:

```
   $language->get('registry');
```

Translate
---------

[](#translate)

To translate the string $xyz:

```
   $language->translate($xyz);
```

To retrieve a list of language strings and translations matching a wildcard value:

```
   $language->translate($xyz, 1);
```

Identify Untranslated Strings
-----------------------------

[](#identify-untranslated-strings)

To insert strings found in code but are not already in database:

- If an administrator is logged on, the primary language services automatically insert untranslated strings
- To avoid doing so, override the `LanguagePlugin` and set `insert_missing_strings` to `0`
- For instances you define, set the `insert_missing_strings`, as needed.

To log strings found in code, but are not already in database:

- Set the Application configuration option `profile_missing_strings` to `1` and turn on `profiling`

Requirements and Compliance
---------------------------

[](#requirements-and-compliance)

- PHP framework independent, no dependencies
- Requires PHP 5.4, or above
- [Semantic Versioning](http://semver.org/)
- Compliant with:
    - [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) Basic Coding Standards
    - [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) Coding Style
    - [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) Namespacing
- \[phpDocumentor2\] ()
- \[phpUnit Testing\] ()
- Author [AmyStephen](http://twitter.com/AmyStephen)
- \[Travis Continuous Improvement\] ()
- Listed on \[Packagist\] () and installed using \[Composer\] ()
- Use github to submit [pull requests](https://github.com/Molajo/Language/pulls) and [features](https://github.com/Molajo/Language/issues)
- Licensed under the MIT License - see the `LICENSE` file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Total

3

Last Release

4421d ago

PHP version history (2 changes)v0.2PHP &gt;=5.3.10

v0.3PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95525?v=4)[AmyStephen](/maintainers/AmyStephen)[@AmyStephen](https://github.com/AmyStephen)

---

Top Contributors

[![AmyStephen](https://avatars.githubusercontent.com/u/95525?v=4)](https://github.com/AmyStephen "AmyStephen (57 commits)")

---

Tags

languageMolajoCommonApi

### Embed Badge

![Health badge](/badges/molajo-language/health.svg)

```
[![Health](https://phpackages.com/badges/molajo-language/health.svg)](https://phpackages.com/packages/molajo-language)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[aplus/language

Aplus Framework Language Library

2351.7M15](/packages/aplus-language)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[akaunting/laravel-language

Language switcher package for Laravel

223285.2k1](/packages/akaunting-laravel-language)[vanderlee/syllable

Text syllable splitting and hyphenation using Frank M. Liang's TeX algorithm.

124432.6k8](/packages/vanderlee-syllable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
