Units API.

See the Weblate's Web API documentation for detailed description of the API.

GET /api/units/13183998/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "translation": "https://l10n.opensuse.org/api/translations/packages-i18n/perl-master/ja/?format=api",
    "source": [
        "This module is intended for use in operations that can be done in parallel where the number of processes to be forked off should be limited. Typical use is a downloader which will be retrieving hundreds/thousands of files.\n\nThe code for a downloader would look something like this:\n\n  use LWP::Simple;   use Parallel::ForkManager;\n\n  ...\n\n  my @links=(     [\"http://www.foo.bar/rulez.data\",\"rulez_data.txt\"],     [\"http://new.host/more_data.doc\",\"more_data.doc\"],     ...   );\n\n  ...\n\n     my $pm = Parallel::ForkManager->new(30);\n\n  LINKS:   foreach my $linkarray (@links) {     $pm->start and next LINKS; # do the fork\n\n    my ($link, $fn) = @$linkarray;     warn \"Cannot get $fn from $link\"       if getstore($link, $fn) != RC_OK;\n\n    $pm->finish; # do the exit in the child process   }   $pm->wait_all_children;\n\nFirst you need to instantiate the ForkManager with the \"new\" constructor. You must specify the maximum number of processes to be created. If you specify 0, then NO fork will be done; this is good for debugging purposes.\n\nNext, use $pm->start to do the fork. $pm returns 0 for the child process, and child pid for the parent process (see also perlfunc(1p)/fork()). The \"and next\" skips the internal loop in the parent process. NOTE: $pm->start dies if the fork fails.\n\n$pm->finish terminates the child process (assuming a fork was done in the \"start\").\n\nNOTE: You cannot use $pm->start if you are already in the child process. If you want to manage another set of subprocesses in the child process, you must instantiate another Parallel::ForkManager object!"
    ],
    "previous_source": "",
    "target": [
        "このモジュールは、分岐されるプロセスの数が制限される並列処理で使用することを意図しています。一般的な用途は、数百/数千のファイルを取得するダウンローダです。\n\nダウンローダのコードは次のようになります。\n\n  use LWP::Simple;   use Parallel::ForkManager;\n\n  ...\n\n  my @links=(     [\"http://www.foo.bar/rulez.data\",\"rulez_data.txt\"],     [\"http://new.host/more_data.doc\",\"more_data.doc\"],     ...   );\n\n  ...\n\n     my $pm = Parallel::ForkManager->new(30);\n\n  LINKS:   foreach my $linkarray (@links) {     $pm->start and next LINKS; # do the fork\n\n    my ($link, $fn) = @$linkarray;     warn \"Cannot get $fn from $link\"       if getstore($link, $fn) != RC_OK;\n\n    $pm->finish; # do the exit in the child process   }   $pm->wait_all_children;\n\n最初に、「new」コンストラクタでForkManagerをインスタンス化する必要があります。作成するプロセスの最大数を指定する必要があります。0を指定すると、forkは実行されません。これはデバッグの目的に適しています。\n\n次に、$pm->startを使用してフォークを行います。$pmは子プロセスには0を、親プロセスには子プロセスのpidを返します(perlfunc(1p)/fork()も参照)。「and next」は、親プロセスの内部ループをスキップします。注:フォークが失敗すると$pm->startは終了します。\n\n$pm->finishは子プロセスを終了します(\"start\"でフォークが行われたと仮定します)。\n\n注:すでに子プロセスに入っている場合は、$pm->startを使用できません。子プロセス内の別のサブプロセスセットを管理する場合は、別のParallel::ForkManagerオブジェクトをインスタンス化する必要があります!"
    ],
    "id_hash": -3196819468503407121,
    "content_hash": -3196819468503407121,
    "location": "",
    "context": "",
    "note": "tumbleweed/perl-Parallel-ForkManager/description",
    "flags": "",
    "labels": [],
    "state": 20,
    "fuzzy": false,
    "translated": true,
    "approved": false,
    "position": 2680,
    "has_suggestion": false,
    "has_comment": false,
    "has_failing_check": false,
    "num_words": 230,
    "source_unit": "https://l10n.opensuse.org/api/units/13182524/?format=api",
    "priority": 100,
    "id": 13183998,
    "web_url": "https://l10n.opensuse.org/translate/packages-i18n/perl-master/ja/?checksum=53a29da180cd25ef",
    "url": "https://l10n.opensuse.org/api/units/13183998/?format=api",
    "explanation": "",
    "extra_flags": "",
    "pending": false,
    "timestamp": "2022-02-23T16:53:45.140785Z"
}