{"id":20173139,"url":"https://github.com/apitable/apitable-settings-generator","last_synced_at":"2025-04-10T03:17:06.293Z","repository":{"id":63403882,"uuid":"567206131","full_name":"apitable/apitable-settings-generator","owner":"apitable","description":"A settings generator and loader powered by APITable","archived":false,"fork":false,"pushed_at":"2022-12-19T09:53:59.000Z","size":269,"stargazers_count":10,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T03:17:06.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apitable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2022-11-17T09:51:20.000Z","updated_at":"2024-07-31T12:51:15.000Z","dependencies_parsed_at":"2023-01-29T21:15:47.543Z","dependency_job_id":null,"html_url":"https://github.com/apitable/apitable-settings-generator","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/apitable%2Fapitable-settings-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitable%2Fapitable-settings-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitable%2Fapitable-settings-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apitable%2Fapitable-settings-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apitable","download_url":"https://codeload.github.com/apitable/apitable-settings-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148247,"owners_count":21055548,"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-14T01:33:51.844Z","updated_at":"2025-04-10T03:17:06.275Z","avatar_url":"https://github.com/apitable.png","language":"TypeScript","readme":"![cover](https://socialify.git.ci/apitable/apitable-settings-generator/image?description=1\u0026font=Inter\u0026language=1\u0026name=1\u0026pattern=Diagonal%20Stripes\u0026stargazers=1\u0026theme=Dark)\n\n# APITable Settings Generator\n\n[![npm](https://img.shields.io/npm/v/apitable-settings-generator)](https://www.npmjs.com/package/apitable-settings-generator)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/apitable/apitable-settings-generator/npm-publish)](https://github.com/apitable/apitable-settings-generator/actions)\n[![npm bundle size](https://img.shields.io/bundlephobia/min/apitable-settings-generator)](https://www.npmjs.com/package/apitable-settings-generator)\n[![npm](https://img.shields.io/npm/dm/apitable-settings-generator)](https://www.npmjs.com/package/apitable-settings-generator)\n\nAPITable Settings Generator convert APITable datasheet into JSON data.\n\nFor example, you have [APITable](https://apitable.com) like this:\n\n| name           | emoji | category |\n| -------------- | ----- | -------- |\n| jack_o_lantern | 🎃    | A        |\n| christmas_tree | 🎄    | B        |\n| fireworks      | 🎆    | A        |\n| sparkler       | 🎇    | C        |\n| firecracker    | 🧨    | D        |\n\nIt will generate JSON settings like this:\n\n```json\n{\n  \"jack_o_lantern\": {\n    \"emoji\": \"🎃\",\n    \"category\": \"A\"\n  },\n  \"christmas_tree\": {\n    \"emoji\": \"🎄\",\n    \"category\": \"B\"\n  },\n  \"fireworks\": {\n    \"emoji\": \"🎆\",\n    \"category\": \"A\"\n  },\n  \"sparkler\": {\n    \"emoji\": \"🎇\",\n    \"category\": \"C\"\n  },\n  \"firecracker\": {\n    \"emoji\": \"🧨\",\n    \"category\": \"D\"\n  }\n}\n```\n\n## Use Case\n\n- Localization\n- Features Flag\n- Remote Config\n- Software Settings\n- Game Development\n- ......\n\n## Usage\n\nAPITable Settings Generator provides 5 generated settings format:\n\n- `rows` (default)\n- `columns`\n- `array`\n- `column-files`\n- `properties-files`\n\nAssume you have this APITable:\n\n| id          | en_US           | zh_CN           |\n| ----------- | --------------- | --------------- |\n| login_title | Login APITable  | 中文 APITable   |\n| some text   | some text en_US | some text zh_CN |\n\nAPITable Settings Generator generate settings in different mode:\n\n### Format: `Rows`\n\nYou have this JSON config file `config.json`:\n\n```json\n[\n  {\n    \"dirName\": \"./generated\",\n    \"fileName\": \"i18n.generated.json\",\n    \"tables\": [\n      {\n        \"datasheetId\": \"dstbUhd5coNXQoXFD8\",\n        \"datasheetName\": \"strings\",\n        \"format\": \"rows\",\n        \"params\": {}\n      }\n    ]\n  }\n]\n```\n\nRun APITable Settings Generator (`asg`):\n\n```bash\n# run in bash\nnpx apitable-settings-generator --config config.json --token ${HERE_IS_YOUR_APITABLE_TOKEN}\n```\n\nGenerated settings `i18n.generated.json`:\n\n```json\n{\n  \"strings\": {\n    \"login_title\": {\n      \"en_US\": \"Login APITable\",\n      \"zh_CN\": \"中文APITable\"\n    },\n    \"some text\": {\n      \"en_US\": \"some text en_US\",\n      \"zh_CN\": \"some text zh_CN\"\n    }\n  }\n}\n```\n\n### Format: `Columns`\n\nYou have this JSON config file `config.json`:\n\n```json\n[\n  {\n    \"dirName\": \"./generated\",\n    \"fileName\": \"i18n.generated.json\",\n    \"tables\": [\n      {\n        \"datasheetId\": \"dstbUhd5coNXQoXFD8\",\n        \"datasheetName\": \"strings\",\n        \"format\": \"columns\",\n        \"params\": {}\n      }\n    ]\n  }\n]\n```\n\nRun APITable Settings Generator (`asg`):\n\n```bash\n# run in bash\nnpx asg --config config.json --token ${HERE_IS_YOUR_APITABLE_TOKEN}\n```\n\nGenerated settings `i18n.generated.json`:\n\n```json\n{\n  \"strings\": {\n    \"zh_CN\": {\n      \"login_title\": \"中文APITable\",\n      \"some text\": \"some text zh_CN\"\n    },\n    \"en_US\": {\n      \"login_title\": \"Login APITable\",\n      \"some text\": \"some text en_US\"\n    }\n  }\n}\n```\n\n### Format: `Array`\n\nYou have this JSON config file `config.json`:\n\n```json\n[\n  {\n    \"dirName\": \"./generated\",\n    \"fileName\": \"i18n.generated.json\",\n    \"tables\": [\n      {\n        \"datasheetId\": \"dstbUhd5coNXQoXFD8\",\n        \"datasheetName\": \"strings\",\n        \"format\": \"array\",\n        \"params\": {}\n      }\n    ]\n  }\n]\n```\n\nRun APITable Settings Generator (`asg`):\n\n```bash\n# run in bash\nnpx apitable-settings-generator --config config.json --token ${HERE_IS_YOUR_APITABLE_TOKEN}\n```\n\nGenerated settings `i18n.generated.json`:\n\n```json\n{\n  \"strings\": [\n    {\n      \"id\": \"login_title\",\n      \"en_US\": \"Login APITable\",\n      \"zh_CN\": \"中文APITable\"\n    },\n    {\n      \"id\": \"some text\",\n      \"en_US\": \"some text en_US\",\n      \"zh_CN\": \"some text zh_CN\"\n    }\n  ]\n}\n```\n\n### Format: `Column Files`\n\nThis format will separate columns into different files.\n\nYou have this JSON config file `config.json`:\n\n```json\n[\n  {\n    \"dirName\": \"./generated\",\n    \"fileName\": \"i18n.*.generated.json\",\n    \"tables\": [\n      {\n        \"datasheetId\": \"dstbUhd5coNXQoXFD8\",\n        \"datasheetName\": \"strings\",\n        \"format\": \"column-files\",\n        \"params\": {}\n      }\n    ]\n  }\n]\n```\n\nRun APITable Settings Generator (`asg`):\n\n```bash\n# run in bash\nnpx apitable-settings-generator --config config.json --token ${HERE_IS_YOUR_APITABLE_TOKEN}\n```\n\nGenerated settings `i18n.en_US.generated.json`:\n\n```json\n{\n  \"strings\": {\n    \"en_US\": {\n      \"login_title\": \"Login APITable\",\n      \"some text\": \"some text en_US\"\n    }\n  }\n}\n```\n\nGenerated settings `i18n.zh_CN.generated.json`:\n\n```json\n{\n  \"strings\": {\n    \"zh_CN\": {\n      \"login_title\": \"中文APITable\",\n      \"some text\": \"some text zh_CN\"\n    }\n  }\n}\n```\n\n### Format: `Properties Files`\n\n`.properties` is a file extension for files that store configurable parameters for an application. They can also store strings for internationalization and localization, and such files are called Property Resource Bundles.\n\nUsually the format of the file contents is `key=value`.\n\nSo the files need to be saved according to the different languages when they are generated\n\nYou have this JSON config file `config.json`:\n```typescript\n[\n  {\n    \"dirName\": \"./generated\",\n    \"fileName\": \"i18n_*.properties\",\n    \"languageList\"?: [\n      \"zh_CN\",\n      \"en_US\"\n    ],\n    \"tables\": [\n      {\n        \"datasheetId\": \"dstbUhd5coNXQoXFD8\",\n        \"datasheetName\": \"i18n\",\n        \"format\": \"properties-files\",\n        \"params\"?: {...}\n      }\n    ]\n  }\n]\n```\n\n\u003e **Note:** We have provided an interesting parameter `languageList` here.\n\u003e when you have many internationalized language settings, then you can specify parameters to control the list of accepted languages.\n\u003e\n\u003e example：\n\u003e  languageList:[\"zh_CN\"]\n\nRun APITable Settings Generator (`asg`):\n```bash\n# run in bash\nnpx apitable-settings-generator --config config.json --token ${HERE_IS_YOUR_APITABLE_TOKEN}\n```\n\nGenerated settings `i18n_en_US.properties`:\n```properties\nlong_text=Hello apitable\nshort_text=Hello\n```\n\nGenerated settings `i18n_zh_CN.properties`:\n```properties\nlong_text=你好 apitable\nshort_text=你好\n```\n\nTips：\n1. When you have the following list of languages\n\n```\ni18n_en_US.properties\ni18n_zh_CN.properties\n```\n\nWhen you only need the `zh_CN` configuration package, you can now use the `languageList` attribute to control the output files, e.g.\n\n```\n...\nlanguageList: ['zh-CN']\n...\n```\nNow only the language file `i18n_zh_CN.properties` you specified will be output\n\n## Conventions\n\nWe make some convetion that help you do more magic work:\n\n- Ignore the column that name starts with `.`;\n- Ignore the Primary Key that valut starts with `.`;\n\n\nIf you want to more features, please [new an issue](https://github.com/apitable/apitable-settings-generator/issues/new) for us.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapitable%2Fapitable-settings-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapitable%2Fapitable-settings-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapitable%2Fapitable-settings-generator/lists"}