{"id":26010245,"url":"https://github.com/mberatsanli/multilangphp","last_synced_at":"2026-03-09T20:06:10.863Z","repository":{"id":62525930,"uuid":"182261900","full_name":"mberatsanli/multilangPHP","owner":"mberatsanli","description":"PHP multi language","archived":false,"fork":false,"pushed_at":"2019-12-20T19:47:34.000Z","size":47,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T14:17:06.840Z","etag":null,"topics":["languages","multilang","multilanguage","php","php-library"],"latest_commit_sha":null,"homepage":"https://mberatsanli.github.io/multilangPHP/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mberatsanli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-19T12:32:13.000Z","updated_at":"2023-11-03T13:42:34.000Z","dependencies_parsed_at":"2022-11-02T10:31:21.671Z","dependency_job_id":null,"html_url":"https://github.com/mberatsanli/multilangPHP","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mberatsanli","download_url":"https://codeload.github.com/mberatsanli/multilangPHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242117659,"owners_count":20074436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["languages","multilang","multilanguage","php","php-library"],"created_at":"2025-03-05T22:48:46.950Z","updated_at":"2026-03-09T20:06:10.828Z","avatar_url":"https://github.com/mberatsanli.png","language":"PHP","readme":"\n# multilangPHP v2.0.1\n\n[![MBS-PHP](https://img.shields.io/github/release/mberatsanli/multilangPHP.svg)](http://mberatsanli.github.io/multilangPHP)\n[![MBS-PHP](https://img.shields.io/github/last-commit/mberatsanli/multilangPHP.svg)](http://mberatsanli.github.io/multilangPHP)\n[![MBS-PHP](https://img.shields.io/github/repo-size/mberatsanli/multilangPHP.svg)](http://mberatsanli.github.io/multilangPHP)\n[![MBS-PHP](https://img.shields.io/github/languages/code-size/mberatsanli/multilangPHP.svg)](http://mberatsanli.github.io/multilangPHP)\n[![MBS-PHP](https://img.shields.io/github/license/mberatsanli/multilangPHP.svg)](http://mberatsanli.github.io/multilangPHP)\n\n[![MBS-master](https://api.travis-ci.org/mberatsanli/multilangPHP.svg?branch=master)](https://travis-ci.org/mberatsanli/multilangPHP/jobs/522465502)\n[![MBS-quality](https://scrutinizer-ci.com/g/mberatsanli/multilangPHP/badges/quality-score.png?b=master)](hhttps://scrutinizer-ci.com/g/mberatsanli/multilangPHP/)\n[![MBS-intelligence](https://scrutinizer-ci.com/g/mberatsanli/multilangPHP/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/g/mberatsanli/multilangPHP/)\n\n### Import the library\n```php\nrequire_once(\"lib/multilang.php\");\n```\n\n## Using\n\n####  \u003e How to starting\n```php\nmultilang::setup();\n```\n\n#### \u003e Set Languages Directory\n```php\nmultilang::set(\"dir\", \"../demo/langs/\");\n```\nbefore `mutlilang::setup();`\n\n#### \u003e GET function\n```php \nmultilang::get($req, $return);\n```\n\n\n| $return | what is does |\n|--|--|\n| 1 | return |\n| 0 | echo |\n\n\n| $request | what is does | output example |\n|--|--|--|\n| lang | Gives you the language selected by the user | en |\n| dir | Gives you the directory | ../demo/langs/ |\n| log | Gives the log of the library | array() |\n| log_last | Gives the last log the library | The current language is set tr |\n| dir\u0026lang | Gives the language file directory selected by the user | ../demo/langs/tr.php |\n\n\n#### \u003e List the language in the defined direcory\n```php \necho multilang::listlang($returnType);\n```\n\n\n| $returnType | what is does | output |\n|-------------|--------------|--------|\n| html | Gives languages in html format | div.multilang \u003e [a href=\"?lang=tr\" title=\"language tr\"]tr[/a] |\n| array | Gives languages in array | array('tr' =\u003e 'tr.php') |\n\n\n#### \u003e How to create the language file\nFor example, the folder with the language files: `../demo/langs/` and we create a language folder in the directory. Create `LANGUAGE.php`  for example `az.php`\n```php  \n// '../demo/langs/az.php'\n\n$LANG = array(); // We are creating an array called LANG\n\n$LANG['test'] = \"Bu bir testdir.\";\n\n\n$LANG['CALLED_NAME'] = \"CONTENTS\";\n```\n\n#### \u003e How to get the text\n```php \necho multilang::lang($type);\n```\n$type is a CALLED NAME\n\n```php \n// Example\necho multilang::lang('test'); // Output (return): Bu bir testtir.\n```\n\n## Example Using\n```php \n// index.php\nrequire_once(\"lib/multilang.php\");\n\nmultilang::set(\"dir\", \"langs/\"); // We defined the language directory\nmultilang::setup(); // We starting the library\n\necho multilang::lang(\"test\"); // Echo the text\n\nprint_r(multilang::get(\"log\", 1)); // Print the log array\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmberatsanli%2Fmultilangphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmberatsanli%2Fmultilangphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmberatsanli%2Fmultilangphp/lists"}