-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
Extract tool should write the source file name into the resource file #14190
Comments
I also think that this is how is supposed to work. I am hoping this feature will be implemented soon, as it'll save a lot of time to everyone! |
Yes this is planned - any help would be appreciated ! |
Good idea. Thumbs up. |
This is a great idea. I am adding one use case here. In a large project scenario, as a localization engineer, I want to know which file or template a string come from so I can communicate to a developer who owns the file or template. |
Hi vicb, it is glad to know there is a plan in place. can you please share the timeline of the plan? |
I love this idea. Hope , we see this feature implemented soon. This will definitely help better manage the strings. |
Hello, I'll start working on this one |
I tested it and it works. Thank you!
Having absolute path makes it hard to use the values if you move the directory in another location.
What is the reason for that? Could it be in an attribute like
This would be easier to read by humans and localization tools.
|
good points, can you open an issue for those? especially the last one which is a bug I think |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
At the moment the extract tool generates the id values. The id value depends on the extracted string value. This means that if you change the value (e.g. fix a typo) the id gets changed. This is why our localization tool when scanning XTB or XLF does not use id attribute but the meaning attribute. We use meaning to give a unique and fixed id for each elements. Something like this
<p i18n="HeaderText|">Sample</p>
Now the extract tool gives us following
<msg id="8884523860497558714" meaning="HeaderText">Sample</msg>
The meaning value does not change unless the developer explicitly changes it. In addition the above meaning value “HeaderText” is much more informative as “8884523860497558714”.
Unfortunately it is hard to get meaning values unique among all templates.
Expected behavior
It would help a lot if the extracting tool would write the relative path name of the template file (.html or .ts) where the string comes from. Something like this
<msg id="8884523860497558714" meaning="header" source="src/app/admin/main.html">Sample</msg>
Where the source attributes contains the file name where the string comes from. Now our tool could get a unique if by combining source and meaning values. Because the meaning values would need to be unique only within the single template it would be a lot easier for the developer to maintain them.
What is the motivation / use case for changing the behavior?
To make Angular 2 localization easier and increase the translation quality
Please tell us about your environment:
Angular version: 2.0.X
All
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All
Language: [all | TypeScript X.X | ES6/7 | ES5]
All
Node (for AoT issues):
node --version
=All
The text was updated successfully, but these errors were encountered: