Jump to content
Stano

Better Translator Manager - Custom component

Recommended Posts

I don't know it yet. I just tried something.
My point is whether the custom component can be translated. I have no idea. It shows me units (red) that I don't care about. 
From the program there are blue units. The others are system ones and I don't want to have/see them there.

939184899_Snmkaobrazovky2023-08-14090722.png.c24852a2cf4805ca2c75480b7e0c372a.png

I need what is in the Localization directory.

300795323_Snmkaobrazovky2023-08-14171216.png.a8fb19a1af8818a498ccb67c255aeba2.png

Thank you

Note: I would appreciate if the individual nodes/units could be hidden. Just the ones that are not to be translated. It would greatly increase readability and work.

Share this post


Link to post

I'm not really sure if this is what you're asking for but you can indicate which modules to translate and which to ignore by right-clicking and changing their status:

image.png.c9e57d849793c184c31e87b25c2633da.png

and then you can filter on the status:

image.png.73831cdff156403b1262c23e2682c463.png

 

You can do the exact same in the string grid:

image.thumb.png.2597e0c1e42a0806628f90dd5fecba40.png

image.thumb.png.f7ee5f3f1e569e084d080fe4bec7d358.png

Share this post


Link to post

You can already see by the picture that I have no problem with it. 

I would love to hide them!!!
This is the main question:

15 hours ago, Stano said:

My point is whether the custom component can be translated.

 

Share this post


Link to post

I'm still not sure what you're saying - or asking.

 

You hide rows by filtering them out: Hover over the Status column header, click the button that appears in the header. Select the statuses that should be visible. Like in my screenshots.

 

17 hours ago, Stano said:

My point is whether the custom component can be translated.

That's not really a question, but anyway: If your component strings appear in the string grid, then they can be translated; All resourcestrings and published component string (and string list) properties can be translated.

Share this post


Link to post
1 hour ago, Anders Melander said:

That's not really a question, but anyway: If your component strings appear in the string grid, then they can be translated; All resourcestrings and published component string (and string list) properties can be translated.

The problem is that I don't see the unit with resourcestrings in the component in the list.
I'll try that anyway. I'll play with it.

Share this post


Link to post
1 hour ago, Stano said:

The problem is that I don't see the unit with resourcestrings in the component in the list.

All resourcestrings, regardless of the unit they come from, are listed under the Resourcestrings module node.

Share this post


Link to post

I have: amTranslationManagerInstall-2.0.8370.39904 - year 2019 
So I went through it. I have understood/figured out where and how to get to the filters. How the filters and Find work.
I searched for pumAutoIns from:

 

LocNavigator unit;

resourcestring
  pumAutoIns = 'Automatically insert the next record';

 

Unfortunately, it's not there :classic_unsure:

Share this post


Link to post
1 minute ago, Stano said:

I have: amTranslationManagerInstall-2.0.8370.39904 - year 2019 
So I went through it. I have understood/figured out where and how to get to the filters. How the filters and Find work.
I searched for pumAutoIns from:

 

LocNavigator unit;

resourcestring
  pumAutoIns = 'Automatically insert the next record';

 

Unfortunately, it's not there :classic_unsure:

Resource strings are prefixed with the unit name they are in; so it should be named LocNavigator_pumAutoIns

It must be there. Never met any resource string left out by BTM.

Share this post


Link to post

No, it's not there. The point is that it's a custom navigator drop on the form.
Maybe something needs to be done in component.

I'd love to get my hands on a newer version. The internet hasn't helped me. 

Edited by Stano

Share this post


Link to post
40 minutes ago, Stano said:

I have: amTranslationManagerInstall-2.0.8370.39904 - year 2019 

That's the newest release; It's from December 2022. I don't know where you you got the year 2019 from.

 

25 minutes ago, Stano said:

No, it's not there. The point is that it's a custom navigator drop on the form.
Maybe something needs to be done in component.

Nothing special needs to be done.

 

If the resourcestring is implemented in unit XXX and you drop a component from XXX onto a form in unit YYY of project ZZZ, then the IDE will include unit XXX in unit YYY's uses clause and when you compile ZZZ, the resourcestring will appear in the ZZZ.drc file (it's a text file) located the sample place as ZZZ.exe.

If you don't have ZZZ.drc then you need to configure your project to produce that file (see the project linker options) - but BTM should complain if it can't find the file.

Share this post


Link to post
34 minutes ago, Anders Melander said:

f the resourcestring is implemented in unit XXX and you drop a component from XXX onto a form in unit YYY

The component itself is in the jstEnNavigator unit. But the resourcestrings are in the LocNavigator unit.
I have moved the resourcestrings to the jstEnNavigator unit.
No change.

Share this post


Link to post

Can you see the resourcestring in the .drc file?

 

[edit] Btw, have you remembered to update the translation project after these changes?

