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

[Feature request] XLF file validation #10

Closed
fvet opened this issue Jul 12, 2019 · 4 comments
Closed

[Feature request] XLF file validation #10

fvet opened this issue Jul 12, 2019 · 4 comments
Labels
enhancement New feature or request shipped Issue is available in the public release.

Comments

@fvet
Copy link

fvet commented Jul 12, 2019

It would be intesting if the XLIFF sync could also provide support to check the 'technical' quality of the translations:

  • For option fields (Note tag with 'Property OptionCaption'), ensure the number of option values (= number of comma's) is the same accross all translation files.
  • For option fields (Note tag with 'Property OptionCaption'), ensure the use of leading spaces is respected accross all translation files. If a value starts with a blank space, if an option has no leading space, ... it should be the same for all translations.
  • For tags containing placeholders (%1 %2 %3 ...), ensure the number of placeholders is the same accross all translation files.

These are issues partners / translators might struggle with and could results in wrong behaviour of the app.

Kind of the same rules we had in mergetool.com, calculate technical check comment...

In fact, MS should ensure these rules are in place when publishing / building an app, but I guess the Idea would dissappear in their backlog ...

@rvanbekkum rvanbekkum added the enhancement New feature or request label Jul 12, 2019
@rvanbekkum
Copy link
Owner

Great idea! I will look into this.

@rvanbekkum rvanbekkum added in-progress One of the contributors is working on this. and removed in-progress One of the contributors is working on this. labels Jul 14, 2019
@rvanbekkum
Copy link
Owner

rvanbekkum commented Jul 14, 2019

I have added the initial implementation for this in feature branch feature/10-technical-checks.

This introduces a command XLIFF: Check for Need Work Translations, which will compare the source and translation text for each .xlf target file and run the checks you suggested above.
For each unit in which a problem is detected, the target-node is tagged with state=needs-adaptation and a note will be added to notify the translator about the detected problem.
For example:

<trans-unit id="Table 2739814070 - Field 3834966961 - Property 62802879" size-unit="char" translate="yes" xml:space="preserve">
  <source>A,B,C</source>
  <target state="needs-adaptation">A,B,C,D</target>
  <note from="XLIFF Sync" annotates="general" priority="1">Problem detected: The number of option members in the source and translation text do not match.</note>
  <note from="Developer" annotates="general" priority="2"/>
  <note from="Xliff Generator" annotates="general" priority="3">Table MyDummyTable - Field MyOption - Property OptionCaption</note>
</trans-unit>

Running the command again after resolving the problem will also remove the note that was added automatically.
You can also have the extension automatically perform these checks directly after you synchronize by enabling the new setting xliffSync.autoCheckNeedWorkTranslations.
See the README.md for more information.

@fvet Could you please check and let me know what you think about this?
After that I will merge it into the master branch and make a new release.

@rvanbekkum rvanbekkum added the input-needed Extra attention is needed label Jul 14, 2019
@fvet
Copy link
Author

fvet commented Jul 14, 2019

@rvanbekkum , this is what I had in mind, would be glad to test the new feature and provide feedback!

@rvanbekkum rvanbekkum added shipped Issue is available in the public release. and removed input-needed Extra attention is needed labels Jul 15, 2019
@rvanbekkum
Copy link
Owner

I have created a new 0.1.6 release.
If you have feedback, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shipped Issue is available in the public release.
Projects
None yet
Development

No branches or pull requests

2 participants