Commit
still need to write some tests.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -15,7 +15,7 @@ unparse([{'block', Identifier, Contents}|Rest], Acc) -> | |||
unparse([{'blocktrans', Args, Contents, undefined}|Rest], Acc) -> | ||||
unparse(Rest, [["{% blocktrans ", unparse_blocktrans_args(Args), "%}", unparse(Contents), "{% endblocktrans %}"]|Acc]); | ||||
unparse([{'blocktrans', Args, Contents, PluralContents}|Rest], Acc) -> | ||||
unparse(Rest, [["{% blocktrans ", unparse_args(Args), " %}", | ||||
unparse(Rest, [["{% blocktrans ", unparse_blocktrans_args(Args), " %}", | ||||
unparse(Contents), | ||||
"{% plural %}", | ||||
unparse(PluralContents), | ||||
|
@@ -212,5 +212,8 @@ unparse_blocktrans_args([{count, Count}|Args], Acc) -> | |||
unparse_blocktrans_args([{context, Context}|Args], Acc) -> | ||||
unparse_blocktrans_args( | ||||
Args, [["context ", unparse_value(Context)]|Acc]); | ||||
unparse_blocktrans_args([trimmed|Args], Acc) -> | ||||
unparse_blocktrans_args( | ||||
Args, ["trimmed"|Acc]); | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kaos
Author
Member
|
unparse(Rest, [["{% blocktrans ", unparse_blocktrans_args(Args), "%}", unparse(Contents), "{% endblocktrans %}"]|Acc]); |
However, I'm inclined to believe that there is indeed a space missing between blocktrans args, in case there are several. So, perhaps there should be a string:join(Acc, " ")
at the end...
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
seriyps
Oct 19, 2015
Member
@kaos hmm.. I don't see any trailing space on L16: "{% blocktrans ", unparse_blocktrans_args(Args), "%}"
but yes, I mostly talk about situations when there are more than one blocktrans argument, so, if Args = [trimmed, {count, 2}]
result will be {%blocktrans trimmedcount=2%}
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
kaos
Oct 20, 2015
Author
Member
Ha, no, you're right, on line 16, there is a space missing. Will add some more tests to catch this.. 👍 :)
Looks like there should be additional space like
"trimmed "