criticalmanufacturing / cli

Critical Manufacturing Projects Command Line Tool
https://criticalmanufacturing.github.io/cli/
BSD 3-Clause "New" or "Revised" License
12 stars 28 forks source link

cmf build for help does not take culture into consideration #443

Open iurifarenzena opened 6 days ago

iurifarenzena commented 6 days ago

If you have a help project and want to have it written in more than one language, the files generated from templates do not take the culture into account.

For example, lets say you have a DEE described in two languages, the neutral one and Taiwanese Chinese (zh-TW). After cmf build the cmf-custom-help.deeactions_template is going to generate a cmf-custom-help.deeactions.md file with duplicated entries. image

The GenerateBasedOnTemplatesCommand command should be able to identify the supported cultures configured in the documentation app (config.json > general.supportedCultures) and generate separated .md from the _template for each one. It should also support having a template for each culture as well. For example, lets consider the following config:

  "general": {
    "supportedCultures": [
      "en-US",
      "zh-TW"
    ],
    "startup": {
      "startupCulture": "en-US",
    },
  },

Then under templates we would have two template files:

After build it would have generated two .md files: