question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

i18n ignore leading and trailing spaces

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

now ng-xi18n will generate xliff including spaces, for example there is an element

    <p i18n>
        复制
    </p>

it will generate

        <source>
                    复制
                </source>

it’s really weak to rely on spaces since they could changed Unintentionally or even by IDE reformat code.

Expected behavior

ignore leading and tailing spaces

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:92
  • Comments:52 (23 by maintainers)

github_iconTop GitHub Comments

16reactions
petebacondarwincommented, Sep 3, 2020

Hi everyone. This has not been on my radar but it sounds like it might be a good idea to implement it. I think we could put it behind some kind of flag to prevent a breaking change. In the not-too-distant future we also need to migrate away from our legacy message ids, so this could also be part of that work. Since this is not a trivial piece of work, I am not sure right now when it will be implemented. Sorry not to give you any better indication, right now.

10reactions
klugeh01commented, Jan 30, 2020

The issue remains in 2020. Just because it’s “going to be in ivy” doesn’t mean it can’t be fixed here…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I stop a label from automatically trimming white ...
So far I've tried placing a space after the i18n key itself to no avail. ... the label from automatically removing the trailing...
Read more >
NSCollectionLayoutEdgeSpacing - Apple Developer
The leading and trailing spaces within edge spacing differ in left-to-right versus right-to-left environments. In a left-to-right environment, the leading ...
Read more >
Whitespaces are Evil..How Angular translates your string ...
This post contains a set of statements on how to tag particular element with i18n and cases developer needs to consider while coding....
Read more >
How to ignore extra whitespaces in translation functions like _e?
A better bet would be to translate multiple smaller fixed text strings and then join them later, or to adjust your code so...
Read more >
trimws: Remove Leading/Trailing Whitespace - Rdrr.io
x. a character vector. which. a character string specifying whether to remove both leading and trailing whitespace (default), or only leading ( "left"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found