{"id":19652622,"url":"https://github.com/mostfeatured/localetransformator","last_synced_at":"2025-09-26T12:52:10.753Z","repository":{"id":58951351,"uuid":"534641369","full_name":"MostFeatured/LocaleTransformator","owner":"MostFeatured","description":"Locale Class Into A Yaml Or Reverse","archived":false,"fork":false,"pushed_at":"2022-09-25T16:35:32.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T15:51:44.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/MostFeatured.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":"2022-09-09T12:52:38.000Z","updated_at":"2022-10-02T02:51:26.000Z","dependencies_parsed_at":"2023-01-18T22:01:19.994Z","dependency_job_id":null,"html_url":"https://github.com/MostFeatured/LocaleTransformator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MostFeatured%2FLocaleTransformator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MostFeatured%2FLocaleTransformator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MostFeatured%2FLocaleTransformator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MostFeatured%2FLocaleTransformator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MostFeatured","download_url":"https://codeload.github.com/MostFeatured/LocaleTransformator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240961078,"owners_count":19885254,"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-11T15:11:29.731Z","updated_at":"2025-09-26T12:52:05.720Z","avatar_url":"https://github.com/MostFeatured.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LocaleTransformator\n\nLocale Class Into A Yaml File Or Reverse\n\n## Example\n\n```js\nconst { createDBI } = require(\"@mostfeatured/dbi\");\nconst { localeToYamlFile, yamlFileToLocaleFile, yamlAsLocale, importFromInteractionYamlPack, packInteractionLocalesAsYamls } = require(\"@mostfeatured/locale-transformer\");\n\nconst dbi = createDBI(\"dbi_namespace\", {\n  discord: {\n    token: \"Your Token Here\",\n    options: {\n      intents: [\"Guilds\"]\n    }\n  }\n});\n\n\ndbi.register(({ Locale }) =\u003e {\n  Locale({\n    name: \"tr\",\n    data: {\n      erdem: {\n        isim: \"Erdem\",\n      },\n      türk: \"Türk\"\n    }\n  });\n});\n\n(async () =\u003e {\n  switch (\"fromHere\") {\n\n    case \"fromPack\": {\n      importFromInteractionYamlPack(\"./yamls\", dbi);\n    };\n\n    case \"fromHere\": {\n      dbi.register(({ Locale, InteractionLocale }) =\u003e {\n\n        Locale(yamlAsLocale(\"./en.yaml\"));\n\n\n        InteractionLocale({\n          name: \"cinsiyet seç\",\n          data: {\n            tr: {\n              name: \"cinsiyet seç\",\n              description: \"...\",\n              options: {\n                cinsiyet: {\n                  name: \"cinsiyet\",\n                  description: \"...\",\n                  choices: {\n                    \"Erkek\": \"Erkek\",\n                    \"Kadın\": \"Kadın\"\n                  }\n                }\n              }\n            },\n            en: {\n              name: \"gender pick\",\n              description: \"...\",\n              options: {\n                cinsiyet: {\n                  name: \"gender\",\n                  description: \"...\",\n                  choices: {\n                    \"Erkek\": \"Male\",\n                    \"Kadın\": \"Female\"\n                  }\n                }\n              }\n            }\n          }\n        });\n      });\n    }\n\n  }\n\n  await dbi.load();\n\n  // packing interaction locales into a file\n  await packInteractionLocalesAsYamls(dbi.data.interactionLocales, \"./yamls\");\n\n  console.log(dbi.data.interactionLocales)\n\n  await localeToYamlFile(dbi.data.locales.get(\"tr\"), \"./tr.yaml\");\n\n  await yamlFileToLocaleFile(\"./tr.yaml\", \"./tr.js\");\n\n})();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostfeatured%2Flocaletransformator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmostfeatured%2Flocaletransformator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostfeatured%2Flocaletransformator/lists"}