{"id":18575080,"url":"https://github.com/arabnewscms/langnonymous","last_synced_at":"2025-07-15T15:32:57.806Z","repository":{"id":57011147,"uuid":"91276472","full_name":"arabnewscms/LangNonymous","owner":"arabnewscms","description":"A Simple Package langauge to laravel","archived":false,"fork":false,"pushed_at":"2018-06-26T15:19:32.000Z","size":25,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T16:17:50.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/arabnewscms.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":"2017-05-14T22:58:48.000Z","updated_at":"2024-06-03T12:04:58.000Z","dependencies_parsed_at":"2022-08-21T15:10:39.872Z","dependency_job_id":null,"html_url":"https://github.com/arabnewscms/LangNonymous","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/arabnewscms/LangNonymous","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arabnewscms%2FLangNonymous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arabnewscms%2FLangNonymous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arabnewscms%2FLangNonymous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arabnewscms%2FLangNonymous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arabnewscms","download_url":"https://codeload.github.com/arabnewscms/LangNonymous/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arabnewscms%2FLangNonymous/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443422,"owners_count":23766407,"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":[],"created_at":"2024-11-06T23:17:31.774Z","updated_at":"2025-07-15T15:32:57.549Z","avatar_url":"https://github.com/arabnewscms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Translation Package\nA Simple Translate To convert ui and local language. Creation and development By PhpAnonymous ( phpanonymous.com )\nLaravel Version 5 and Above \n\n##Install with Composer \n```php\ncomposer require Langnonymous/Lang \n```\n# Provider Class \nthis provider is auto registred \n```php\n  Langnonymous\\Lang\\Langnonymous::class,\n \n```\n\n#Aliases \nthis aliases auto registred\n\n```php \n'L'         =\u003e Langnonymous\\Lang\\Lang::class,\n```\n#publish \nwith composer run this command `php artisan vendor:publish `\n\nnow you can check this file langnonymous.php on config path \n\nyou should add this middleware in kernel.php file \n```php\n'Lang'     =\u003e \\Langnonymous\\Lang\\Lang::class,\n\n// like This \n  protected $routeMiddleware = [        \n        'auth' =\u003e \\Illuminate\\Auth\\Middleware\\Authenticate::class,\n        'auth.basic' =\u003e \\Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth::class,\n        'bindings' =\u003e \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n        'can' =\u003e \\Illuminate\\Auth\\Middleware\\Authorize::class,\n        'guest' =\u003e \\App\\Http\\Middleware\\RedirectIfAuthenticated::class,\n        'throttle' =\u003e \\Illuminate\\Routing\\Middleware\\ThrottleRequests::class,\n        'Lang'     =\u003e \\Langnonymous\\Lang\\Lang::class,\n    ];\n```\n\n\n\n\n#usage \n\nyou can use The L Class anywhere you want it , in Controller or Blade File \n\nNow You should add this method to web.php or any route file to fire our operators\n```php\nL::LangNonymous();\n```\ndo you have admin panel and you want access route path to lang ? \nadd this in route files if you want and set path like admin !! \n```php\nL::Panel('admin');\n\n```\n\nnow you are ready to see your route like this \nIt is preferable to place these lines in the first line of the file\n```php \n\u003c?php\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------------------------------------------------------------\n|\n| Here is where you can register web routes for your application. These\n| routes are loaded by the RouteServiceProvider within a group which\n| contains the \"web\" middleware group. Now create something great!\n|\n*/\n\nL::Panel('admin');\nL::LangNonymous();\n```\n\nokay You have to add this public middleware and you have Put all your routes inside this middelware \n\n```php\nRoute::group(['middleware'=\u003e'Lang'],function(){\n// put all routes here please ...i'ts fine :)\n});\n```\nnow you maybe want configure your file langnonymous \n```php\n\u003c?php \n\nreturn [\n\t\t'UserModeLang'=\u003etrue, // true,false | if you want save lang in User Tbl Set true auto detected user lang\n\t\t'LangRoute'=\u003e'langnonymous', // Route Name You Can Change Route Name\n\t\t'column_lang'=\u003e'lang', // You May put The Defualt column if you are enable UserModeLang for true\n\t\t'languages'=\u003e['ar','en','es','jp'], // Put Your Language website Usage\n\t\t'defaultLanguage'=\u003e'ar', // Set Your Default Language (ar,en,es Any Short Lang From languages array)\n\t\t'redirectAfterSet'=\u003e'back', //Set Direction home,back | Back reflect to function back | home to index or other route\n];\n\n```\nthis is methods and classes built in package you can use all form any where\n```php\n\napp('lang');\napp('l');\n// if you want methods !! okay that's was easy\nL::lang();\nL::l();\n// master session \nsession('anonylang');\n// you have a style directions !! don't worry\n// use this singletone in your file css or js :) whatever like example.com/css/style-rtl.css :) or rtl\napp('dir'); // RTL OR LTR\nL::dir(); // RTL or LTR\n//example.com/css/style-{{app('dir')}}.css from link tag\n//example.com/js/jquery-{{app('dir')}}.css from script tag \n\n// attention \n//if you are enable UserModeLang .. you should add column name to column_lang from user table in sql \n// you maybe make a new folders to usage this array 'languages'=\u003e['ar','en','es','jp']\n/*\nresource/lang/ar\nset file name and put this array\n\u003c?php \nreturn [\n\t\t'ar'=\u003e'العربية',\n\t\t'en'=\u003e'English',\n\t\t'es'=\u003e'Spanish',\n\t\t'jp'=\u003e'日本の',\n\t\t'welcome'=\u003e'مرحبا',\n\t];\n   demo trans('yourfile.welcome') // مرحبا\n  \nresource/lang/en\nset file name and put this array\n\u003c?php \nreturn [\n\t\t'ar'=\u003e'العربية',\n\t\t'en'=\u003e'English',\n\t\t'es'=\u003e'Spanish',\n\t\t'jp'=\u003e'日本の',\n\t\t'welcome'=\u003e'Welcome',\n\t];\n   demo trans('yourfile.welcome') // welcome\nresource/lang/es\nset file name and put this array\n\u003c?php \nreturn [\n\t\t'ar'=\u003e'العربية',\n\t\t'en'=\u003e'English',\n\t\t'es'=\u003e'Spanish',\n\t\t'jp'=\u003e'日本の',\n\t\t'welcome'=\u003e'bienvenida',\n\t];\n   demo trans('yourfile.welcome') // bienvenida\nresource/lang/jp\nset file name and put this array\n\u003c?php \nreturn [\n\t\t'ar'=\u003e'العربية',\n\t\t'en'=\u003e'English',\n\t\t'es'=\u003e'Spanish',\n\t\t'jp'=\u003e'日本の',\n\t\t'welcome'=\u003e'もしもし',\n\t];\n  demo trans('yourfile.welcome') // もしもし\nor you can custom any language needed want\n*/\n\n// to set lang on your web okay follow this \n// in blade file put master language \n\u003ca href=\"{{L::put('ar')}}\"\u003e{{trans('yourfile.ar')}}\u003c/a\u003e\n\u003ca href=\"{{L::put('en')}}\"\u003e{{trans('yourfile.en')}}\u003c/a\u003e\n\u003ca href=\"{{L::put('es')}}\"\u003e{{trans('yourfile.es')}}\u003c/a\u003e\n\u003ca href=\"{{L::put('jp')}}\"\u003e{{trans('yourfile.jp')}}\u003c/a\u003e\n// or you can loop all automatically with method L::all();\n@foreach(L::all() as $lang)\n                            \u003ca href=\"{{L::put($lang)}}\"\u003e{{trans('yourfile.'.$lang)}}\u003c/a\u003e . \n                 @endforeach\n// for singleton \n\n```\n\n  \nif you have any questions about this package join us on group facebook  (https://www.facebook.com/groups/anonymouses.developers) \n\nEnjoy :) \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farabnewscms%2Flangnonymous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farabnewscms%2Flangnonymous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farabnewscms%2Flangnonymous/lists"}