<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
When running <code class="notranslate">ng-xi18n -p src/tsconfig.app.json --i18nFormat xlf</code> and one of the node_modules includes translatable strings, the full path of that context is written to the <code class="notranslate">messages.xlf</code> file:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="       &lt;trans-unit id=&quot;cedd5f9cee5d6a1681605d996cf45ab5398fabcd” datatype=&quot;html&quot;&gt;
         &lt;source&gt;Source Language&lt;/source&gt;
         &lt;target/&gt;
        &lt;context-group purpose=&quot;location&quot;&gt;
          &lt;context context-type=&quot;sourcefile”&gt;/Users/my_user/my_project/node_modules/my_dependency/index.ts&lt;/context&gt;
          &lt;context context-type=&quot;linenumber&quot;&gt;42&lt;/context&gt;
        &lt;/context-group&gt;
       &lt;/trans-unit&gt;"><pre class="notranslate">       &lt;<span class="pl-ent">trans-unit</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>cedd5f9cee5d6a1681605d996cf45ab5398fabcd” datatype=<span class="pl-pds">"</span></span>html<span class="pl-s"><span class="pl-pds">"</span>&gt;</span>
<span class="pl-s">         &lt;source&gt;Source Language&lt;/source&gt;</span>
<span class="pl-s">         &lt;target/&gt;</span>
<span class="pl-s">        &lt;context-group purpose=<span class="pl-pds">"</span></span>location<span class="pl-s"><span class="pl-pds">"</span>&gt;</span>
<span class="pl-s">          &lt;context context-type=<span class="pl-pds">"</span></span>sourcefile”&gt;/Users/my_user/my_project/node_modules/my_dependency/index.ts&lt;/<span class="pl-ent">context</span>&gt;
          &lt;<span class="pl-ent">context</span> <span class="pl-e">context-type</span>=<span class="pl-s"><span class="pl-pds">"</span>linenumber<span class="pl-pds">"</span></span>&gt;42&lt;/<span class="pl-ent">context</span>&gt;
        &lt;/<span class="pl-ent">context-group</span>&gt;
       &lt;/<span class="pl-ent">trans-unit</span>&gt;</pre></div>
<p dir="auto"><strong>Expected behavior</strong><br>
I'd expect something along the lines of</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="       &lt;trans-unit id=&quot;cedd5f9cee5d6a1681605d996cf45ab5398fabcd” datatype=&quot;html&quot;&gt;
         &lt;source&gt;Source Language&lt;/source&gt;
         &lt;target/&gt;
        &lt;context-group purpose=&quot;location&quot;&gt;
          &lt;context context-type=&quot;sourcefile”&gt;node_modules/my_dependency/index.ts&lt;/context&gt;
          &lt;context context-type=&quot;linenumber&quot;&gt;42&lt;/context&gt;
        &lt;/context-group&gt;
       &lt;/trans-unit&gt;"><pre class="notranslate">       &lt;<span class="pl-ent">trans-unit</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>cedd5f9cee5d6a1681605d996cf45ab5398fabcd” datatype=<span class="pl-pds">"</span></span>html<span class="pl-s"><span class="pl-pds">"</span>&gt;</span>
<span class="pl-s">         &lt;source&gt;Source Language&lt;/source&gt;</span>
<span class="pl-s">         &lt;target/&gt;</span>
<span class="pl-s">        &lt;context-group purpose=<span class="pl-pds">"</span></span>location<span class="pl-s"><span class="pl-pds">"</span>&gt;</span>
<span class="pl-s">          &lt;context context-type=<span class="pl-pds">"</span></span>sourcefile”&gt;node_modules/my_dependency/index.ts&lt;/<span class="pl-ent">context</span>&gt;
          &lt;<span class="pl-ent">context</span> <span class="pl-e">context-type</span>=<span class="pl-s"><span class="pl-pds">"</span>linenumber<span class="pl-pds">"</span></span>&gt;42&lt;/<span class="pl-ent">context</span>&gt;
        &lt;/<span class="pl-ent">context-group</span>&gt;
       &lt;/<span class="pl-ent">trans-unit</span>&gt;</pre></div>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<ul dir="auto">
<li>On a team other committers will generate different output, conflicting when checking in.</li>
<li>I don't want to leak my internal file structure.</li>
</ul>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ npm --version
4.2.0
$ cat package.json | grep '&quot;@angular/compiler-cli&quot;'
    &quot;@angular/compiler-cli&quot;: &quot;^4.1.3&quot;,"><pre class="notranslate"><code class="notranslate">$ npm --version
4.2.0
$ cat package.json | grep '"@angular/compiler-cli"'
    "@angular/compiler-cli": "^4.1.3",
</code></pre></div>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">When ng-i18n extract strings it adds source element that contains the source code and line where the strings was extracted. This is very good.</p>
<p dir="auto">However the extracted source code file is absolute.</p>
<p dir="auto"><code class="notranslate">&lt;msg id="1238358838717941284"&gt;&lt;source&gt;D:/Source/Angular/Escape/src/app/app.component.ts:2&lt;/source&gt;Sample&lt;/msg&gt; </code></p>
<p dir="auto">Would be better to have relative to the project root</p>
<p dir="auto"><code class="notranslate">&lt;msg id="1238358838717941284"&gt;&lt;source&gt;src/app/app.component.ts:2&lt;/source&gt;Sample&lt;/msg&gt; </code></p>
<p dir="auto">This would make it easier to move the project into different location. It might also be the different developers or localization enginerrs have different local directory structures.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Use relative path.</p>
<p dir="auto"><code class="notranslate">&lt;msg id="1238358838717941284"&gt;&lt;source&gt;src/app/app.component.ts:2&lt;/source&gt;Sample&lt;/msg&gt; </code></p>
<p dir="auto">In addition it would be better to store source into an attribute instead of source element inside the string playload.</p>
<p dir="auto"><code class="notranslate">&lt;msg id="1238358838717941284" source="src/app/app.component.ts:2"&gt;Sample&lt;/msg&gt; </code></p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto">Extract any template</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">Make localization easier.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<p dir="auto">Windows 10, VS code 1.12.1</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 4.0.X</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> all</p>
</li>
</ul>