[Po4a-devel] How to cleanup input file before generating po file and output file after generating doc file?

Brian Exelbierd bex at pobox.com
Sat Feb 18 14:21:43 UTC 2017


On Fri, Feb 17, 2017, at 10:18 AM, Jean-Baptiste Holcroft wrote:
> Hi,
> 
> thank you for this great software, I want to use it to translate a 
> static website using Pelican[1], but I have issue with "file 
> metadata"[2] (go to markdown syntax)
> 
> On top of each markdown file, I have some lignes starting with "KEYWORD: 
> example text", bug line returns are moved both in po file and output 
> doc.
> 
> For example, in test.md file, I have:
> Title: My title
> Lang: en
> Slug: my-title
> 
> I get in my po file: Title: My title Lang: en Slug: my-title
> And when it output test.fr.md, it makes: Title: Mon titre Lang: fr Slug: 
> my-title

This is because text can be freely rewrapped and not lose its meaning. 
These three lines read to a machine like three lines in a paragraph even
though to us they are semantically three key/value pairs.

I've opened https://github.com/mquinson/po4a/issues/8 to start to think
about this.  There are some other issues there too that may be worth
weighing in on.

The branch I've created is working, but needs tests.

regards,

bex

> 
> I tried to enderstand how to use the -o breaks, but failed.
> In addition:
>   * all those medata lignes are mandatory,
>   * pelican do not accept to add to line returns between each metadata.
> 
> I assume I have to build:
>   * a script to add new lines in source content,
>   * a script to remove it from output markdown files.
> 
> I'm afraid I don't how to this, or is there any other solution?
> 
> My source code is in https://github.com/Jibec/Simon you may generate 
> content by using build-translation.sh (other bash files will be removed, 
> it took me time to understand po4a.cfg was a great all-in-one 
> sollution).
> 
> thanks for your help,
> 
> [1] https://blog.getpelican.com/
> [2] 
> http://docs.getpelican.com/en/stable/content.html?highlight=Title%3A#file-metadata
> 
> _______________________________________________
> Po4a-devel mailing list
> Po4a-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/po4a-devel



More information about the Po4a-devel mailing list