How jotapardo/sharedjsfilestranslatortool works
Project type and purpose
• This is a Windows desktop utility (not a web app) that automates the creation, translation, and sorting of resource entries in shared.js/.resx files for a VueJS project. It is a standalone “open-source tool” with a GUI front end and an integration to the Azure Translator service.
File structure
• A Windows UI project (likely C#/WPF or WinForms) called Resources.Shared.Files
• A Configuration module that manages the i18n/lang folder path
• A Translation module that batches calls to Azure Services
• A Sorting module that alphabetizes the resource files
• A version-checker that polls the official site for updates
• Generated output: JS or RESX resource files in i18n/lang/<lang>
README for additional insights
• Key flows described:
• On startup, the app checks for updates
• The user sets the target directory (i18n/lang) in Configuration
• The user switches to Translation view, enters English texts, picks target languages, optionally edits the PascalCase keys, and clicks TRANSLATE
• The tool calls Azure Translator (external REST API), receives translations for ES, PT, DE, FR, and writes/merges them into the resource files
• The user can then go to Sorting to alphabetize the entries
a. UI Layer (“Resources.Shared.Files” application)
• Sub-components / views:
• Configuration View
• Translation View
• Sorting View
• Version-Checker module (background)
b. Application Logic Layer
• Configuration Manager (reads/writes the selected folder path)
• File I/O Manager (loads, parses, and writes .js/.resx files)
• Translation Manager (prepares batch requests, coordinates Azure calls)
• Sorting Manager (sorts resource keys)
c. External Services
• Azure Translator Cognitive Service (REST API)
• Official update server (HTTP endpoint for version info)
d. File System
• i18n/lang folder
• Sub-folders per language (es/, pt/, de/, fr/)
• Resource files: .js or .resx
Architectural patterns & design principles
• Single Process, Modular GUI: The Windows app is the single host, with distinct modules for configuration, translation, and sorting.
• Layered approach: UI → Business Logic → File I/O → External Services
• Separation of Concerns:
• Each feature has its own manager/class
• External calls abstracted behind a Translation Manager interface
• Dependency Injection (likely used for swappable translation services)
Summary of what
• Components: Configuration, Translation, Sorting, Version Checker
• File System: i18n/lang folder structure
• External Services: Azure Translator and Update Server