Skip to content

Latest commit

 

History

History
92 lines (75 loc) · 1.78 KB

providing-output.md

File metadata and controls

92 lines (75 loc) · 1.78 KB

Providing Output

💡 Tip: input as directory, output as file won't work! ❌

Let's say we have a folder tree like this:

.
└── locale/
    ├── a.po
    ├── b.po
    └── c.po

We can specify the output path with the --output (or -o alias) option.

By providing the output to a filename a-converted.mo:

po2mo ./locale/a.po --output ./locale/a-converted.mo

We can set the output filename as well:

.
└── locale/
    ├── a.po
    ├── a-converted.mo <-- new!
    ├── b.po
    └── c.po

What if we want the outputs to be in the output directory?

po2mo ./locale --output ./output

This will ensure the converted .mo files stored in the output directory:

.
├── locale/
│   ├── a.po
│   ├── b.po
│   └── c.po
└── output/  <-- new!
    ├── a.mo <-- new!
    ├── b.mo <-- new!
    └── c.mo <-- new!

What about the --recursive option for the nested folders?

.
└── locale/
    ├── nested/
    │   ├── aa.po
    │   ├── bb.po
    │   └── cc.po
    ├── a.po
    ├── b.po
    └── c.po

No worries, we preserve the folder structure of the nested .po files!

po2mo ./locale --output ./output --recursive
.
├── locale/
│   ├── nested/
│   │   ├── aa.po
│   │   ├── bb.po
│   │   └── cc.po
│   ├── a.po
│   ├── b.po
│   └── c.po
└── output/       <-- new!
    ├── nested/   <-- new!
    │   ├── aa.mo <-- new!
    │   ├── bb.mo <-- new!
    │   └── cc.mo <-- new!
    ├── a.mo      <-- new!
    ├── b.mo      <-- new!
    └── c.mo      <-- new!