[PR #3593] [CLOSED] Update generate_language_files.cmd #5781

Closed
opened 2026-03-23 22:20:17 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3593
Author: @rishi457
Created: 10/3/2023
Status: Closed

Base: mainHead: patch-1


📝 Commits (1)

  • 65cc023 Update generate_language_files.cmd

📊 Changes

1 file changed (+32 additions, -10 deletions)

View changed files

📝 frontend/scripts/code_generation/language_files/generate_language_files.cmd (+32 -10)

📄 Description

In this script, we've made several improvements to enhance its functionality and flexibility. Here's a breakdown of the changes:

  1. Command-line Arguments: We've added the ability to specify source and destination directories as command-line arguments when running the script. This means you can customize the script's behavior without modifying the script itself.

  2. Default Directories: To provide sensible defaults, we've defined default source and destination directories within the script. These defaults will be used if you don't specify custom directories as command-line arguments.

  3. Dependency Checks: Before proceeding with the script's main tasks, we check if the required dependencies, namely Flutter and Dart, are available in the system's PATH. This ensures that the script doesn't run into issues due to missing dependencies.

  4. Processing Command-line Arguments: We process the command-line arguments using if statements. If you provide custom directories as arguments when running the script, those arguments will override the default directories defined in the script.

  5. Directory Formatting: To ensure that the provided directories end with a backslash, we add a backslash to the directory paths if they are missing it. This ensures consistency in directory paths and prevents potential issues during directory operations.

  6. Copying Files: We use the xcopy command to efficiently copy the contents of the source directory to the destination directory. This step is performed after validating the directories.

  7. Running Localization Tasks: The script continues to execute Flutter and Dart commands for localization tasks as originally intended, specifying the source directory for AppFlowy Localizations and generating language files for AppFlowy.

  8. Logging: We've retained informative log messages to keep you informed about each step of the script's execution.

  9. Return to Original Directory: Finally, the script returns to the original working directory, ensuring that it doesn't leave you in a different directory after completion.

By incorporating these changes, the script becomes more versatile, user-friendly, and robust. You can easily adapt it to your specific project requirements by providing custom source and destination directories as needed.

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/3593 **Author:** [@rishi457](https://github.com/rishi457) **Created:** 10/3/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`65cc023`](https://github.com/AppFlowy-IO/AppFlowy/commit/65cc02395c1425a9deb87d9d64e59615a2381d2b) Update generate_language_files.cmd ### 📊 Changes **1 file changed** (+32 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `frontend/scripts/code_generation/language_files/generate_language_files.cmd` (+32 -10) </details> ### 📄 Description In this script, we've made several improvements to enhance its functionality and flexibility. Here's a breakdown of the changes: 1. **Command-line Arguments**: We've added the ability to specify source and destination directories as command-line arguments when running the script. This means you can customize the script's behavior without modifying the script itself. 2. **Default Directories**: To provide sensible defaults, we've defined default source and destination directories within the script. These defaults will be used if you don't specify custom directories as command-line arguments. 3. **Dependency Checks**: Before proceeding with the script's main tasks, we check if the required dependencies, namely Flutter and Dart, are available in the system's PATH. This ensures that the script doesn't run into issues due to missing dependencies. 4. **Processing Command-line Arguments**: We process the command-line arguments using `if` statements. If you provide custom directories as arguments when running the script, those arguments will override the default directories defined in the script. 5. **Directory Formatting**: To ensure that the provided directories end with a backslash, we add a backslash to the directory paths if they are missing it. This ensures consistency in directory paths and prevents potential issues during directory operations. 6. **Copying Files**: We use the `xcopy` command to efficiently copy the contents of the source directory to the destination directory. This step is performed after validating the directories. 7. **Running Localization Tasks**: The script continues to execute Flutter and Dart commands for localization tasks as originally intended, specifying the source directory for AppFlowy Localizations and generating language files for AppFlowy. 8. **Logging**: We've retained informative log messages to keep you informed about each step of the script's execution. 9. **Return to Original Directory**: Finally, the script returns to the original working directory, ensuring that it doesn't leave you in a different directory after completion. By incorporating these changes, the script becomes more versatile, user-friendly, and robust. You can easily adapt it to your specific project requirements by providing custom source and destination directories as needed. <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:20:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5781
No description provided.