The tool allows you to automate creation of language modules (language.ocmod.zip) for OpenCart 4.x.
The generated modules install flawlessly and translate everything,
including any other extensions you wish to localize.
The tool automatically and correctly generates the entire directory structure, controller, extension language files, and the module's admin view template. It pre-configures all settings, file names, and class names, while copying existing language strings to their appropriate locations.
The tool allows you to compare a base (source) language with a target language selected for verification. During this process, the target language's directory structure and its key => value array contents will be completely rebuilt to match the base language exactly.
- Missing files are automatically copied from the base language to the target language.
- Redundant files found in the target language are moved to a
.redundantfolder. - Line-by-line comparison of keys is performed between the base and target languages:
- Missing keys will be added to the target file and marked with a
/* LM ADDED */comment. - Redundant keys will be commented out and moved to the end of the file.
- Existing keys are preserved along with their current values (translations).
- Comments and other PHP code are synchronized from the base language "as is".
- Missing keys will be added to the target file and marked with a
To use this tool, you must have PHP 8.1 or newer available via the command line (CLI), with the zip extension enabled. While make is recommended, it is optional; you can still use the tool without it by directly invoking the required PHP scripts.
Run the following command from the command line:
- Display detailed help and information for available commands.
make
- Creating installable OpenCart 4.x modules for languages.
- There is an optional
lngparameter available. When specified, the module will be built exclusively for the designated language (among those available).make module lng=french
- If invoked without this parameter, modules will be generated for all available languages.
make module
- There is an optional
- Language Comparison & Synchronization. This command accepts 2 parameters:
master— (Optional) Specifies the base language to be used as a reference when comparing with other languages. Defaults to"english"if omitted, but can be set to any of the available languages.compare— Specifies the target language to be verified and compared against the base language.ormake rewrite check=french
make rewrite master=english check=french
Contributions are welcome! Please read Contributing for details.
In our development, we follow the principles of YAGNI and KISS. The source code should not have extra unnecessary functionality and should be as simple and efficient as possible.
This package is licensed for use under the MIT License (MIT).
Please see LICENSE for more information.