{"id":23377971,"url":"https://github.com/beyondjs/txt-bundle","last_synced_at":"2025-04-08T04:50:00.418Z","repository":{"id":253711873,"uuid":"816317271","full_name":"beyondjs/txt-bundle","owner":"beyondjs","description":"Effortlessly manage and integrate multilanguage text resources with BeyondJS Text Bundle. Supports languages defined in `package.json` and generates dynamic JavaScript code for efficient text retrieval. Ideal for multilingual applications, content management systems, and dynamic text updates.","archived":false,"fork":false,"pushed_at":"2024-09-20T20:41:32.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-14T03:34:37.871Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beyondjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-06-17T13:49:50.000Z","updated_at":"2024-09-16T11:30:58.000Z","dependencies_parsed_at":"2024-08-19T01:26:02.857Z","dependency_job_id":"61d7bca4-ea49-47f0-9406-26156cc4d94e","html_url":"https://github.com/beyondjs/txt-bundle","commit_stats":null,"previous_names":["beyondjs/txt-bundle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Ftxt-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Ftxt-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Ftxt-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Ftxt-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondjs","download_url":"https://codeload.github.com/beyondjs/txt-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779763,"owners_count":20994572,"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-12-21T18:33:39.065Z","updated_at":"2025-04-08T04:50:00.402Z","avatar_url":"https://github.com/beyondjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeyondJS Text Bundle and Processor\n\n## Overview\n\nThe BeyondJS Text Bundle and Processor are designed to handle text resources efficiently within a BeyondJS application.\nThis bundle is ideal for managing multilanguage text files and integrating them seamlessly into your application. It\nprocesses text files and generates the necessary JavaScript code to access these texts within your application.\n\n## Features\n\n-   **Multilanguage Support**: Efficiently manage and integrate multilanguage text files.\n-   **Dynamic Code Generation**: Automatically generates JavaScript code to access text resources.\n-   **Flexible Configuration**: Supports various configurations to tailor text processing to your needs.\n-   **Seamless Integration**: Easily integrates text resources into your BeyondJS application.\n\n## How It Works\n\nThe Text Bundle processes text files, typically JSON files, and generates JavaScript code that allows you to access\nthese text resources dynamically within your application. It supports multilanguage configurations based on the\nlanguages defined in the `languages` property of the `package.json` file.\n\n### Configuration\n\nTo configure a Text Bundle, define it directly in your module's `module.json` file. Below is an example configuration:\n\n```json\n{\n\t\"name\": \"my-text-module\",\n\t\"txt\": {\n\t\t\"files\": [\"*\"],\n\t\t\"multilanguage\": true\n\t}\n}\n```\n\n### Key Properties\n\n-   **`txt`**: Contains configuration details specific to the Text Bundle.\n    -   **`files`**: Specifies the text files to be processed, supporting glob patterns.\n    -   **`multilanguage`**: Enables multilanguage support based on the `languages` property in `package.json`.\n\n### Example `package.json`\n\nHere’s an example of a `package.json` with the `languages` property:\n\n```json\n{\n\t\"name\": \"my-app\",\n\t\"version\": \"1.0.0\",\n\t\"languages\": [\"en\", \"es\"]\n}\n```\n\n### Basic JSON Text Files\n\nCreate text files for each language in the `texts` directory. Here are examples for English and Spanish:\n\n**texts.json**\n\n```json\n{\n\t\"en\": {\n\t\t\"greeting\": \"Hello\",\n\t\t\"farewell\": \"Goodbye\"\n\t},\n\t\"es\": {\n\t\t\"greeting\": \"Hola\",\n\t\t\"farewell\": \"Adiós\"\n\t}\n}\n```\n\n## Dynamic Code Generation\n\nThe Text Bundle dynamically generates JavaScript code to access the text resources. This code is optimized for efficient\ntext retrieval, ensuring that your application can quickly and easily access the required text resources.\n\n### Example\n\nHere's how to set up a module with the Text Bundle in BeyondJS:\n\n1. **Create a `module.json` file** in your module directory with the following content:\n\n    ```json\n    {\n    \t\"name\": \"my-text-module\",\n    \t\"txt\": {\n    \t\t\"files\": [\"texts/*.json\"],\n    \t\t\"multilanguage\": true\n    \t}\n    }\n    ```\n\n2. **Add your text files** to the `texts` directory as shown in the basic JSON text file examples.\n\n3. **Build your project** to see the dynamically generated JavaScript code for accessing the text resources.\n\n## Advantages of Using the Text Bundle\n\n-   **Multilanguage Text Management**: Easily manage text resources for multiple languages within your application.\n-   **Efficient Text Retrieval**: Optimizes text retrieval by generating JavaScript code that accesses text resources\n    dynamically.\n-   **Simplified Integration**: Reduces the complexity of integrating text resources into your application.\n\n## Potential Use Cases\n\n-   **Multilingual Applications**: Ideal for applications that need to support multiple languages, allowing for easy\n    text management and retrieval.\n-   **Content Management Systems**: Efficiently handle and display text content in various languages.\n-   **Dynamic Text Updates**: Applications that require dynamic updates to text content can benefit from the Text\n    Bundle's capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Ftxt-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondjs%2Ftxt-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Ftxt-bundle/lists"}