PHP Classes

LMPHP: Support to multiple languages to PHP applications

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStarStar 80%Total: 198 All time: 8,500 This week: 47Up
Version License PHP version Categories
lmphp 1.1Custom (specified...5Localization, PHP 5, Text processing
Description 

Author

This class can be used to support to multiple languages to PHP applications.

It can take given texts in one or more languages and add them to internal arrays that have all the texts that an application needs to display in messages for their users.

The class allow selecting the currently active language, as well return specific texts for the selected language to be used by the application.

Picture of Max Base
  Performance   Level  
Name: Max Base <contact>
Classes: 5 packages by
Country: United States United States
Age: ???
All time rank: 2602358 in United States United States
Week rank: 164 Up23 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Example

<?php
/**
*
* @Name : LMPHP (Language management, Multi-Language)
* @Version : 1.1
* @Programmer : Max
* @Date : 2018-12-01 - 2019-01-22
* @Released under : https://github.com/BaseMax/LMPHP/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/LMPHP
*
**/
include "LMPHP.php";
$langs = new LMPHP();

$langs -> language_add("en");
$langs -> language_add("fa","Farsi");

//$langs -> language_remove("en");

$langs -> language_active("fa");
echo
$langs -> language;

print_r( $langs -> languages );

$langs -> language_active("en");
$langs -> word_add("Bye","Good Bye!");

$langs -> language_active("fa");
$langs -> word_add("Hi","Hello!");
$langs -> word_add("HowAre");
$langs -> word_add("HowAre","How are you?");//update a word!

print_r( $langs -> words );

echo
$langs -> word_get("Bye");//It should get word from active language(fa) , but this is not exists. so will get value from en.


Details

LM PHP (Language management PHP)

Multi Language PHP

Multi-language management and support on the php (web).

LMPHP Features

  • Easy
  • Compact
  • Useful

LM-PHP Functions

word_add

Add a word to active language.

Return : Bool

Parameters : - $name(name of the word) - __Optional__, $value(value of the word)

word_get

Get a word from active language.

Return : The value of word.

Parameters : - $name(name of the word)

word_add_to

Add a word to custom language.

Return : Bool

Parameters : - $lang(language name) - $name(name of the word) - __Optional__, $value(value of the word)

language_add

Add a new language.

Return : Bool

Parameters : - $key(language name)

language_remove

Remove a language.

Return : Bool

Parameters : - $key(language name)

language_active

Activate a language.

Return : Bool

Parameters : - $key(language name)

language_current

Get current active language.

Return : Name of the active language.

Parameters : None

language_exists

Check a language is exists or not.

Return : Bool

Parameters : - $key (language name)

language

Get list of the languages or list of the words of a language.

Return : Array

Parameters : - __Optional__, $filter(language name)

Introduction

This library is simple and lightweight and can be used for language management. It called LM-PHP(LMPHP).

This project started to be used for personal use. At the very beginning, the project was used in the infrastructure of the servers of a project in India. To be able to manage language and vocabulary more easily. (International projects)

With my decision, this project was put up for free.

History

  • Version 0.1 (first) : 2018 - 2018-12-01
  • Version 1.0 : 2018-12-01 - 2019-01-22
  • Version 1.1 : 2019-01-22

License

LMPHP is licensed under the GNU General Public License.


  Files folder image Files (4)  
File Role Description
Accessible without login Plain text file LICENSE Lic. License text
Plain text file LMPHP.php Class Update version 1.1
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file Sample.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:198
This week:0
All time:8,500
This week:47Up
User Ratings User Comments (13)
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:100%StarStarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:80%StarStarStarStarStar
Rank:22
 
tiny and small, but it was useful.
5 years ago (Nardan)
80%StarStarStarStarStar
I find it helpful
5 years ago (Rumba)
80%StarStarStarStarStar
All the facilities.
5 years ago (Amtix)
80%StarStarStarStarStar
Good.
5 years ago (Amtix)
80%StarStarStarStarStar
it was good
5 years ago (Keegan)
80%StarStarStarStarStar
very good Can it be ready for use in the frameworks?
5 years ago (Rambin)
80%StarStarStarStarStar
It, was a tiny and useful class
5 years ago (rubin)
80%StarStarStarStarStar
it is good But I do not have any multi-language projects.
5 years ago (julian)
80%StarStarStarStarStar
Benefits: Simple and light
5 years ago (Alex)
80%StarStarStarStarStar
The creator seems to have focused on the needs .
5 years ago (Radelf)
80%StarStarStarStarStar
Performance well
5 years ago (Rudd)
80%StarStarStarStarStar
It was useful for me
5 years ago (Glenn)
80%StarStarStarStarStar
It was a good library.
5 years ago (Mirax)
80%StarStarStarStarStar