Package: idem-ai
idem-aiextends idem with translation capabilities from thepop-mlplugin,
enabling multilingual support in infrastructure management workflows.idem-ai source codeidem-ai documentationAboutidem-aiextends idem, a powerful infrastructure and configuration management tool,
by adding translation capabilities from the pop-ml plugin.
With idem-ai, you can enable multilingual support in your infrastructure management workflows.By integrating idem-ai into your idem environment,
you gain access to additional contracts and features that enable translation in various aspects of idem.
The added contracts fromidem-aiprovide translation capabilities for logs, state comments, and rend output.
This means you can translate log messages,
comments within your states,
and the rendered output of commands to facilitate communication in multiple languages.idem-ai also introduces anml.translateexec module,
which allows you to perform on-the-fly translations using pop-ml.
This module can be used within Jinja in SLS or invoked directly on the command line,
giving you flexibility in translating text in your idem environment.With idem-ai, you can effortlessly manage multilingual environments,
ensuring clear and consistent communication across language barriers in your infrastructure management workflows.What is POP?This project is built withpop, a Python-based
implementation ofPlugin Oriented Programming (POP). POP seeks to bring
together concepts and wisdom from the history of computing in new ways to solve
modern computing problems.For more information:Intro to Plugin Oriented Programming (POP)pop-awesomepop-createGetting StartedPrerequisitesPython 3.8+git(if installing from source, or contributing to the project)InstallationNoteIf wanting to contribute to the project, and setup your local development
environment, see theCONTRIBUTING.rstdocument in the source repository
for this project.If wanting to useidem-ai, you can do so by either
installing from PyPI or from source.Install from PyPIpipinstallidem-aiInstall from source# clone repogitclonegit@gitlab.com/vmware/idem/idem-ai.gitcdidem-ai# Setup venvpython3-mvenv.venvsource.venv/bin/activatepipinstall-e.UsageTo useidem-ai, you need to create a YAML configuration file that defines the behavior of the translation.Here’s an example YAML configuration file:idem:translate_output:Falsetranslate_comments:Falsetranslate_docs:Falsetranslate_logs:Falsepop_ml:source_lang:endest_lang:esThis configuration file contains various options that control the translation behavior:translate_output: If set to True, the output of the execution will be translated. Default is False.translate_comments: If set to True, the comments of states  and exec moduleswill be translated. Default is False.translate_logs: If set to True, the log messages will be translated. Default is False.dest_lang: The destination language for translation. Default is “es”.source_lang: The source language for translation. Default is “en”.Thedest_langparameter is required for the translation to work. It should be a two-letter language code.You can modify these options based on your requirements.ExamplesHere are some example commands that demonstrate the usage of idem-ai:Translate a text using the ml.translate exec module:idemexecml.translate"Hello World!"dest_lang=esNoteMake sure to replace config.yaml with the path to your actual YAML configuration file.Translate logs using the–translate-logsoption:idem-cmy_config.cfgexectest.ping--translate-logs--log-level=debugIn this example, the –translate-logs option enables the translation of logs with pop-ml.
This will translate the log messages into the specified destination language.Translate state comments using the –translate-state-comments option:idem-cmy_config.cfgstatemy_state.sls--translate-state-commentsIn this example, the –translate-state-comments option enables the translation of state comments.
This will translate the comments from state output from the run into the specified destination language.Translate rend output using the –translate-output option:idem-cmy_config.cfgexectest.ping--translate-outputIn this example, the –translate-output option enables the translation of rend output for a doc subcommand.
However, please note that enabling this option may cause unpredictable behavior for CLI programs.
It is recommended to use it with caution.Translate docstrings fromidem docusing the –translate-docs option:idem-cmy_config.cfgdocexec.test.ping--translate-docsIn this example, the –translate-docs option enables the translation of docs for the exec.test.ping command.
This will translate the documentation associated with the specified command into the specified destination language
without translating keys, paths, refs, and other values unrelated to docs.Noteidem’s CLI options take precedence over the options specified in the configuration file.
This means that if you specify an option both in the configuration file and as a command-line argument,
the command-line argument will take precedence.RoadmapReference theopen issuesfor a list of
proposed features (and known issues).AcknowledgementsImg Shieldsfor making repository badges easy.