Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quote translations to stop them looking like numbers
- Loading branch information
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52f0ba7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nikerabbit I had to change this to stop ruby's YAML parser reading them as numbers - could you have a look at your export code and see if you can make it quote them?
52f0ba7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, your parser is right: http://yaml.org/spec/1.2/spec.html#id2805071
We are using phpyaml, which only claims to support yaml 1.1 – that spec is not clear on this. I have reported https://bugs.php.net/bug.php?id=76309 anyway.
I will look if I can use http://php.net/manual/en/yaml.callbacks.emit.php to force the type to string in the meanwhile.
52f0ba7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is unchanged between 1.2 and 1.1 but haven't looked in detail.
52f0ba7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I did not manage to get the callback option to do anything useful. In the end I am proposing a hack that inserts magic tokens to problematic values which are converted to quotes by a simple string replacement. I think it is safe enough to not break anything else with a small performance impact.