image.png.e80886c2a405f0d926238b20868af6d9.png

If you don't update the translation project it will only contain the strings that were in your project when you created the translation project.

Edited by Anders Melander

Share this post


Link to post
44 minutes ago, Anders Melander said:

Can you see the resourcestring in the .drc file?

No.

44 minutes ago, Anders Melander said:

Btw, have you remembered to update the translation project after these changes?

I did. After the update, one item was added to the project. I have no idea which one.

Files Pokusy.drc, Pokusy.exe and Pokusy.xlat are together in one directory.

The other files, dpr..., are elsewhere. 

Share this post


Link to post

The project consists of a single form and a DataModule.
The content of the form can be seen in the image.

image.png.d58be1cea2e41ea6a799f38a221cda48.png

Share this post


Link to post

I added a resourcestring to the form. Nowhere, drc and project BTM, no change.

unit UPokusActionBar;

interface

uses
  Winapi.Windows, Winapi.Messages,
  System.SysUtils, System.Variants, System.Classes, System.Actions, System.ImageList,
  Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ActnList, Vcl.ImgList, Vcl.ActnMan, Vcl.Buttons, Vcl.DBCtrls,
  Vcl.PlatformDefaultStyleActnCtrls, Vcl.StdStyleActnCtrls, Vcl.XPStyleActnCtrls, Vcl.StdCtrls, Vcl.ExtCtrls,
  Vcl.VirtualImageList,
  DBAccess,
  Data.DB,
  FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf,
  FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, FireDAC.Comp.DataSet, FireDAC.Comp.Client,
  VirtualTrees,
  jstEnNavigator, jstVirtualStringTree,
  dmBasic, MemDS, IBC;

resourcestring
  aa = 'bbb';

type
  TForm2 = class(TForm)
    vilLitN: TVirtualImageList;
    vilLitD: TVirtualImageList;
    vilLitH: TVirtualImageList;
    vilLrgN: TVirtualImageList;
    vilLrgD: TVirtualImageList;
    vilLrgH: TVirtualImageList;
    ds1: TDataSource;
    ibds1: TIBCDataSource;
    ibtbl1: TIBCTable;
    fdtb1: TFDTable;
    jstvst1: TjstVirtualStringTree;
    jstnv1: TjstEnNavigator;
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

end.

 

Share this post


Link to post
15 minutes ago, Stano said:

resourcestring aa = 'bbb';

If you are not actually using that string anywhere then it's probably being eliminated by the linker.

Resourcestrings are only ever loaded from STRINGTABLE resources and the STRINGTABLE resources (and the .drc file) are produced by the linker based on the units linked into the application.

 

If you add a ShowMessage(aa) to the above example then I bet the resourcestring will appear.

 

Regardless, I think we can conclude that this isn't a BTM problem.

Share this post


Link to post

I never claimed that this is a BTM problem. I was looking for guidance and failed.
I already have it in the project. 
Only now have I found out that I was searching wrong. I already have it :classic_cheerleader: I was looking for the title but I should have been looking for the content :classic_blush:

Share this post


Link to post

How can I hide these items? I have 184 items displayed. I am interested in about 75 items.

image.thumb.png.93eb5919082bacfe6325f47bc1dc67b4.png

Share this post


Link to post

That's "obsolete" items. Items that existed in a prior version of your application but which have been deleted since they were first imported. That usually happens when you delete components or units.

 

You can't really hide them (that's a missing feature) but you can delete them:

image.png.8783accaa3a58fc8802da7fab48c6cab.png

Or you can just mark them "Don't translate" and hide them that way.

 

The reason they aren't just deleted automatically is that their translations (if they have any) can be reused by other items. For example, if you rename a component, then the translation-to-component link is broken but by comparing the source texts, BTM can move the link to the new component so the translation isn't lost. The Recover action does this.
The translations of obsolete items are also still used as translation suggestions.

Share this post


Link to post

Thank you. They cannot be described as "Do not translate".

image.png.781da9365de8a7ac96cf6a8bbcccbac7.png

 

image.png.4d39c2490fb2f02f052ad97b2340af1b.png

Edited by Stano

Share this post


Link to post
29 minutes ago, Stano said:

Thank you. They cannot be described as "Do not translate".

No, you're right; They cannot.

 

30 minutes ago, Stano said:

 

image.png.4d39c2490fb2f02f052ad97b2340af1b.png

 

Assuming this means that you cannot purge them, can you zip the translation project (just the xlat file) and post it as a DM to me.

Share this post


Link to post

I'd like to have some guidance so I don't post so much here. The link to your page will show it clean. 
I will send the project.

Share this post


Link to post

Fixed. The purge was rejected unless the project contained obsolete items with translations.

 

Get the new release (2.0.8628.30767) here:

 

Changes since the last release (2.0.8370.39904):

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×