{"id":26010257,"url":"https://github.com/mberatsanli/multilangpy","last_synced_at":"2025-06-12T07:09:01.538Z","repository":{"id":169409788,"uuid":"211850703","full_name":"mberatsanli/multilangPY","owner":"mberatsanli","description":"multilangPY","archived":false,"fork":false,"pushed_at":"2019-10-02T19:00:43.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T22:48:47.085Z","etag":null,"topics":["multilanguage-support","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-30T12:06:45.000Z","updated_at":"2019-11-08T11:46:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c704fd83-0924-4f86-9c88-783b8669f70d","html_url":"https://github.com/mberatsanli/multilangPY","commit_stats":null,"previous_names":["mberatsanli/multilangpy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mberatsanli/multilangPY","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPY","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPY/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPY/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPY/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mberatsanli","download_url":"https://codeload.github.com/mberatsanli/multilangPY/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mberatsanli%2FmultilangPY/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259418188,"owners_count":22854184,"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":["multilanguage-support","python"],"created_at":"2025-03-05T22:48:48.800Z","updated_at":"2025-06-12T07:09:01.531Z","avatar_url":"https://github.com/mberatsanli.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# multilangPY\n\n\n### Import the library\n```python\nfrom multilang import multilang\n```\n\n## Using\n\n####  \u003e How to starting\n```python\nmlang = multilang()\n```\n\n#### \u003e Set Languages Directory\n```python\nmlang.set(\"dir\", \"../demo/langs/\")\n```\n\n#### \u003e whatIs function\n```python\nmlang.whatIs(value, print4me=False)\n```\n| value | what is does | ouput |\n|--|--|--|\n| lang or language | Prints the selected language | return\n| dir or directory | Prints the selected directory | return\n\n\n#### \u003e List the language in the defined direcory\n```python \nmlang.languages(print4me=False, helper=False)\n```\n\n| paramters | what is does | output |\n|-------------|--------------|--------|\n| print4me | Print for you language file(s) in directory | array |\n| helper | writes in detail the file(s) in directory. You just using with print4me. | just try :) |\n\n\n#### \u003e How to create the language file (json)\nFor example, the folder with the language files: `../multilang/languages/` and we create a language folder in the directory. Create `LANGUAGE.json`  for example `ru.json` and  `az.json`\n`\"CALL_NAME\": \"TEXT or WORD\"`\n```json\n// ru.json\n{\n\t\"merhaba\": \"Привет\",\n\t\"merhaba_kullanici\": \"Привет %s\"\n}\n\n// az.json\n{\n\t\"merhaba\": \"Salamlar\",\n\t\"merhaba_kullanici\": \"Salam %s\"\n}\n```\n\n#### \u003e How to get the text or word\n```python\nmlang.get(CALLED NAME)\n```\n\n## Dynamic Example\nYou can use different languages within a project.\n```python\nfrom multilang import multilang\n\nmlang = multilang()\n\nmlang.set(\"lang\", \"tr\")\nprint(mlang.get(\"merhaba_kullanici\") % \"Melih\")\n\n\nmlang.set(\"lang\", \"az\")\nprint(mlang.get(\"merhaba_kullanici\") % \"canim ben\")\n```\n```shell\nOutput;\n\u003e Merhaba Melih\n\u003e Salam canim ben\n```\n\n## Example Using\n```python\n# main.py\nimport multilang\n\nmlang = multilang.multilang()\nmlang.set(\"dir\", \"app/langs/\") # Set the new directory\nmlang.set(\"lang\", \"az\") # Set az lang \n\nmlang.get(\"merhaba\") # Output (return): Salamlar\nprint(mlang.get(\"merhaba_kullanici\") % \"Melih\") # Output (print): Salam Melih\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmberatsanli%2Fmultilangpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmberatsanli%2Fmultilangpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmberatsanli%2Fmultilangpy/lists"}