-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting yaml values in single quotes #304
Comments
This is probably realated. but also when there is seemingly no value for an item...
if I just request the translation of jula to be the same, then po4a will make the line
which the hugo web server is not happy with... :) |
Is it a regression? If so, can you bisect it? |
Hello @boydkelly, sorry for the delay. Can you provide us with a way to reproduce the bug? Maybe an access to your code, or a minimal example that we could play with? We cannot debug po4a without something like this. Thanks for reporting, |
Hi Sorry, I had put this on back burner and since I worked around the issue with a bit of sed.... Please see the attached example files. The source en/font-test.adoc yaml header has an entry: The hugo static site generator will complain about that and the build will fail. Now of course this could be a hugo problem as well. I'm not sure what is considered valid here. And I do just fix this in a script with sed so there is no urgency on my part. Thanks for such a great tool!!! |
How to reproduce: example.yaml $ po4a-gettextize \
--format yaml \
--option keys="title description" \
--master "example.yaml" \
--master-charset "UTF-8" \
--po "example.po" $ po4a-translate \
--format yaml \
--option keys="title description" \
--master "example.yaml" \
--master-charset "UTF-8" \
--po "example_pt-br.po" \
--localized "example_pt-br.yaml" \
--localized-charset "UTF-8" It's the same when using Asciidoc formatter. |
If you see the tests, there are translations with quotes where the original doesn't. skiparray.yaml It's different, but it's not an issue. The issue here is when this happens: These different behaviors are odd.
|
It seems there is already a workaround for One more would be something like this: if ( Scalar::Util::looks_like_number($el) ) {
$self->pushline("$header $el\n");
} elsif ( $el =~ /^\[.*\]$/ ) {
$self->pushline("$header $el\n");
} else {
$self->pushline( $header . ' ' . YAML::Tiny::_dump_scalar( "dummy", $el ) . "\n" );
} But I'm not sure if you want to look into the yaml modules for a better solution. Sorry, I don't have much experience with this. |
Thank you very much!!! Yes this is now working for me. I was anxious to ditch my sed script running after po41 and so packaged this rpm till Fedora gets it update to 0.67. Covers a number of rpm distros... |
Recently came back to my website and it seems that po4a is single qoteing some yaml header values.
In an en pot file I have:
in the French translated po file:
But in the final French document after running po4a I have (single quoted):
I can get by with some sed for the time being. Here are the options I am using to run po4a.
Thanks for all your work on this amazing project!
The text was updated successfully, but these errors were encountered: