Skip to content

Multilingual solution based on data language files #45

Description

@fdeneux

Hello, first of all great work on panini!

I'm looking for a specific multilingual solution, where you have a single multilingual structure (page) that is compiled to language specific html files for every language file in data.

Example:

root
│
│───src/
│   │
│   │───data/
│   │   |───en.yml
│   │   |───es.yml
│   │   └───fr.yml
│   │
│   │───layouts/
│   │   └───default.hbs
│   │
│   └───pages/
│       └───index.hbs
│
└───dist/
    │───index-en.html
    │───index-es.html
    └───index-fr.html

This can be achieved with the combination of gulp-swig and gulp-data, but I'd like to know if such a solution is possible with panini as I really like the generator.

An even better solution is to compile to a folder for every language:

root
│
│───src/
│   │
│   │───data/
│   │   |───en.yml
│   │   |───es.yml
│   │   └───fr.yml
│   │
│   │───layouts/
│   │   └───default.hbs
│   │
│   └───pages/
│       └───index.hbs
│
└───dist/
    │
    │───en/
    │   └───index.html
    │
    │───es/
    │   └───index.html
    │
    └───fr/
        └───index.html

Another interesting solution is to have a structured languages data subfolder, that would allow you to split your data files.

root
│
│───src/
│   │
│   │───data/
│   │   │
│   │   └───languages/
│   │       │
│   │       │───en/
│   │       │   │───info.yml
│   │       │   └───item-list.yml
│   │       │
│   │       │───es/
│   │       │   │───info.yml
│   │       │   └───item-list.yml
│   │       │
│   │       └───fr/
│   │           │───info.yml
│   │           └───item-list.yml
│   │
│   │───layouts/
│   │   └───default.hbs
│   │
│   └───pages/
│       └───index.hbs
│
└───dist/
    │
    │───en/
    │   └───index.html
    │
    │───es/
    │   └───index.html
    │
    └───fr/
        └───index.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions