by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Igor Afanasyev
    @iafan
    @ta2-1 you might still want to have a look at this one, as potentially it can affect sync with Smartcat ( @ilearnf I’d suggest filing a bug on GitHub in Smartcat plugin repo for it, so that it’s not missed )
    Denis F
    @ilearnf
    okay. I'll take a look on it a little bit. and after that if it wouldn't dissapear will fill an issue.
    Denis F
    @ilearnf

    Hi @iafan! Are there any options to extend logging targets? e.g. if I want to send logs to kibana. I guess I can override some log4perl code, but I'd like to know is there a better approach to do this.

    btw my goal is to set up notifications about job statuses. For example it can be useful for notifying the developer if their feature branch has some problems with its job.

    Igor Afanasyev
    @iafan
    @ilearnf Serge doesn't do any structured logging; just spits out some (pretty verbose) progress into STDOUT, and fatal errors into STDERR. Note that some parsers can send error reports by email, and this is configurable on a per-job basis. This is something we use to track issues with source files and report these to developers. But you still have to figure out how to associate problems with a specific branch and a particular developer behind this branch.
    Denis F
    @ilearnf

    thx Igor!

    I have another question and I think this one should be addressed to @ta2-1. Is there an option to assign created documents to the translator in Smartcat plugin? I can't see it in docs, but I have to ask :).

    Igor Afanasyev
    @iafan
    @ilearnf what is the use case for that? is this functionality missing from Smartcat UI itself?
    Denis F
    @ilearnf
    @iafan the case is that our vendor needs to be notificated when the new documents were created. Smartcat won't do it by itself since the vendor is not assigned for this documents. And I prefer it to be done automatically because manually it will take extra time.
    Igor Afanasyev
    @iafan
    @ilearnf I'll follow up in a private chat on that, if you don't mind
    Taras Semenenko
    @ta2-1
    Hi @ilearnf, do you have one vendor assigned to the whole project? If so, it’s better to create your project via API with vendor. Then it will be assigned for every new document automatically.
    Denis F
    @ilearnf
    @ta2-1, yes, we have one vendor per project. so I think this solution should fit well, thx. I'll test it and write back if there are any problems.
    Oscar Lista
    @olista94
    Hi @iafan, I have this problem
    Job 'my_project' will be skipped: Data validation failed for plugin 'Serge::Engine::Plugin::parse_php_xhtml': Node '/bar' is not defined in the schema at /usr/local/share/perl/5.30.0/Config/Neat/Schema.pm line 107.
    I don't know why. Could you help me? thank you
    Igor Afanasyev
    @iafan
    @olista94 feel free to send me your config privately so I can pinpoint the problem. Looks like there's some unexpected bar parameter in the config data for the parse_php_xhtml plugin.
    Oscar Lista
    @olista94
    Thank you very much @iafan for answering me, I fixed the previous bug. Now, in which area of my .serge file is where I configure string extraction to generate .po files?
    At the moment I don't want to translate those files, just generalize them
    Igor Afanasyev
    @iafan
    @olista94 I recommend using this bootstrap project and a Getting Started guide: https://github.com/smartcatai/smartcat-serge-bootstrap — it is a fully working project that parses .js files and generates .po.
    You don’t even need to configure anything there — just run serge localize
    Oscar Lista
    @olista94
    Hi @iafan, how can I extract strings within these parameters? {t}string{/ t}. I used the metaparser plugin, but I don't know how it works, because I tried to extract the string with the data localize but I was not able
    Igor Afanasyev
    @iafan
    @olista94 can you share a file (maybe a small one) that you're trying to parse?
    Oscar Lista
    @olista94
    {block name='meta'}
    <title>{if !empty($category)} {$category->title|mb_capitalize|clearslash} - {/if}{setting name=site_title}</title>
    <meta name="keywords" content="{setting name=site_keywords}" />
    <meta name="description" content="{if !empty($category)}{$category->title|mb_capitalize|clearslash} {t domain=base}in{/t} {/if} {setting name=site_description}" />
    {/block}. Here's a small one. This is the string extraction part {t domain=base}in{/t}. It's a .tpl file (smarty template engine)
    Igor Afanasyev
    @iafan
    @olista94 so in this example, all you want to extract for translation is the word in?
    Igor Afanasyev
    @iafan

    @olista94 it also looks like that with these {t} templates name are coming from the Smarty gettext plugin (https://github.com/smarty-gettext/smarty-gettext), correct?

    If that's the case, then you don't need to translate tpl files directly; this plugin is what will generate .pot files for you, and you will need to localize those. Serge has a plugin for that: https://serge.io/docs/plugins/parser/parse_pot/

    Oscar Lista
    @olista94
    Yes, but I don't want to directly translate the tpl files. What I want, first of all, is to extract the strings enclosed between {t} and {/ t} and generate the po files with those strings for their subsequent translation. The parse_pot plugin wouldn't work, would it?
    What you are telling me is that with the plugin https://github.com/smarty-gettext/smarty-gettext I get the step of extracting the strings enclosed between {t} and {/ t} and generating the po files would be done directly using this plugin
    Igor Afanasyev
    @iafan
    @olista94 that's exactly what I'm saying! You need to use the smarty-gettext tool to extract strings into a .pot file, which you can later translate using Serge.
    Björn Sundström
    @BjornPSundstrom_twitter
    I need to rename the source file for a Serge/Zing project. Is there any way I can do that without Zing thinking it is a new file?
    Example:
    I have en.json as the source, generating a number of targets
    I want to rename en.json -> en_GB.json, so I do that and update the Serge config file (source_match parameter)
    Zing then adds en_GB.json to its project, leaving me with twice as many strings, half of which are "Needs work".
    Igor Afanasyev
    @iafan

    @BjornPSundstrom_twitter if you just rename the source file (but don't change it), Serge should understand that this is a rename operation, and will reuse all the past translations from its own database; after uploading already translated files to Zing you would see the same state of the project completion. If you rename the file and change something in it, it will be considered a new file, and here Serge will try to substitute translations on a case-by-case basis, marking the matched strings as 'needs work' unless you change the reuse_as_fuzzy_default config setting (see https://serge.io/docs/configuration-files/reference/#sel:I2NvZGVfMC9zcGFuLjEzOTkxL0AtI2NvZGVfMC9zcGFuLjE0MDE5L0A6Mw)

    Once you have your source file renamed (and generally after each serge sync, you also need to run serge clean-ts to clean up unused .po files; then, during the next serge sync cycle, these files will be removed from Zing as well, and you won't have duplicates.

    Having said that, why not keep the source file as generic as possible (i.e. en.json)? Having generic locales is usually better, since this is the logic of content negotiation algorithms. I.e. if I want to see your product in en_US locale, you should be able to offer me a generic en locale if one exists; on the other hand, showing me a en_GB locale goes against the best practices.
    Björn Sundström
    @BjornPSundstrom_twitter
    @iafan Thanks for the detailed answer. I did indeed fall into the 'needs work' trap; now I know how to resolve it. And I agree about the generic source. In this case, the source is English-as-written-by-people-who-do-not-really-know-English. A cleaned-up English is generated as one of the targets and later used as the fallback language in our product. As you suggest, we fall back to generic English if US and GB variants (or any other target language) are missing.
    Denis F
    @ilearnf

    Hi everyone! I have a problem with push-ts step. I have a smartcat project for each language (let's have en and tr for testing purposes). I execute push-ts separately for each language as well with --lang parameter. But when I'm trying to push-ts for en language Serge tries to send tr documents. I attach log and config, that could describe the situation.

    How can I tell Serge to skip ts-files for all languages except one that I provide in --lang argument?

    log

     Trying to execute command C:\Serge\serge-1.4\bin\serge.bat push-ts C:\SergeData\configs\test\test.en.serge --lang=en
    2020-08-20 19:25:33,083 INFO  [ConsoleRunner] ### C:\SergeData\configs\test\test.en.serge
    2020-08-20 19:25:33,088 INFO  [ConsoleRunner] Pushing translation files to external translation service...
    2020-08-20 19:25:33,088 INFO  [ConsoleRunner] Running 'smartcat-cli push log=C:\SergeData/logs/test/smartcat.log' ...
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner] Running 'push' command for project 'c43be966-d7fd-4b28-813c-89f0f238f28c' and translation files from 'C:/SergeData/projects/test/ts'...
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner] Getting project 'c43be966-d7fd-4b28-813c-89f0f238f28c'...
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner] Updating project 'c43be966-d7fd-4b28-813c-89f0f238f28c' with 'source:Serge' external tag...
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner] State:
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]   Upload [6]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]     'dogs (tr)', 'new (en)', 'new (tr)', 'dir---dir (tr)', 'pets (tr)', 'dir---dir (en)'
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]   Update [2]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]     'pets (en)', 'dogs (en)'
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]   Obsolete [0]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]   Skip [0]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner]
    2020-08-20 19:25:34,628 INFO  [ConsoleRunner] Uploading file 'C:/SergeData/projects/test/ts/tr/dogs.po'...
    2020-08-20 19:25:34,671 INFO  [ConsoleRunner] --------------------
    2020-08-20 19:25:34,671 INFO  [ConsoleRunner] Exception occurred while processing configuration file:
    2020-08-20 19:25:34,671 INFO  [ConsoleRunner] Exit code: -1; last error: No such file or directory
    2020-08-20 19:25:34,671 INFO  [ConsoleRunner] Sync complete. 0 jobs in 1 configuration file were processed
    2020-08-20 19:25:34,671 INFO  [ConsoleRunner] 1 config failed to be processed

    config
    I have ts_file_path C:\SergeData\projects\test\ts\%LANG%\%FILE%.po in job section

    ts
    {
        plugin                      Smartcat
        data
        {
            project_id             ...
            token_id               ...
            token                  ...
            push 
            {
                disassemble_algorithm_name       Serge.io PO
            }
            log_file                            C:\SergeData/logs/test/smartcat.log
        }
    }
    Igor Afanasyev
    @iafan

    @ilearnf if you want to have one project per language, then you need to generate .po files in language-specific root folders, for example, use ts/project_en/en/ for English files and ts/project_tr/tr/ for Turkish .po files, and have individual config files. e.g. yourproject_en.serge and yourproject_tr.serge with different sync > ts sections that point to these directories and have different Smartcat project IDs specified.

    On the other hand, why do you want to split projects per language? Is that a workaround for some other problem? Ideally, you should have a single project with multiple languages in it.

    Denis F
    @ilearnf
    @iafan, our translation vendor asks us to do it this way. The workaround is that they have different translators for each language and it is more comfortable if projects are different as well.
    I've already tried to set ts_file_path to C:\SergeData\projects\test\ts\en\%FILE%.poinstead of C:\SergeData\projects\test\ts\%LANG%\%FILE%.po but Serge tells me then that the ts_file_path should contain %LANG%.
    Igor Afanasyev
    @iafan
    You want to have something like C:\SergeData\projects\test\ts_%LANG%\%LANG%\%FILE%.po instead
    and then generated ts_%LANG% folders need to be mapped to individual Smartcat projects
    Denis F
    @ilearnf
    I got the solution, thanks a lot (as always :) )!
    Hari hara sudhan
    @hari_developer_twitter
    hi, i am new to serge. I am not able to understand serge localize. My config file
    jobs
    {
    {
    id job1
    source_language en
    destination_languages es fr
    source_dir ./sample/source
    parser
    {
    plugin parse_keyvalue
    }
    serializer
    {
    plugin serialize_po
    }
    normalize_strings YES
    use_keys_as_context YES
    leave_untranslated_blank YES
    db_source DBI:SQLite:dbname=:memory:
    db_namespace sample
    ts_file_path ./sample/output/%LANG%/%FILE%.po
    output_lang_files YES
    output_default_lang_file YES
    output_file_path ./sample/source/%FILE%.%LANG%
    }
    }
    My output .po file is

    msgid ""
    msgstr ""
    "Content-Type: text/plain; charset=UTF-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Language: fr\n"
    "Generated-By: Serge 1.4\n"

    . Key1

    : File: sample.txt

    : ID: 60890b60e2c119646e05e384ce519bde

    msgctxt "Key1"
    msgid "\"Hello\""
    msgstr ""

    I dont see any translation happens...kindly guide and help to resolve the issue
    Igor Afanasyev
    @iafan
    @hari_developer_twitter not sure what your requirements are, but it looks like the .po file was generated just fine. Now if you provide your translations in the .po file, and run serge localize again, you should see your output files created (e.g. ./sample/source/sample.txt.fr) with the translation.
    Hari hara sudhan
    @hari_developer_twitter
    @iafan Thank you very much...I understand the process..
    Hari hara sudhan
    @hari_developer_twitter

    @iafan I understand serge. Coming to zing installation, I followed all steps when i am trying to execute the below syntax, I am facing the issue

    (env) C:\Users\hari_>zing build_assets
    Building static files...
    CommandError: Cannot find `npm` executable. Please install it and retry.

    i installed node in virtual environment, but it saying like this. Please help me

    Igor Afanasyev
    @iafan
    @hari_developer_twitter Node is only needed for building Zing, and we never required it being inside some virtual environment (not sure what this even means for Node/npm). You should have npm command available when running it from the regular environment that you use to build Zing. I.e. if you run which npm and it resolves to a path to your npm executable, you should be good to go.
    Waqar Ali
    @aliw77
    Any guidance on parsing .srt files, they have timestamps and 1+ line text segments under them
    Igor Afanasyev
    @iafan
    @aliw77 look at https://github.com/loctools/title project that was built to deal with Subtitles (recombine them in full sentences for easier translation and generate localization files (.locjson) that Serge supports).
    Waqar Ali
    @aliw77
    @iafan - mind=blown! this is amazing
    Igor Afanasyev
    @iafan

    @aliw77 haha. then you might also want to look at its sister project — an online server to preview subtitles in context: https://github.com/loctools/title-server

    This is an early development, but if you're willing to experiment with it, you may end up having a decent setup for in-context translation. If you deal with subtitles a lot, might be worth investing some time in setting it up.

    Waqar Ali
    @aliw77
    yes, i took at look at that as well, my workflow will be to farm out the translations to smartcat or phrase type service providers. Seeing thet Title can compile full segments and then re-split them back is incredibly smart, and ability to download from vimeo too, incredible
    Waqar Ali
    @aliw77
    for Continuous Translation, is the best practice to pull source files from the actual source repo or to setup an interim repo which aggregates several sources together. In my case, I will have ~5 different sources
    Igor Afanasyev
    @iafan
    Working with source repos is the best (the less moving parts—the better). Serge can easily work with multiple repos, and in most cases multiple repos means multiple translation projects on TMS side. This is just easier to work with, and easier to understand what comes from where. But if absolutely needed, it’s possible to set up Serge in a way that it pulls from multiple repos at once but then constructs a single target translation project.