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

"NAB: REVIEW" tag is always added to target when source is empty when "Refresh XLF files" #469

Open
RadoArvay opened this issue Oct 1, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@RadoArvay
Copy link

Describe the bug
[NAB: REVIEW] tag is always added to target element, when source is "empty" (contains spaces) when "Refresh XLF files from g" is run. It ignores any state of target. I think it is not very suitable behavior.
Before run of Refresh:

          <source> </source>
          <target state="final"> </target>

After run of Refresh:

          <source> </source>
          <target state="final">[NAB: REVIEW] </target>

Versions used
NAB AL Tools: v1.33.409221951 (pre-release)

@RadoArvay RadoArvay added the bug Something isn't working label Oct 1, 2024
@jwikman
Copy link
Owner

jwikman commented Oct 10, 2024

Hi, sorry for the late reply - I obviously missed this one.

I believe that this is a feature, not a bug. 🙂

Don't you also get the note from our tool?
<note from="NAB AL Tool Refresh Xlf" annotates="general" priority="3">Source contains only white-space, consider using 'Locked = true' to avoid translation of unnecessary texts. This note can be toggled with the setting 'NAB.PreferLockedTranslations'.</note>

As mentioned, you can toggle this feature off if you prefer, but I suggest that you use Locked = true when having an empty text.

But your concern might have to do with the state property? It is only considered by the tool if the NAB.UseExternalTranslationTool (naming isn't optimal, as an external translation tool is not mandatory for this...) setting is activated. If that is activated, the state is modified instead of using [NAB: ] tags in the target.

@RadoArvay
Copy link
Author

RadoArvay commented Oct 10, 2024

Yes, we do, we get that note. But there are situations like:

  • we do not want to lock the empty caption because someone may decide to use a different translation than the empty text (there is even example in the standard: sales document line type has an empty option, but there is special translation in EN xliff as "Comment")
  • we translate not our own app (for example standard one) and there is no way to lock the caption

Now, we need to check tags like [NAB: REVIEW] everytime we do a sync from G-file. It already happened once we published the app with translation containing [NAB: REVIEW] text.

I have not done tests yet - so, right now, the solution is to use UseExternalTranslationTool option? It changes state instead of adding the tag? Do I understand it well? Or is there another way to avoid that?

@jwikman
Copy link
Owner

jwikman commented Oct 10, 2024

Ok, now I see. And you actually helped me to find a bug, but not really the one described. (at least my interpretation of it 🙂)

If configuring "NAB.UseExternalTranslationTool": true and "NAB.PreferLockedTranslations": true (the default value), the [NAB: REVIEW] tag is added - no matter what state value there is. This is a bug, and should be fixed.
So, using NAB.UseExternalTranslationTool won't help you here (yet).

The solution to your issue is to set "NAB.PreferLockedTranslations": false to switch of this feature where empty source is not allowed.

Using [NAB: ] tags or the state attribute is a matter of taste and routines.

@RadoArvay
Copy link
Author

Using [NAB: ] tags or the state attribute is a matter of taste and routines.

maybe yes, maybe no ;-)

As a wrote in the 2nd point...a flow is like: we translate something; we are sure of it; so the most logic way is to set the state (as many tools support it); we do not want to come back to that translation and review it; an app was updated; G-sync is done; new entries are added (with a state to translate).......it is easy to forget to review NAB tags.

Okay, I will try different configurations and "routines".

@jwikman
Copy link
Owner

jwikman commented Oct 10, 2024

Using [NAB: ] tags or the state attribute is a matter of taste and routines.

maybe yes, maybe no ;-)

What I meant, was that the tool supports (with the above-mentioned bug) either one way or the other. When working with [NAB:] tags, the tool does not care about the state attribute. And when working with the state attribute, the tool should not use [NAB:] tags. 🙂

Yes, please try out the PreferLockedTranslations setting first, it should take away some annoyance.
And then you can optionally test the UseExternalTranslationTool setting to see what fits your need the best.

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