Welcome to EverybodyWiki 😃 ! Nuvola apps kgpg.png Log in or ➕👤 create an account to improve, watchlist or create an article like a 🏭 company page or a 👨👩 bio (yours ?)...

LMPHP

From EverybodyWiki Bios & Wiki
LMPHP, Multi-Language, Language management PHP
Original author(s)Max Base
Developer(s)Max Base
Initial release2018
Stable release
1.1 / January 2019
Engine
    Operating systemCross-platform
    TypePHP Library
    LicenseGNU General Public License v3.0
    WebsiteMultiLanguagePHP at Github

    Amazon.com Logo.png Search LMPHP on Amazon.LM PHP[1] (Language management PHP)[2] is a library for language management and multi-language support in the PHP-based application backends. A key feature is supported multi-language in projects. [3] [4][5]

    MultiLanguagePHP is used primarily for language management and multi-language support.

    This library is licensed under GNU General Public License v3.0 [6] and is open-source[7].

    This package is published in the Official PHP Classes Repository[8]. [9]

    This package was a reason the Max a first rank in the US and ranked 4th in the world at the 2019/02. [10][11]

    Functionalities[edit]

    • Language management and multi-language support.
    • Enable language with more priority (active a language)
    • Trying to eliminate vocabulary deficiencies in some languages.

    History[edit]

    [12]

    Version Num Date Begin Date Finish
    0.1 (first) 2018 2018-12-01
    1.0 2018-12-01 2019-01-22
    1.1 2019-01-22 -
    • In 2018, Max Base[13] began designing this library. [2]
    • In 2018, this library was used in one of India's projects for language management. [2]
    • Version 1.0, a nearly complete rewrite is released on Dec 1, 2018.[14]
    • In 2019, the name of this library change from MultiLanguagePHP to LM-PHP. [1][15]
    • Version 1.1, was officially introduced with the new name as LMPHP. [16][17][18]
    • In 2019/01, This package is published in the Official PHP Classes Repository.[8]
    • In 2019/01/25, This package has also been downloaded and used up to 9,384.[10]
    • In 2019/02/27, Rank first in the US (This week)
    • In 2019/03/05, Rank first in the Canada (This week) [19]

    Functions[edit]

    [20] [21] [22]

    Function Name Goal Parameter(s) Return
    word_add Add a word to the active language. $name(name of the word),

    Optional : $value(value of the word)

    Bool
    word_get Get a word from the active language. $name(name of the word) The value of the word.
    word_add_to Add a word to the custom language. $lang(language name),

    $name(name of the word),

    Optional : $value(value of the word)

    Bool
    language_add Add a new language. $key(language name) Bool
    language_remove Remove a language. $key(language name) Bool
    language_active Activate a language. $key(language name) Bool
    language_current Get current active language. Name of the active language.
    language_exists Check a language is exists or not. $key(language name) Bool
    language Get the list of the languages or list of the words of a language. Optional : $filter(language name) Array

    Initial[edit]

    E.g.: We define the class in $langs variable.

    $langs = new MultiLanguages();
    

    WordAdd[edit]

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

    WordAddTo[edit]

    $langs -> word_add_to("en","Bye","Good Bye!");
    $langs -> word_add_to("ar","HowAre");
    

    WordGet[edit]

    echo $langs -> word_get("Bye");
    

    LanguageAdd[edit]

    $langs -> language_add("en");
    $langs -> language_add("ar","Arabic");
    

    LanguageRemove[edit]

    $langs -> language_remove("en");
    

    LanguageActive[edit]

    $langs -> language_active("ar");
    

    LanguageCurrent[edit]

    if($langs -> language_current() == "ar")
    {
        print("is ar");
    }
    else
    {
        print("is not ar, is " . $langs -> language_current() );
    }
    

    LanguageExists[edit]

    if($langs -> language_exists("ar"))
    {
        print("true");
    }
    else
    {
        print("false");
    }
    

    Languages[edit]

    print_r( $langs -> languages );
    

    Example[edit]

    [22] [23]

     1<?php
     2/**
     3*
     4* @Name : LMPHP (Language management, Multi-Language)
     5* @Version : 1.1
     6* @Programmer : Max
     7* @Date : 2018-12-01 - 2019-01-22
     8* @Released under : https://github.com/BaseMax/LMPHP/blob/master/LICENSE
     9* @Repository : https://github.com/BaseMax/LMPHP
    10*
    11**/
    12include "LMPHP.php";
    13$langs = new LMPHP();
    14
    15$langs -> language_add("en");
    16$langs -> language_add("fa","Farsi");
    17
    18//$langs -> language_remove("en");
    19
    20$langs -> language_active("fa");
    21echo $langs -> language;
    22
    23print_r( $langs -> languages );
    24
    25$langs -> language_active("en");
    26$langs -> word_add("Bye","Good Bye!");
    27
    28$langs -> language_active("fa");
    29$langs -> word_add("Hi","Hello!");
    30$langs -> word_add("HowAre");
    31$langs -> word_add("HowAre","How are you?");//update a word!
    32
    33print_r( $langs -> words );
    34
    35echo $langs -> word_get("Bye");//It should get word from active language(fa) , but this is not exists. so will get value from en.
    36?>
    

    Short Example[edit]

    [7][24]

     1<?php
     2include "LMPHP.php";
     3/////////////////////////////
     4$langs = new LMPHP();
     5
     6$langs -> language_add("en","English");
     7$langs -> language_add("fr","Germany");
     8
     9$langs -> language_active("en");
    10$langs -> word_add("Bye","Good Bye!");
    11$langs -> word_add("HowAre");
    12
    13$langs -> language_active("fr");
    14$langs -> word_add("Bye","Au revoir!");
    15
    16print_r( $langs -> words );
    17
    18echo $langs -> word_get("Bye");
    19?>
    

    References[edit]

    1. 1.0 1.1 "Set name as LMPHP(LM-PHP)".
    2. 2.0 2.1 2.2 "README".
    3. "List of all code-repository in the 'multi language-support' category for the PHP".
    4. "List of all code-repository in the 'multi-language' category for the PHP".
    5. "LMPHP (New)". Free PHP.
    6. "GNU General Public License v3.0".
    7. 7.0 7.1 "multilingual - Multi language php script". Stack Overflow. Retrieved 2019-01-20.
    8. 8.0 8.1 "LMPHP: Support to multiple languages to PHP applications - PHP Classes". www.phpclasses.org. Retrieved 2019-01-25.
    9. "PHP Classes | RedSign Cloud". redsign.cloud. Retrieved 2019-02-28.
    10. 10.0 10.1 "LMPHP: Support to multiple languages to PHP applications - PHP Classes". web.archive.org. 2019-01-25. Retrieved 2019-01-25.
    11. "Asrez". asrez.com. Retrieved 2019-06-10.
    12. "History version table with date (Ver 1.0 and1.1)".
    13. "Max Base - Profile".
    14. "Code Repository".
    15. "Update and rename MultiLanguages.php to LMPHP.php".
    16. "Change the name of the class".
    17. "What is the LMPHP?". Max. 2019-01-22. Retrieved 2019-01-21.
    18. "basemax/lmphp - Packagist". packagist.org. Retrieved 2019-01-22.
    19. "Classes of Max Base - PHP Classes". web.archive.org. 2019-03-05. Retrieved 2019-03-05.
    20. "Name Functions".
    21. "Source Code".
    22. 22.0 22.1 Example Using, Multi-language management and support on the site.: BaseMax/LMPHP
    23. "Update Sample.php for the new name. (LMPHP)".
    24. "Rename 'MultiLanguages' to 'LMPHP' in the stackoverflow answer".


    This article "LMPHP" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:LMPHP. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.