Skip to content
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

self closing tags with newTranslationTargetsBlank #117

Closed
10eputzen opened this issue Oct 20, 2024 · 3 comments
Closed

self closing tags with newTranslationTargetsBlank #117

10eputzen opened this issue Oct 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@10eputzen
Copy link

After extracting the translations into my xlf file, the content looks like this:

   <trans-unit id="6575195871133210332" datatype="html">
       <source>Orders</source>
       <target state="new"/>
     </trans-unit>

but I would expect it to look like this (wtihout self-closing empty tags):

   <trans-unit id="6575195871133210332" datatype="html">
        <source>Orders</source>
        <target state="new"></target>
     </trans-unit>

Here is my angular.json:

   "extract-i18n": {
          "builder": "ng-extract-i18n-merge:ng-extract-i18n-merge",
          "options": {
            "buildTarget": "myApp:build",
            "format": "xlf",
            "outputPath": "src/locale",
            "targetFiles": ["messages.de.xlf"],
            "newTranslationTargetsBlank": true
          }
        },
  • Angular: 18.2.1
  • typescript: 5.4.5
  • ng-extract-i18n-merge version: 2.12.0
@10eputzen 10eputzen added the bug Something isn't working label Oct 20, 2024
@daniel-sc
Copy link
Owner

Hi @10eputzen
this will probably be a little difficult to implement, as the serialization relies on https://github.com/nfarina/xmldoc which has no configuration for this. Probably some post processing with regex/search-replace could solve this for most/all cases.

Bevor jumping into implementation, may I ask why this is relevant for you? Both serializations should be handled by all xml tooling in the same way?

@10eputzen
Copy link
Author

I am currently evaluating how use the angular translations in the most efficient way.
And having an empty tag would basically just save me a mousclick and a keyboard stroke (to open the tag and enter text) as it is easier just to click inside the empty tag.
So it is really first world problem and I wouldn't give it a high priority, especially if it is difficult to implement.
But I appreciate you getting back to me.

@10eputzen
Copy link
Author

Thanks buddy! Works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants