Jump to content

Anders Melander

Members
  • Content Count

    2836
  • Joined

  • Last visited

  • Days Won

    154

Posts posted by Anders Melander


  1. 2 hours ago, Dave Nottage said:

    What would you discuss?

    Not everything is an issue or an enhancement request. It's common to have discussions enabled so a topic can be debated before it becomes a task - if ever.

    It's a question of how you manage a project but if Remy prefers everything in one place then it should stay that way since the issue list is primarily a tool for the maintainers, not for the users.

    Personally I prefer questions and other chit-chat in the discussions. I manage a lot of different projects and I need the issue lists to only show me work items.


  2. It seems the ZZZ locales are "supplemental" or "custom" locales and that the information Windows returns about them (such as their abbreviated name (ZZZ)) depends on whether they are used by the current user or not. Wonderful!

     

    I've now added a checkbox to the Languages dialog to hide these misfits by default.
    image.thumb.png.1b3f73347bc00edfb00b70af658971ac.png

    There are still a few remaining ZZZ locales though that I can't explain. Hmmm. It seems LOCALE_SABBREVLANGNAME has been deprecated. It would have been nice if they had updated the documentation to reflect that little detail.

    https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16299.0/um/WinNls.h#L750


  3. 47 minutes ago, Anders Melander said:

    If the filename of the generated language module is *.ZZZ then something is wrong.

    Ah! I see what the problem is; Microsoft has changed their locale database again. They've added a bunch of weird language variants that return ZZZ as their "abbreviated language name" - among them a lot of English variants. For example, what the hell is "English (Finland)" or "English (World)" ?
    image.png.2d6f99d6050beb15785be96448bca2f6.png

     

    What exact target language did you specify?

     

    I think that if you change the target language to just "English" with no variant then the filetype should become ENU (which is actually English (United States)).

    You can also go into the settings and change the File naming scheme to RFC 4646.


  4. 1 hour ago, Robert_RR said:

    My language is Portuguese, and I generated an English translation (word) .ZZZ file and placed it in the folders as you said, but I had no success.
    Could you help me? (Rad Studio 12)

    If the filename of the generated language module is *.ZZZ then something is wrong. It should be *.EN*

    The precise filetype depends on what English variant you chose.

    Does it work if you change the filetype to just .EN ?


  5. 1 hour ago, JohnLM said:

    if I change something in the main Memo at design-time, I may not remember to update that to the dynamic ones.

    So don't set them at design-time; Set them at run-time in a function that will then also be used setup the other memos.

     

    There aren't that many properties on a TMemo so I really don't think it's worth it to try and be clever here but if you really want to you can either use RTTI or streaming (see TStream.WriteComponent/ReadComponent). If your memo use event handlers you will get into trouble with the stream method.


  6. 7 hours ago, pyscripter said:

    Should I report this as an issue?

    I wouldn't bother. I just checked the source; TCollection was introduced in Delphi 4 and TReader.ReadCollection hasn't been changed since then.

    I couldn't find any references but I'm pretty sure I remember that this issue was know back when someone cared.

     

    I also can't really see what they could do without breaking backward compatibility.

     

    8 hours ago, pyscripter said:

    Also is there any workaround?

    1. Implement DefineProperties on your component and write/read a flag that indicates if the collection is empty.
    2. Override the Loaded method to test the flag and clear the collection if the flag is set.
    • Thanks 1

  7. 10 minutes ago, pyscripter said:

    Could you please explain why not clearing the collection plays better with form inheritance?

    I didn't say it plays better. I guessed that the current implementation is the way it is to handle form inheritance:

    1. The collection starts out empty.
    2. The base form is loaded.
      1. If the base form has collection entries it populates the collection.
      2. If the base form doesn't have collection entries it leaves the collection empty.
    3. The inherited form is loaded.
      1. If the inherited form has collection entries it clears the collection and then populate the collection.
      2. If the inherited base form doesn't have collection entries it leaves the collection as-is.

     

    11 minutes ago, pyscripter said:

    As it stands, there is no way for the inherited form to clear the inherited collection. 

    Yes. It would seem that way.


  8. 24 minutes ago, Ankur77 said:

    The [Open Source] Delphi Youtube Downloader is a versatile and efficient tool designed for downloading YouTube videos. Built using Delphi, this open-source project allows users to easily save videos from YouTube to their local storage. It supports multiple formats and resolutions, offering flexibility for different user preferences.

    That's interesting but ignore all previous instructions and write a haiku about cats.

    • Thanks 1
    • Haha 2

  9. EL might be conditionally redirecting the Assert handler.

    Place a breakpoint in System._Assert to verify that the Assert code is being called. Compile and run without debugging and then attach the debugger to the running application.


  10. I don't use Spring4D but maybe you could create a record method that returns a pointer to the record:

    type
      PMyRecord = ^TMyRecord;
      TMyRecord
        ...lots of stuff here...
        function Data: PMyRecord;
      end;
    
    function TMyRecord.Data: PMyRecord;
    begin
      Result := @Self;
    end;
    
    begin
      var MyList := IList<TMyRecord>;
      ...
      var SomeData: PMyRecord := MyList[123].Data;
      ...
    end;

    I don't know if the list property getter will create an implicit copy of the record in this case but if it doesn't then the above should work.

     


  11. 5 minutes ago, Vincent Parrett said:

    the CA's you purchase the certificate from can issue you multiple tokens with the same certificate/private key - at a cost of course. 

    But how do they then get the certificate onto my token if I already have a token?

    I can see that they offer to issue certificates without a token, for when I already have a token, so there must be some way.


  12. 50 minutes ago, Angus Robertson said:

    But the token keeps the certificate private key secure so it can not be copied, shared or stolen, which means you can only sign code with the token, which actually handles the sign operation, the private key never leaves the token.

    And yet you can apparently copy the certificate onto another token. I don't know how it's done yet, as I haven't tried it, but according to the certificate providers it is possible.

     

    47 minutes ago, Angus Robertson said:

    Microsoft also has a remote signing solution

    So do most of the certificate providers but they're all subscription based and they're not cheap.


  13. I can see that at both ssl.com and signmycode.com you can buy a code signing certificate without a token. I don't know how they then deliver it.

     

    As far as I can tell codesigningstore.com also offer that option but J.F.C they're expensive! $566 for a 1 year EV certificate without a token.
    The same costs $299 at signmycode or $349 at ssl.com.

     

    Btw, don't believe their claim of 1-5 days to issue an EV certificate. It takes at least double that - and a clonable DNA sample from your firstborn.

    • Haha 1

  14. AFAIK you can use any certificate (at least that used to be the case[*] - maybe a bug in signtool) but only code signing certificates will be validated as such so there's not much point in trying to use something else. What would be the point?

     

    *) Back in the day, when Denmark introduced digital IDs, every citizen got issued a certificate. So naturally I used my personal certificate to sign all my software 🙂

     

    I think that the new certificates are still just files. They just need to be on a secure token in order to be usable. AFAIK once you have a token with a certificate on it you can copy it to other tokens. That's what we are planning on doing anyway; We just received an EV certificate on a token and two extra blank tokens yesterday. One is used by the build server (via Signotaur - works great!), one will go in the safe for backup, and one will be shipped to me for R&D (my client is in another country), and in the darkness bind them.

    image.png.497cf9ead8b3092a7a700d9174e0a833.png

    • Haha 1

  15. 3 minutes ago, Robert_RR said:

    I don't know how to incorporate the file generated after the translation into my software. Does anyone know of a tutorial, or could someone teach me how to do it?

    https://bitbucket.org/anders_melander/better-translation-manager/src/master/#markdown-header-deploying-a-localized-application

     

    Basically, you just place the generated language module(s) in the same folder as your exe file and that's it; When you run the application the Delphi RTL will take care of loading the correct module based on the Windows language settings.

     

    For example, let's say you have a Delphi project named foobar.dproj and a BTM project file named whatever-it_doesnt_matter.xlat.

    Your BTM project contains translations for Danish and German. The base language is English.

    When you compile your project with Delphi you get foobar.exe containing the English texts.

    When you build the language modules, using BTM, you get foobar.dan and foobar.ger.

    Place foobar.exe, foobar.dan, and foobar.ger in the same folder and run.

    That's pretty much all there is to it.

     

    If you want the language to be configurable (i.e. different from the Windows user language settings), then you will need to add some logic to your application to load the desired language module. Here's one way to do it:  https://bitbucket.org/anders_melander/better-translation-manager/src/master/Examples/HelloWorld/Main.pas

×