Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kardo Kallis
    @kkallis_gitlab

    Hello, I'm setting up smartcat_serge_bootstrap and I have a problem with parse_json and the output of the .po files for Smartcat.

    en.json file structure

    [
        {
            "term": "app.logout",
            "definition": "Log Out",
            "context": "Logout text, displayed on button or in a tooltip",
            "term_plural": "",
            "reference": "",
            "comment": ""
        },
        {
            "term": "app.login.dismiss",
            "definition": "Dismiss",
            "context": "Text on a button to dismiss error message. \"Oh, well...\"",
            "term_plural": "",
            "reference": "",
            "comment": ""
        },

    en-US/en.json.po file

    msgid ""
    msgstr ""
    "Content-Type: text/plain; charset=UTF-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Language: en_US\n"
    "Generated-By: Serge 1.4\n
    
    . [0]/context
    : File: en.json
    : ID: cd58f1b123bd677d3de77935fa6cf04e
    msgid "Logout text, displayed on button or in a tooltip"
    msgstr ""
    
    . [0]/definition
    : File: en.json
    : ID: c2412a7a82f557d9cce54381bca114cc
    msgid "Log Out"
    msgstr ""
    
    . [0]/term
    : File: en.json
    : ID: 03c29e74c13151068f484bbe2dad9e24
    msgid "app.logout"
    msgstr ""
    
    . [1]/context
    : File: en.json
    : ID: e678f89e8b02311b0041cfa1f36e4387
    msgid "Text on a button to dismiss error message. \"Oh, well...\""
    msgstr ""
    
    . [1]/definition
    : File: en.json
    : ID: e4092ae6de95a1a2ef4bff834c8f649d
    msgid "Dismiss"
    msgstr ""
    
    . [1]/term
    : File: en.json
    : ID: d91df5e730f741ee789371d9063a36db
    msgid "app.login.dismiss"
    msgstr ""

    But in older setup we have the en.json.po file looks like this:
    en.json.po

    Igor Afanasyev
    @iafan
    @kkallis_gitlab for the format that you described you will need a custom parser. I recommend looking at parse_chrome_json plugin (https://serge.io/docs/plugins/parser/parse_chrome_json/) if you want to create your own, since it's closer to the format you have.
    Kristina Popova
    @kr111kr
    image.png
    Hello!
    Is it possible to make line translations unloaded from the Smartcat only if they are in a certain status, for example "Done"? I can't found any parameters for this using Serge with Smartcat. The standard behavior unloads any changed value, even if that appears without changing the status. But this behavior doesn't suit us because our translators write translations into the system, then they themselves double-check each other, make corrections and only then change the status. I would like to unload the value after all changings (i.e. after changing this status)
    Taras Semenenko
    @ta2-1
    Hi Kristina, there is a pull_params section in the serge config file, you can set “mode=complete” there.
    Brian Caruso
    @carusology

    Hi there! :wave:

    I recently got some pushback from our translators about the optional "approved" annotation for <trans-unit> elements of XLIFF interchange files. It looks like it is incorrectly being set to "yes" when a translation is still needed due to fuzzy being set to undef in that state. This attribute value doesn't make sense. There's no translation that would be needing final approval because one doesn't exist yet. It seems the "approved" annotation should be absent when a translation is also absent.

    I filed this bug on the issue: evernote/serge#136

    If I submit a MR that avoids setting any "approved" annotation when a translation does not exist, would you accept it?

    Igor Afanasyev
    @iafan
    @carusology hi! I responded in the ticket. Thanks for the detailed exaplanation. Feel free to provide a PR. Please make sure to run engine.t --init in the t/ folder to re-generate test data, then git diff to see if there are not changes that shouldn't be there (and the changes that are there make sense are are a direct result of your code changes), then submit changes to test data as a part of the PR.
    Brian Caruso
    @carusology

    Hi Igor, thanks for the prompt response. :bow:

    I'll get feedback from our translators (Powerling) on "approved=no" vs approved omitted entirely (it should be logically the same) and follow up with a MR once I hear back.

    Kristina Popova
    @kr111kr
    Hi Taras! Thanks for the quick response!
    Setting the pull_params --mode = complete option really helped. It would be great if you could add this information to the documentation. Now it can only be found in smartcat https://smartcat.com/api/methods/#!/DocumentExport/DocumentExport_RequestExport. And what is needed there "--" only in the smartcat-cli source
    Brian Caruso
    @carusology
    @iafan alright, MR up and ready for review: evernote/serge#137. Thanks!
    Brian Caruso
    @carusology
    Hey @iafan :wave: - do you happen to know when would have some time to review this MR? --^ We can certainly use a fork if you're overloaded, but I figured I'd ask.
    Igor Afanasyev
    @iafan
    @carusology just merged your PR. thanks!
    Brian Caruso
    @carusology
    Thanks! 🙇‍♂️
    Andrzej Jordanow
    @ajordanow
    Hi @iafan - I think I've found a bug in run_command plugin (probably elsewhere :). I have many files that match source_match but the run_command always get input parameters for the first matching file (e.g. command /bin/echo %OUTFILE% %LANGNAME% %FILE% returns FILE value that is the first matching file). Could you confirm this? Is there any quick fix around this? Or maybe you could point me at the source code where I should look to investigate this issue further?
    Igor Afanasyev
    @iafan
    @ajordanow can you share (privately) some minimal Serge configuration file with this plugin enabled, and a bunch of resource files that you process with it? That would make it easier to reproduce the issue on my side and identify the problem
    1 reply
    Vera
    @VeraVes
    @iafan Hi! Could you please help me? How can I use parse_json_keyvalue plugin, but turn off space_after option?
    Igor Afanasyev
    @iafan

    @VeraVes this particular plugin doesn't have any configuration options, but do you mean that instead of

    "key1": "string",

    you would prefer to have no space after the colon, like below?

    "key1":"string",

    If that's the case, you can post-process the resulting localization file by adding a replace_strings callback plugin tied to before_save_localized_file phase, exactly as shown in the documentation: https://serge.io/docs/plugins/callback/replace_strings/#sel:I2NvZGVfMC9zcGFuLjI1L0AtI2NvZGVfMC9zcGFuLjkxMy9AOjE

    There you can define your own replace regular expression that would postprocess the content on the fly, removing this space symbol.

    Vera
    @VeraVes
    @iafan Thank you, got it!
    Waqar Ali
    @aliw77
    serge is not matching all files in the folder for some reason (picking up 32 files, but there are 35)
    CleanShot 2021-10-11 at 21.05.09.png
    CleanShot 2021-10-11 at 21.07.23.png
    regexp match is confirmed, file exists, but for some reason i get:
    Scanning directory structure...
    Scanned in 0.036914 sec, 32 files match the criteria
    other folders/files are new, and are locally visible in the server where serge is running
    Mahmoud Almasri
    @Mhm0ud

    Hi,
    I'm trying to use srege with smartcat, and I have an issue:
    I need to use vcs to pull content from gitub repo, but I need to pull specefic directory only not the all project, is there anyway to do that?
    this is my serge config file:

    vcs
        {
            plugin                                  git
    
            data
            {
                add_unversioned                     YES
    
                clone_params                        --depth 1
                email                               l10n@mycompany.com
                name                                L10N Robot
    
                local_path                          data
    
                # Set this parameter to be your Git clone URL. If your repository
                # main branch is not called 'master', you need to specify it 
                # explicitly at the end of the URL, like this: #main
                remote_path                         git@github.com:Mhm0ud/smartcut-project-a.git#main
            }
        }

    the folder that I need to use it in serge is under main branch /test/test1/

    nandish kumar n
    @nandishnagaraj_twitter
    image.png
    Hi Community, I am new to Serge and was trying to do the setup, can someone help me with POC setup mentioned here https://github.com/smartcatai/smartcat-serge-bootstrap
    nandish kumar n
    @nandishnagaraj_twitter
    image.png
    unable to connect to smart cat
    Mark Giesen
    @Mark-Giesen
    The last stable release is from almost 3 years ago, is there one planned? Or is the master stable enough and is everyone on the latest version?
    Mark Giesen
    @Mark-Giesen
    And should I use the installation method on https://serge.io/download/?win/stable, or use the docker method like stated in the README.md on GitHub?
    Mark Giesen
    @Mark-Giesen

    Using this config:

    sync
    {
        vcs
        {
            plugin                      git
    
            data
            {
                local_path              vcs
                remote_path             ssh://git@github.com:Felienne/hedy#main
                add_unversioned         YES
                commit_message          Automatic commit of updated localization files
                name                    XX
                email                   XX@X.Y
            }
        }
    }

    and running this command:

    docker run -v <localfolder>\data:/data serge pull --initialize /data/configs/hedy.serge

    I still get this:

    ### /data/hedy.serge
    
    Updating project from VCS...
    
    ***************************************************************
    WARNING: expected remote repository URL does not match the reported one.
    Directory    : /data/vcs/
    Reported URL :
    Expected URL : ssh://git@github.com:Felienne/hedy
    ***************************************************************
    
    Deleting directory '/data/vcs/'
    Creating directory '/data/vcs/'
    Exception occurred while processing configuration file: 
    Exit code: -1; last error: No such file or directory

    I'm using the latest version and created the docker as instructed in the readme. That seams to work, it's reading my config, but what am I missing?

    Neil Foster
    @ntfoster_gitlab
    @Mark-Giesen Is your hedy.serge file in a /configs folder - e.g. you have /data/vcs and /data/configs? I think your local_path should be ../vcs in that case because the paths are relative to the config file.
    Mark Giesen
    @Mark-Giesen
    No, the hedy.serge is in a data folder and the vcs folder is to (created on the first try by Serge).
    I tried it, but ../vcs doesn't work, see below. Relative paths with .. don't seem to work:
    ***************************************************************
    WARNING: expected remote repository URL does not match the reported one.
    Directory    : /data/configs/../vcs/
    Reported URL :
    Expected URL : ssh://git@github.com:Felienne/hedy
    ***************************************************************
    
    Deleting directory '/data/configs/../vcs/'
    Creating directory '/data/configs/../vcs/'
    Neil Foster
    @ntfoster_gitlab
    @Mark-Giesen ok, I did some poking around. It looks like the Dockerfile you get from serge doesn't actually include git (unless I'm an idiot?). If you open /docker/Dockerfile and on the line 'ARG INSTALL_PREREQUISITES' add git somewhere after 'install'. E.g. : ARG INSTALL_PREREQUISITES="apt-get -qq -y update && apt-get -qq -y install git make [etc] then rebuild the docker container.
    you will also have to change the remote_path to https://github.com/Felienne/hedy.git#main
    I think that might have been the issue when I switched to using this instead to get going: https://github.com/smartcatai/smartcat-serge-bootstrap
    Mark Giesen
    @Mark-Giesen
    adding #main and changing from ssh to http have been tried without succes. That would be logical if git wasn't installed. That would be very weird though. It would mean I'm the first to ever try this docker image? but you gave me two options to think about. Adding git to the image and trying to use serge without the docker. Which one was best, wat an earlier question from me, that wasn't answered yet.
    Mark Giesen
    @Mark-Giesen
    Wooow, amazing: it worked! Does this indeed mean I'm the first to ever use the docker version or am I missing something? The pull was succesfull, first step taken! Thanks @ntfoster_gitlab
    Neil Foster
    @ntfoster_gitlab
    I thought it was a bit strange. Perhaps something changed in the debian image this Dockerfile is based on, and it no longer includes git by default? My project is using smartcat for the translation service, which it looks like requires a bunch of compiling which is a bit harder to set up in the docker container, so it ended up being easier to use the smartcat-serge-bootstrap I linked. If you don't need that, the standard docker method keeps things a bit more contained which I prefer to installing everything locally.
    Mark Giesen
    @Mark-Giesen
    I would need the Rise edition of SmartCat I assume to have this automated process, right? Otherwise I could have a look at that besides Zing and Weblate.
    Neil Foster
    @ntfoster_gitlab
    Seems to work just fine with the free one, though I think you're limited to using .po files with the serge plugin. I'm just testing out some automations for another project that already uses Smartcat so I'm not familiar with the others and how they compare.
    Neil Foster
    @ntfoster_gitlab
    Time for my own question: is it normal for serge to download and upload every .po file from and to Smartcat on every sync cycle, even if there have been no changes? E.g. If I do two syncs back-to-back, it goes through them all each time. Which takes a while since there are ~500 files in this project (thanks to the way it's structured). Not a huge problem when this gets automated, but annoying while testing and feels inefficient.
    Tae Kim
    @kimchi314_twitter
    hello, new here. I'm using parse_json_keyvalue plugin and it appears to escape forward slash which is breaking some strings we are localizing that includes html eg <b>Hello</b>. Are we not supposed to have HTML in strings for translation?
    John Simon
    @JohnCSimon

    Hi all I'm using the plugin parse_pot plugin and I see that when serge converts .xliff to .po, longer lines are broken up into multiple lines

    #: src/components/security-control/minPermissions.jsx:51
    msgid "Learn More"
    msgstr ""
    "Blah blah"
    "Blah blah"

    https://github.com/evernote/serge/blob/master/CHANGES#L26

        - Word wrapping functionality improved for .PO files;
          lines will never go beyond the defined maximum length.

    is there any way to change this default behavior?

    Igor Afanasyev
    @iafan
    @JohnCSimon why would you want to change this behavior? Every PO editor is expected to glue these lines together before presenting them to the user for editing. And any system that works with localized PO files should be able to deal with such lines just fine (I haven't heard of any that doesn't support it).
    John Simon
    @JohnCSimon
    sorry I should include the justification:
    When the .po files are created by LingUIJS msgstr appears as a single string by default. The .po files are converted to xliff, localized and when they are converted to .po again, there are line breaks. Part of the QA process is to git diff the old .po files with the new ones. Except, when the line breaks are introduced, every line over the character limit is changed and this makes their process.
    Looking at it again, when I run lingui extract --clean this rebuilds the .po files and returns it to the original single line format, and QA can continue as usual. It's not that much of an issue with this workaround.
    Ilya Velesevich
    @winperec

    Hi
    I'm trying to run serge in container and having issue during db creation

    Initializing the database...
    Exception occurred while processing job 'job.master': Can't execute statement [
    CREATE TABLE usn (
      usn INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
      dummy BOOLEAN NOT NULL
    )]: Permission denied
    
    DBD::SQLite::db do failed: database is locked at /serge/bin/../lib/Serge/DB.pm line 162.

    Has anyone faced with that ? I'm running in ACI with mounted Azure Files SMB share

    Igor Afanasyev
    @iafan
    @winperec check if you have a journal file next to translate.db3 file, and remove it, then try again.
    Ilya Velesevich
    @winperec
    @iafan thank you for the answer but I think it is limitation of Azure Container Instances with mounted Azure Files storage. Azure does not allow specify/override default mounting options. Internet full of similar stories (see https://stackoverflow.com/questions/53226642/sqlite3-database-is-locked-in-azure )
    The workaround was just copy translation db to Azure Container Instance storage temp file system and copy it back to persistence share after sync...
    lucacerretani
    @lucacerretani
    hi. I have an angular project that i want to translate with Serge + Zing. I follow the documentation and set up everything. The problem is that I also want to extract the xlif file during the sync process, but the only hook I found to run a custom command is "after_save_localized_files" that fires as many times as the configured locales and not always. Does someone have a suggestion?